Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Sep 3, 2023
1 parent 7f6904a commit ffdc32c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/ReferenceIntegrity/Mapping/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class Validator
/**
* Returns a list of available integrity actions
*
* @return array
* @return string[]
*
* @phpstan-return array<int, self::NULLIFY|self::PULL|self::RESTRICT>
*/
public function getIntegrityActions()
{
Expand Down
6 changes: 4 additions & 2 deletions src/SoftDeleteable/Filter/ODM/SoftDeleteableFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class SoftDeleteableFilter extends BsonFilter
/**
* Gets the criteria part to add to a query.
*
* @return array The criteria array, if there is available, empty array otherwise
* @return array<string, array<int, array<string, array<string, \DateTime>|null>>|null> The criteria array, if there is available, empty array otherwise
*
* @phpstan-return array<string, array<int, array<string, array{'$gt': \DateTime}|null>>|null>
*/
public function addFilterCriteria(ClassMetadata $targetEntity): array
{
Expand Down Expand Up @@ -96,7 +98,7 @@ public function enableForDocument($class)
}

/**
* @return SoftDeleteableListener|null
* @return SoftDeleteableListener
*/
protected function getListener()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tree/Entity/Repository/ClosureTreeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public function getNodesHierarchyQueryBuilder($node = null, $direct = false, arr
}

/**
* @return array|bool
* @return array<int, string>|bool
*/
public function verify()
{
Expand Down
4 changes: 3 additions & 1 deletion src/Tree/Entity/Repository/NestedTreeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ public function reorderAll($sortByField = null, $direction = 'ASC', $verify = tr
* options:
* - treeRootNode: (object) Optional tree root node to verify, if not the whole forest (only available for forests, not for single trees).
*
* @return array|bool true on success, error list on failure
* @return array<int, string>|bool true on success, error list on failure
*/
public function verify(/* array $options = [] */) // @phpstan-ignore-line
{
Expand Down Expand Up @@ -1172,6 +1172,8 @@ protected function validate()
/**
* Collect errors on given tree if
* where are any
*
* @param $errors array<int, string>
*/
private function verifyTree(array &$errors, ?object $root = null): void
{
Expand Down
12 changes: 6 additions & 6 deletions src/Tree/Hydrator/ORM/TreeObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setPropertyValue($object, $property, $value)
/**
* We hook into the `hydrateAllData` to map the children collection of the entity
*
* @return mixed[]
* @return array<int, object>
*/
protected function hydrateAllData()
{
Expand Down Expand Up @@ -93,9 +93,9 @@ protected function hydrateAllData()
* [parentId => [child1, child2, ...], ...]
* ```
*
* @param array $nodes
* @param array<int, object> $nodes
*
* @return array
* @return array<int|string, array<int, object>>
*/
protected function buildChildrenHashmap($nodes)
{
Expand All @@ -116,8 +116,8 @@ protected function buildChildrenHashmap($nodes)
}

/**
* @param array $nodes
* @param array $childrenHashmap
* @param array<int, object> $nodes
* @param array<int|string, array<int, object>> $childrenHashmap
*
* @return void
*/
Expand Down Expand Up @@ -152,7 +152,7 @@ protected function populateChildrenArray($nodes, $childrenHashmap)
/**
* @param array $nodes
*
* @return array
* @return array<int, object>
*/
protected function getRootNodes($nodes)
{
Expand Down

0 comments on commit ffdc32c

Please sign in to comment.