apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -13,17 +13,14 @@ namespace Chill\PersonBundle\Tests\Controller;
use Chill\MainBundle\Test\PrepareClientTrait;
use Chill\PersonBundle\Entity\Household\Household;
use DateInterval;
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Request;
use function array_pop;
use function shuffle;
/**
* @internal
*
* @coversNothing
*/
final class HouseholdControllerTest extends WebTestCase
@@ -48,7 +45,7 @@ final class HouseholdControllerTest extends WebTestCase
$em = self::$container->get(EntityManagerInterface::class);
$ids = $em->createQuery(
sprintf("SELECT DISTINCT h.id FROM %s h JOIN h.members m JOIN m.person p JOIN p.centerHistory ch JOIN ch.center c WHERE c.name = :center AND ch.endDate IS NULL", Household::class)
sprintf('SELECT DISTINCT h.id FROM %s h JOIN h.members m JOIN m.person p JOIN p.centerHistory ch JOIN ch.center c WHERE c.name = :center AND ch.endDate IS NULL', Household::class)
)
->setParameter('center', 'Center A')
->setMaxResults(100)
@@ -58,13 +55,13 @@ final class HouseholdControllerTest extends WebTestCase
throw new \RuntimeException('no household ids with center "Center A"');
}
shuffle($ids);
\shuffle($ids);
yield [array_pop($ids)['id']];
yield [\array_pop($ids)['id']];
yield [array_pop($ids)['id']];
yield [\array_pop($ids)['id']];
yield [array_pop($ids)['id']];
yield [\array_pop($ids)['id']];
self::ensureKernelShutdown();
}
@@ -117,8 +114,8 @@ final class HouseholdControllerTest extends WebTestCase
$form['household[commentMembers][comment]'] = 'This is a text **generated** by automatic tests';
$form['household[waitingForBirth]']->tick();
$form['household[waitingForBirthDate]'] = (new DateTime('today'))
->add(new DateInterval('P1M'))->format('Y-m-d');
$form['household[waitingForBirthDate]'] = (new \DateTime('today'))
->add(new \DateInterval('P1M'))->format('Y-m-d');
$this->client->submit($form);