diff --git a/src/Repository/AttachmentContainingDBElementRepository.php b/src/Repository/AttachmentContainingDBElementRepository.php index f346b257..6b58ca05 100644 --- a/src/Repository/AttachmentContainingDBElementRepository.php +++ b/src/Repository/AttachmentContainingDBElementRepository.php @@ -41,6 +41,7 @@ class AttachmentContainingDBElementRepository extends NamedDBElementRepository * Similar to the findByIDInMatchingOrder function, but it also hints to doctrine that the master picture attachment should be fetched eagerly. * @param array $ids * @return array + * @phpstan-return array */ public function getElementsAndPreviewAttachmentByIDs(array $ids): array { diff --git a/src/Repository/StructuralDBElementRepository.php b/src/Repository/StructuralDBElementRepository.php index 3d1c6f56..978cee20 100644 --- a/src/Repository/StructuralDBElementRepository.php +++ b/src/Repository/StructuralDBElementRepository.php @@ -30,7 +30,7 @@ use RecursiveIteratorIterator; /** * @see \App\Tests\Repository\StructuralDBElementRepositoryTest * @template TEntityClass of AbstractStructuralDBElement - * @extends NamedDBElementRepository + * @extends AttachmentContainingDBElementRepository */ class StructuralDBElementRepository extends AttachmentContainingDBElementRepository { diff --git a/src/Services/Trees/NodesListBuilder.php b/src/Services/Trees/NodesListBuilder.php index ebb2f93d..b74f67c8 100644 --- a/src/Services/Trees/NodesListBuilder.php +++ b/src/Services/Trees/NodesListBuilder.php @@ -48,10 +48,14 @@ class NodesListBuilder * Gets a flattened hierarchical tree. Useful for generating option lists. * In difference to the Repository Function, the results here are cached. * + * @template T of AbstractDBElement + * * @param string $class_name the class name of the entity you want to retrieve + * @phpstan-param class-string $class_name * @param AbstractStructuralDBElement|null $parent This entity will be used as root element. Set to null, to use global root * - * @return AbstractStructuralDBElement[] a flattened list containing the tree elements + * @return AbstractDBElement[] a flattened list containing the tree elements + * @phpstan-return list */ public function typeToNodesList(string $class_name, ?AbstractStructuralDBElement $parent = null): array { @@ -76,7 +80,7 @@ class NodesListBuilder * This functions returns the (cached) list of the IDs of the elements for the flattened tree. * @param string $class_name * @param AbstractStructuralDBElement|null $parent - * @return array + * @return int[] */ private function getFlattenedIDs(string $class_name, ?AbstractStructuralDBElement $parent = null): array { @@ -101,9 +105,7 @@ class NodesListBuilder * The value is cached for performance reasons. * * @template T of AbstractStructuralDBElement - * * @param T $element - * * @return AbstractStructuralDBElement[] * * @phpstan-return list