cs: Enable risky rule random_api_migration.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:55:02 +01:00
parent 91d12c4a96
commit a43784c3a1
13 changed files with 27 additions and 27 deletions

View File

@@ -121,12 +121,12 @@ class LoadCustomFields extends AbstractFixture implements
// select a set of people and add data
foreach ($personIds as $id) {
// add info on 1 person on 2
if (rand(0, 1) === 1) {
if (mt_rand(0, 1) === 1) {
/** @var Person $person */
$person = $manager->getRepository(Person::class)->find($id);
$person->setCFData([
'remarques' => $this->createCustomFieldText()
->serialize($faker->text(rand(150, 250)), $this->customFieldText),
->serialize($faker->text(mt_rand(150, 250)), $this->customFieldText),
'document-d-identite' => $this->createCustomFieldChoice()
->serialize([$choices[array_rand($choices)]], $this->customFieldChoice),
]);

View File

@@ -491,10 +491,10 @@ class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, Con
return (new Address())
->setStreetAddress1($this->faker->streetAddress)
->setStreetAddress2(
rand(0, 9) > 5 ? $this->faker->streetAddress : ''
mt_rand(0, 9) > 5 ? $this->faker->streetAddress : ''
)
->setPoint(
rand(0, 9) > 5 ? $this->getRandomPoint() : null
mt_rand(0, 9) > 5 ? $this->getRandomPoint() : null
)
->setPostcode($this->getReference(
LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)]
@@ -511,8 +511,8 @@ class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, Con
{
$lonBrussels = 4.35243;
$latBrussels = 50.84676;
$lon = $lonBrussels + 0.01 * rand(-5, 5);
$lat = $latBrussels + 0.01 * rand(-5, 5);
$lon = $lonBrussels + 0.01 * mt_rand(-5, 5);
$lat = $latBrussels + 0.01 * mt_rand(-5, 5);
return Point::fromLonLat($lon, $lat);
}