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

@@ -31,7 +31,7 @@ class SearchUserApiProvider implements SearchApiInterface
public function prepare(array $metadatas): void
{
$ids = array_map(fn ($m) => $m['id'], $metadatas);
$ids = array_map(static fn ($m) => $m['id'], $metadatas);
$this->userRepository->findBy(['id' => $ids]);
}

View File

@@ -161,7 +161,7 @@ class SearchApi
private function findQueries($pattern, array $types, array $parameters): array
{
return array_map(
fn ($p) => $p->provideQuery($pattern, $parameters),
static fn ($p) => $p->provideQuery($pattern, $parameters),
$this->findProviders($pattern, $types, $parameters),
);
}

View File

@@ -88,7 +88,7 @@ class SearchProvider
public function getByOrder()
{
//sort the array
uasort($this->searchServices, function (SearchInterface $a, SearchInterface $b) {
uasort($this->searchServices, static function (SearchInterface $a, SearchInterface $b) {
if ($a->getOrder() == $b->getOrder()) {
return 0;
}
@@ -121,7 +121,7 @@ class SearchProvider
public function getHasAdvancedFormSearchServices()
{
//sort the array
uasort($this->hasAdvancedFormSearchServices, function (SearchInterface $a, SearchInterface $b) {
uasort($this->hasAdvancedFormSearchServices, static function (SearchInterface $a, SearchInterface $b) {
if ($a->getOrder() == $b->getOrder()) {
return 0;
}