umbrellio /
laravel-ltree
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Umbrellio\LTree\Services; |
||
| 6 | |||
| 7 | use Illuminate\Database\Eloquent\Model; |
||
| 8 | use Umbrellio\LTree\Helpers\LTreeHelper; |
||
| 9 | use Umbrellio\LTree\Interfaces\LTreeModelInterface; |
||
| 10 | use Umbrellio\LTree\Interfaces\LTreeServiceInterface; |
||
| 11 | |||
| 12 | final class LTreeService implements LTreeServiceInterface |
||
| 13 | { |
||
| 14 | private $helper; |
||
| 15 | |||
| 16 | public function __construct(LTreeHelper $helper) |
||
| 17 | { |
||
| 18 | $this->helper = $helper; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function createPath(LTreeModelInterface $model): void |
||
| 22 | { |
||
| 23 | $this->helper->buildPath($model); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param LTreeModelInterface|Model $model |
||
| 28 | */ |
||
| 29 | public function updatePath(LTreeModelInterface $model): void |
||
| 30 | { |
||
| 31 | $columns = array_intersect_key($model->getAttributes(), array_flip($model->getLtreeProxyUpdateColumns())); |
||
|
0 ignored issues
–
show
|
|||
| 32 | |||
| 33 | $this->helper->moveNode($model, $model->ltreeParent, $columns); |
||
|
0 ignored issues
–
show
|
|||
| 34 | $this->helper->buildPath($model); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param LTreeModelInterface|Model $model |
||
| 39 | */ |
||
| 40 | public function dropDescendants(LTreeModelInterface $model): void |
||
| 41 | { |
||
| 42 | $columns = array_intersect_key($model->getAttributes(), array_flip($model->getLtreeProxyDeleteColumns())); |
||
| 43 | |||
| 44 | $this->helper->dropDescendants($model, $columns); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.