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

@@ -329,7 +329,7 @@ class AccompanyingCourseApiControllerTest extends WebTestCase
// check that the person id is contained
$participationsPersonsIds = array_map(
function ($participation) { return $participation->person->id; },
static function ($participation) { return $participation->person->id; },
$data->participations
);

View File

@@ -151,7 +151,7 @@ class HouseholdApiControllerTest extends WebTestCase
$this->assertArrayHasKey('count', $data);
$this->assertArrayHasKey('results', $data);
$householdIds = array_map(function ($r) {
$householdIds = array_map(static function ($r) {
return $r['id'];
}, $data['results']);

View File

@@ -290,22 +290,22 @@ class PersonControllerUpdateTest extends WebTestCase
public function validTextFieldsProvider()
{
return [
['firstName', 'random Value', function (Person $person) { return $person->getFirstName(); }],
['lastName', 'random Value', function (Person $person) { return $person->getLastName(); }],
['firstName', 'random Value', static function (Person $person) { return $person->getFirstName(); }],
['lastName', 'random Value', static function (Person $person) { return $person->getLastName(); }],
// reminder: this value is capitalized
['placeOfBirth', 'A PLACE', function (Person $person) { return $person->getPlaceOfBirth(); }],
['birthdate', '1980-12-15', function (Person $person) { return $person->getBirthdate()->format('Y-m-d'); }],
['phonenumber', '+32123456789', function (Person $person) { return $person->getPhonenumber(); }],
['memo', 'jfkdlmq jkfldmsq jkmfdsq', function (Person $person) { return $person->getMemo(); }],
['countryOfBirth', 'BE', function (Person $person) { return $person->getCountryOfBirth()->getCountryCode(); }],
['nationality', 'FR', function (Person $person) { return $person->getNationality()->getCountryCode(); }],
['placeOfBirth', '', function (Person $person) { return $person->getPlaceOfBirth(); }],
['birthdate', '', function (Person $person) { return $person->getBirthdate(); }],
['phonenumber', '', function (Person $person) { return $person->getPhonenumber(); }],
['memo', '', function (Person $person) { return $person->getMemo(); }],
['countryOfBirth', null, function (Person $person) { return $person->getCountryOfBirth(); }],
['nationality', null, function (Person $person) { return $person->getNationality(); }],
['gender', Person::FEMALE_GENDER, function (Person $person) { return $person->getGender(); }],
['placeOfBirth', 'A PLACE', static function (Person $person) { return $person->getPlaceOfBirth(); }],
['birthdate', '1980-12-15', static function (Person $person) { return $person->getBirthdate()->format('Y-m-d'); }],
['phonenumber', '+32123456789', static function (Person $person) { return $person->getPhonenumber(); }],
['memo', 'jfkdlmq jkfldmsq jkmfdsq', static function (Person $person) { return $person->getMemo(); }],
['countryOfBirth', 'BE', static function (Person $person) { return $person->getCountryOfBirth()->getCountryCode(); }],
['nationality', 'FR', static function (Person $person) { return $person->getNationality()->getCountryCode(); }],
['placeOfBirth', '', static function (Person $person) { return $person->getPlaceOfBirth(); }],
['birthdate', '', static function (Person $person) { return $person->getBirthdate(); }],
['phonenumber', '', static function (Person $person) { return $person->getPhonenumber(); }],
['memo', '', static function (Person $person) { return $person->getMemo(); }],
['countryOfBirth', null, static function (Person $person) { return $person->getCountryOfBirth(); }],
['nationality', null, static function (Person $person) { return $person->getNationality(); }],
['gender', Person::FEMALE_GENDER, static function (Person $person) { return $person->getGender(); }],
];
}

View File

@@ -195,12 +195,12 @@ class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
public function validTextFieldsProvider()
{
return [
['firstName', 'random Value', function (Person $person) { return $person->getFirstName(); }],
['lastName', 'random Value', function (Person $person) { return $person->getLastName(); }],
['birthdate', '15-12-1980', function (Person $person) { return $person->getBirthdate()->format('d-m-Y'); }],
['memo', 'jfkdlmq jkfldmsq jkmfdsq', function (Person $person) { return $person->getMemo(); }],
['birthdate', '', function (Person $person) { return $person->getBirthdate(); }],
['gender', Person::FEMALE_GENDER, function (Person $person) { return $person->getGender(); }],
['firstName', 'random Value', static function (Person $person) { return $person->getFirstName(); }],
['lastName', 'random Value', static function (Person $person) { return $person->getLastName(); }],
['birthdate', '15-12-1980', static function (Person $person) { return $person->getBirthdate()->format('d-m-Y'); }],
['memo', 'jfkdlmq jkfldmsq jkmfdsq', static function (Person $person) { return $person->getMemo(); }],
['birthdate', '', static function (Person $person) { return $person->getBirthdate(); }],
['gender', Person::FEMALE_GENDER, static function (Person $person) { return $person->getGender(); }],
];
}