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:
@@ -230,7 +230,7 @@ class ExportManagerTest extends KernelTestCase
|
||||
Argument::Type('array'),
|
||||
Argument::is(['a' => 'b'])
|
||||
)
|
||||
->will(function () use ($em) {
|
||||
->will(static function () use ($em) {
|
||||
$qb = $em->createQueryBuilder();
|
||||
|
||||
return $qb->addSelect('COUNT(user.id) as export')
|
||||
@@ -254,7 +254,7 @@ class ExportManagerTest extends KernelTestCase
|
||||
Argument::is([0, 1]),
|
||||
Argument::Type('array')
|
||||
)
|
||||
->willReturn(function ($value) {
|
||||
->willReturn(static function ($value) {
|
||||
switch ($value) {
|
||||
case 0:
|
||||
case 1:
|
||||
@@ -294,7 +294,7 @@ class ExportManagerTest extends KernelTestCase
|
||||
Argument::is(['cat a', 'cat b']),
|
||||
Argument::is([])
|
||||
)
|
||||
->willReturn(function ($value) {
|
||||
->willReturn(static function ($value) {
|
||||
switch ($value) {
|
||||
case '_header': return 'foo_header';
|
||||
|
||||
|
@@ -50,7 +50,7 @@ class ExtractDateFromPatternTest extends TestCase
|
||||
$this->assertContainsOnlyInstancesOf(DateTimeImmutable::class, $result->getFound());
|
||||
|
||||
$dates = array_map(
|
||||
function (DateTimeImmutable $d) {
|
||||
static function (DateTimeImmutable $d) {
|
||||
return $d->format('Y-m-d');
|
||||
},
|
||||
$result->getFound()
|
||||
|
@@ -206,7 +206,7 @@ class AuthorizationHelperTest extends KernelTestCase
|
||||
$centerA
|
||||
);
|
||||
|
||||
$usernames = array_map(function (User $u) { return $u->getUsername(); }, $users);
|
||||
$usernames = array_map(static function (User $u) { return $u->getUsername(); }, $users);
|
||||
|
||||
$this->assertContains('center a_social', $usernames);
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ class DateRangeCoveringTest extends TestCase
|
||||
$intersections = $cover->getIntersections();
|
||||
|
||||
// sort the intersections to compare them in expected order
|
||||
usort($intersections, function ($a, $b) {
|
||||
usort($intersections, static function ($a, $b) {
|
||||
if ($a[0] === $b[0]) {
|
||||
return $a[1] <=> $b[1];
|
||||
}
|
||||
|
Reference in New Issue
Block a user