mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: fix tests to find ancestor to all SocialAction and SocialIssue
This commit is contained in:
parent
32ddc5465c
commit
531e05fc3a
@ -389,6 +389,8 @@ class SocialAction
|
||||
{
|
||||
$this->parent = $parent;
|
||||
|
||||
$parent->addChild($this);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -71,11 +71,15 @@ class SocialIssue
|
||||
$this->socialActions = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal use @see{SocialIssue::setParent} instead
|
||||
* @param SocialIssue $child
|
||||
* @return $this
|
||||
*/
|
||||
public function addChild(self $child): self
|
||||
{
|
||||
if (!$this->children->contains($child)) {
|
||||
$this->children[] = $child;
|
||||
$child->setParent($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@ -216,10 +220,10 @@ class SocialIssue
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection|SocialIssue[] $socialIssues
|
||||
* @param array|SocialIssue[] $socialIssues
|
||||
* @return Collection
|
||||
*/
|
||||
public static function getDescendantsWithThisForIssues(Collection $socialIssues): Collection
|
||||
public static function getDescendantsWithThisForIssues(array $socialIssues): Collection
|
||||
{
|
||||
$unique = [];
|
||||
|
||||
@ -351,6 +355,8 @@ class SocialIssue
|
||||
{
|
||||
$this->parent = $parent;
|
||||
|
||||
$parent->addChild($this);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -50,4 +50,4 @@ final class SocialActionTest extends TestCase
|
||||
$this->assertNotContains($unrelatedB, $actual);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user