diff --git a/phpstan.neon b/phpstan.neon index 8dafb33..e697482 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,7 +2,7 @@ includes: - phpstan-baseline.neon parameters: - level: 6 + level: 7 paths: - src - tests diff --git a/src/Collection.php b/src/Collection.php index 64465f5..c26bb79 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -17,7 +17,7 @@ class Collection extends AbstractLazyCollection { /** - * @param list $type + * @param list> $type */ public function __construct( private readonly string $relationTable, diff --git a/src/Condition.php b/src/Condition.php index a8fb6f9..e0ede83 100644 --- a/src/Condition.php +++ b/src/Condition.php @@ -96,14 +96,14 @@ final public static function forValue(mixed $value, string $tableColumn, ?Compar if (is_array($value)) { if ($comparator === Comparator::IN_OR_EMPTY) { - return new CompositeCondition([new InCondition($tableColumn, $value), new EmptyCondition($tableColumn)], Conjunction::OR); + return new CompositeCondition([new InCondition($tableColumn, array_values($value)), new EmptyCondition($tableColumn)], Conjunction::OR); } if ($comparator === Comparator::NOT_IN_OR_EMPTY) { - return new CompositeCondition([new InCondition($tableColumn, $value, true), new EmptyCondition($tableColumn)], Conjunction::OR); + return new CompositeCondition([new InCondition($tableColumn, array_values($value), true), new EmptyCondition($tableColumn)], Conjunction::OR); } - return new InCondition($tableColumn, $value); + return new InCondition($tableColumn, array_values($value)); } return null; diff --git a/src/EntityManager.php b/src/EntityManager.php index 7c2b029..f5aeb56 100644 --- a/src/EntityManager.php +++ b/src/EntityManager.php @@ -16,6 +16,7 @@ public function __construct(private readonly ConnectionInterface $connection, pr } /** + * @param class-string $targetClass * @param list $conditions * @param list $sorting * @@ -39,8 +40,9 @@ public function findAll(string $targetClass, array $conditions = [], array $sort } /** - * @param array $conditions - * @param array $sorting + * @param class-string $targetClass + * @param list $conditions + * @param list $sorting * * @throws OrmException */ @@ -60,6 +62,7 @@ public function findOne(string $targetClass, array $conditions = [], array $sort } /** + * @param class-string $targetClass * @param array $conditions * * @throws OrmException @@ -84,6 +87,7 @@ public function getCount(string $targetClass, array $conditions): int } /** + * @param class-string $targetClass * @param list $conditions * @param list $sorting * @@ -254,7 +258,7 @@ public function delete(EntityInterface $entity): void * * @throws OrmException * - * @return array{DoctrineCollection,string,string,string,list} + * @return array{DoctrineCollection,string,string,string,list} */ private function getRelation(EntityInterface $entity, array $config): array { @@ -274,7 +278,7 @@ private function getRelation(EntityInterface $entity, array $config): array } /** - * @param list,string,string,string,list}> $relations + * @param list,string,string,string,list}> $relations */ private function handleRelations(EntityInterface $entity, array $relations): void { diff --git a/src/EntityMeta.php b/src/EntityMeta.php index b9a3797..aeea8f2 100644 --- a/src/EntityMeta.php +++ b/src/EntityMeta.php @@ -46,6 +46,9 @@ public function getProperties(string $entityClass): array return $types; } + /** + * @param class-string $entityClass + */ public function getPrimaryColumn(string $entityClass): string { $types = $this->getProperties($entityClass); @@ -128,8 +131,8 @@ private function getTableNamesFromEntity(string $entityClass): array * @return array */ private function getTypesFromEntity(string $entityClass): array diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index 216357b..c4a2498 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -23,6 +23,9 @@ public function __construct( ) { } + /** + * @param class-string $entityClass + */ public function buildFrom(string $entityClass, ?string $joinColumn = null): string { $targetTables = $this->entityMeta->getTableNames($entityClass); diff --git a/src/SchemaManager.php b/src/SchemaManager.php index 2f6d95d..389b7da 100644 --- a/src/SchemaManager.php +++ b/src/SchemaManager.php @@ -16,6 +16,9 @@ public function __construct( ) { } + /** + * @param class-string $entityClass + */ public function createTable(string $entityClass): void { $tableNames = $this->entityMeta->getTableNames($entityClass); @@ -38,7 +41,7 @@ public function createTable(string $entityClass): void * @param list $keys * @param array $relationTables * - * @return array> + * @return array */ private function getFieldsForEntity(string $entityClass, array &$keys, array &$relationTables): array {