mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
cs: Enable risky rule static_lambda
.
This commit is contained in:
@@ -74,7 +74,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
|
||||
private function getCenters(): Iterator
|
||||
{
|
||||
$references = array_map(
|
||||
function ($a) { return $a['ref']; },
|
||||
static function ($a) { return $a['ref']; },
|
||||
LoadCenters::$centers
|
||||
);
|
||||
$number = random_int(1, count($references));
|
||||
|
@@ -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);
|
||||
|
@@ -104,7 +104,7 @@ class ThirdPartyType extends AbstractType
|
||||
'choice_label' => function (Civility $civility): string {
|
||||
return $this->translatableStringHelper->localize($civility->getName());
|
||||
},
|
||||
'query_builder' => function (EntityRepository $er): QueryBuilder {
|
||||
'query_builder' => static function (EntityRepository $er): QueryBuilder {
|
||||
return $er->createQueryBuilder('c')
|
||||
->where('c.active = true');
|
||||
},
|
||||
@@ -117,7 +117,7 @@ class ThirdPartyType extends AbstractType
|
||||
'choice_label' => function (ThirdPartyProfession $profession): string {
|
||||
return $this->translatableStringHelper->localize($profession->getName());
|
||||
},
|
||||
'query_builder' => function (EntityRepository $er): QueryBuilder {
|
||||
'query_builder' => static function (EntityRepository $er): QueryBuilder {
|
||||
return $er->createQueryBuilder('p')
|
||||
->where('p.active = true');
|
||||
},
|
||||
|
@@ -96,7 +96,7 @@ class PickThirdPartyType extends AbstractType
|
||||
|
||||
$resolver
|
||||
->setDefault('class', ThirdParty::class)
|
||||
->setDefault('choice_label', function (ThirdParty $tp) {
|
||||
->setDefault('choice_label', static function (ThirdParty $tp) {
|
||||
return $tp->getName();
|
||||
})
|
||||
->setDefault('choice_loader', function (Options $options) {
|
||||
|
Reference in New Issue
Block a user