for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace kalanis\kw_tree\DataSources;
use kalanis\kw_tree\Essentials\FileNode;
use kalanis\kw_tree\Interfaces\ITree;
abstract class ASources implements ITree
{
/** @var string[] */
protected array $startPath = [];
protected string $ordering = ITree::ORDER_NONE;
/** @var callable|null */
protected $filterCallback = null;
protected bool $recursive = false;
protected ?FileNode $startNode = null;
public function setStartPath(array $path): ITree
$this->startPath = $path;
return $this;
}
public function setOrdering(string $order, ?string $by = null): ITree
$order = strtoupper($order);
$this->ordering = in_array($order, [ITree::ORDER_NONE, ITree::ORDER_DESC, ITree::ORDER_ASC]) ? $order : $this->ordering;
public function setFilterCallback($callback): ITree
$this->filterCallback = $callback;
public function wantDeep(bool $want): ITree
$this->recursive = $want;
public function getRoot(): ?FileNode
return $this->startNode;