mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-12 23:27:39 +00:00
Add stricter return type annotations in SocialIssue entity and remove redundant condition
This fix phpstan issue.
This commit is contained in:
@@ -122,6 +122,7 @@ class SocialIssue
|
||||
* get all the ancestors of the social issue.
|
||||
*
|
||||
* @param bool $includeThis if the array in the result must include the present SocialIssue
|
||||
* @return list<SocialIssue>
|
||||
*/
|
||||
public function getAncestors(bool $includeThis = true): array
|
||||
{
|
||||
@@ -176,7 +177,7 @@ class SocialIssue
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|SocialAction[] All the descendant social actions of the entity
|
||||
* @return Collection<int, SocialAction> All the descendant social actions of the entity
|
||||
*/
|
||||
public function getDescendantsSocialActions(): Collection
|
||||
{
|
||||
@@ -239,7 +240,7 @@ class SocialIssue
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<SocialAction> All the social actions of the entity, it's
|
||||
* @return Collection<int, SocialAction> All the social actions of the entity, it's
|
||||
* the descendants and it's parents
|
||||
*/
|
||||
public function getRecursiveSocialActions(): Collection
|
||||
@@ -249,17 +250,13 @@ class SocialIssue
|
||||
// Get social actions from parent issues
|
||||
foreach ($this->getAncestors(false) as $ancestor) {
|
||||
foreach ($ancestor->getDescendantsSocialActions() as $descendant) {
|
||||
if (!$recursiveSocialActions->contains($descendant)) {
|
||||
$recursiveSocialActions->add($descendant);
|
||||
}
|
||||
$recursiveSocialActions->add($descendant);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getDescendantsWithThis() as $socialIssue) {
|
||||
foreach ($socialIssue->getDescendantsSocialActions() as $descendant) {
|
||||
if (!$recursiveSocialActions->contains($descendant)) {
|
||||
$recursiveSocialActions->add($descendant);
|
||||
}
|
||||
$recursiveSocialActions->add($descendant);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user