One Hat Cyber Team
Your IP:
216.73.216.174
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
proc
/
self
/
root
/
home
/
fluxyjvi
/
www
/
assets
/
images
/
Edit File:
Visitor.tar
PreOrderVisitor.php 0000644 00000001201 15107345313 0010353 0 ustar 00 <?php /** * Copyright (c) 2013-2020 Nicolò Martini * * For the full copyright and license information, please view * the LICENSE.md file that was distributed with this source code. * * @see https://github.com/nicmart/Tree */ namespace Tree\Visitor; use Tree\Node\NodeInterface; class PreOrderVisitor implements Visitor { public function visit(NodeInterface $node) { $nodes = [ $node, ]; foreach ($node->getChildren() as $child) { $nodes = \array_merge( $nodes, $child->accept($this) ); } return $nodes; } } Visitor.php 0000644 00000001027 15107345313 0006716 0 ustar 00 <?php /** * Copyright (c) 2013-2020 Nicolò Martini * * For the full copyright and license information, please view * the LICENSE.md file that was distributed with this source code. * * @see https://github.com/nicmart/Tree */ namespace Tree\Visitor; use Tree\Node\NodeInterface; /** * Visitor interface for Nodes. * * @author Nicolò Martini <nicmartnic@gmail.com> */ interface Visitor { /** * @param NodeInterface $node * * @return mixed */ public function visit(NodeInterface $node); } YieldVisitor.php 0000644 00000001172 15107345313 0007706 0 ustar 00 <?php /** * Copyright (c) 2013-2020 Nicolò Martini * * For the full copyright and license information, please view * the LICENSE.md file that was distributed with this source code. * * @see https://github.com/nicmart/Tree */ namespace Tree\Visitor; use Tree\Node\NodeInterface; class YieldVisitor implements Visitor { public function visit(NodeInterface $node) { if ($node->isLeaf()) { return [$node]; } $yield = []; foreach ($node->getChildren() as $child) { $yield = \array_merge($yield, $child->accept($this)); } return $yield; } } PostOrderVisitor.php 0000644 00000001201 15107345313 0010552 0 ustar 00 <?php /** * Copyright (c) 2013-2020 Nicolò Martini * * For the full copyright and license information, please view * the LICENSE.md file that was distributed with this source code. * * @see https://github.com/nicmart/Tree */ namespace Tree\Visitor; use Tree\Node\NodeInterface; class PostOrderVisitor implements Visitor { public function visit(NodeInterface $node) { $nodes = []; foreach ($node->getChildren() as $child) { $nodes = \array_merge( $nodes, $child->accept($this) ); } $nodes[] = $node; return $nodes; } }
Simpan