cs: Enable risky rule static_lambda.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:43:34 +01:00
parent a9188355c5
commit 91d12c4a96
111 changed files with 212 additions and 212 deletions

View File

@@ -351,7 +351,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
*/
public function getActiveChildren(): Collection
{
return $this->children->filter(fn (ThirdParty $tp) => $tp->getActive());
return $this->children->filter(static fn (ThirdParty $tp) => $tp->getActive());
}
public function getAddress(): ?Address
@@ -806,7 +806,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
public function setTypesAndCategories(array $typesAndCategories): self
{
$types = array_filter($typesAndCategories, fn ($item) => !$item instanceof ThirdPartyCategory);
$types = array_filter($typesAndCategories, static fn ($item) => !$item instanceof ThirdPartyCategory);
$this->setTypes($types);
// handle categories
@@ -814,8 +814,8 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
$this->addTypesAndCategories($t);
}
$categories = array_filter($typesAndCategories, fn ($item) => $item instanceof ThirdPartyCategory);
$categoriesHashes = array_map(fn (ThirdPartyCategory $c) => spl_object_hash($c), $categories);
$categories = array_filter($typesAndCategories, static fn ($item) => $item instanceof ThirdPartyCategory);
$categoriesHashes = array_map(static fn (ThirdPartyCategory $c) => spl_object_hash($c), $categories);
foreach ($categories as $c) {
$this->addCategory($c);