phpstan, rector, phpcs fixes

This commit is contained in:
2025-05-08 10:59:54 +02:00
parent c4b760c452
commit 6b1696b62e
17 changed files with 51 additions and 54 deletions

View File

@@ -200,7 +200,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
$this->animators->removeElement($tp);
}
public function getCenter(): ?Center
public function getCenter(): Center
{
return $this->center;
}

View File

@@ -52,6 +52,7 @@ class EventBudgetElement
{
$this->id = $id;
}
public function getAmount(): float
{
return (float) $this->amount;

View File

@@ -80,24 +80,14 @@ class EventTheme
return $this->name;
}
/**
* Set active.
*
* @return EventTheme
*/
public function setIsActive(bool $active): static
public function setIsActive(bool $active): self
{
$this->isActive = $active;
return $this;
}
/**
* Set label.
*
* @return EventTheme
*/
public function setName(array $label): static
public function setName(array $label): self
{
$this->name = $label;
@@ -130,23 +120,9 @@ class EventTheme
return $this->children;
}
public function getDescendants(): Collection
public function hasChildren(): bool
{
$descendants = new ArrayCollection();
foreach ($this->getChildren() as $child) {
if (!$descendants->contains($child)) {
$descendants->add($child);
foreach ($child->getDescendants() as $descendantsOfChild) {
if (!$descendants->contains($descendantsOfChild)) {
$descendants->add($descendantsOfChild);
}
}
}
}
return $descendants;
return 0 < $this->getChildren()->count();
}
public function hasParent(): bool