diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4acd070..e4fb77d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,15 +1,15 @@ parameters: ignoreErrors: - - - message: '#^Call to an undefined method Kalnoy\\Nestedset\\Contracts\\NodeQueryBuilder\\:\:whereIn\(\)\.$#' - identifier: method.notFound - count: 1 - path: src/QueryBuilder.php + # - + # message: '#^Call to an undefined method Kalnoy\\Nestedset\\Contracts\\NodeQueryBuilder\\:\:whereIn\(\)\.$#' + # identifier: method.notFound + # count: 1 + # path: src/QueryBuilder.php - - - message: '#^Dynamic call to static method Kalnoy\\Nestedset\\QueryBuilder\\:\:whereRaw\(\)\.$#' - identifier: staticMethod.dynamicCall - count: 1 - path: src/QueryBuilder.php + # - + # message: '#^Dynamic call to static method Kalnoy\\Nestedset\\QueryBuilder\\:\:whereRaw\(\)\.$#' + # identifier: staticMethod.dynamicCall + # count: 1 + # path: src/QueryBuilder.php diff --git a/src/Contracts/NestedSetCollection.php b/src/Contracts/NestedSetCollection.php index e241719..c65040c 100644 --- a/src/Contracts/NestedSetCollection.php +++ b/src/Contracts/NestedSetCollection.php @@ -9,8 +9,9 @@ * * @require-extends \Illuminate\Database\Eloquent\Collection * - * @method NestedSetCollection groupBy(string $column) - * @method array all() + * @method NestedSetCollection groupBy(string $column) + * @method array all() + * @method \Illuminate\Support\Collection toBase() */ interface NestedSetCollection { diff --git a/src/Contracts/NodeQueryBuilder.php b/src/Contracts/NodeQueryBuilder.php index e5787ff..567b101 100644 --- a/src/Contracts/NodeQueryBuilder.php +++ b/src/Contracts/NodeQueryBuilder.php @@ -29,6 +29,9 @@ * @method NodeQueryBuilder orderBy(string $column, string $direction = 'asc') * @method NodeQueryBuilder when(bool $value, \Closure $callback) * @method BaseQueryBuilder toBase() + * @method NodeQueryBuilder whereIn(string $column, array $values, string $boolean = 'and', string $not = false) + * @method NodeQueryBuilder whereRaw(string $sql, string[] $bindings = [], string $boolean = 'and') + * @method int delete(null|mixed $id = null) */ interface NodeQueryBuilder extends Builder { diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index 3e4cbd4..7332afd 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -384,7 +384,7 @@ public function whereIsLeaf(): NodeQueryBuilder { list($lft, $rgt) = $this->wrappedColumns(); - return $this->whereRaw("$lft = $rgt - 1"); + return $this->whereRaw("$lft = $rgt - 1"); /** @phpstan-ignore staticMethod.dynamicCall */ } /**