cs: Switch to a stricter way of coding - this might break in a lot of places.

This commit is contained in:
Pol Dellaiera
2021-11-30 13:33:18 +01:00
parent 28d2c42454
commit 47c5855a21
957 changed files with 9025 additions and 568 deletions

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Tests\Controller;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
@@ -26,7 +35,7 @@ use function array_key_exists;
* @internal
* @coversNothing
*/
class AccompanyingPeriodControllerTest extends WebTestCase
final class AccompanyingPeriodControllerTest extends WebTestCase
{
public const CLOSING_INPUT = 'chill_personbundle_accompanyingperiod[closingDate]';
@@ -54,8 +63,8 @@ class AccompanyingPeriodControllerTest extends WebTestCase
*/
public static function setUpBeforeClass()
{
static::bootKernel();
static::$em = static::$kernel->getContainer()
self::bootKernel();
self::$em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager');
}
@@ -64,12 +73,12 @@ class AccompanyingPeriodControllerTest extends WebTestCase
*/
public function setUp()
{
$this->client = static::createClient([], [
$this->client = self::createClient([], [
'PHP_AUTH_USER' => 'center a_social',
'PHP_AUTH_PW' => 'password',
]);
$center = static::$em->getRepository('ChillMainBundle:Center')
$center = self::$em->getRepository('ChillMainBundle:Center')
->findOneBy(['name' => 'Center A']);
$this->person = (new Person(new DateTime('2015-01-05')))
@@ -78,8 +87,8 @@ class AccompanyingPeriodControllerTest extends WebTestCase
->setCenter($center)
->setGender(Person::MALE_GENDER);
static::$em->persist($this->person);
static::$em->flush();
self::$em->persist($this->person);
self::$em->flush();
}
/**
@@ -87,10 +96,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase
*/
public function tearDown()
{
static::$em->refresh($this->person);
static::$em->remove($this->person);
self::$em->refresh($this->person);
self::$em->remove($this->person);
static::$em->flush();
self::$em->flush();
}
/**
@@ -557,10 +566,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase
}
$this->person->addAccompanyingPeriod($period);
static::$em->persist($period);
self::$em->persist($period);
}
static::$em->flush();
self::$em->flush();
}
/**
@@ -586,7 +595,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase
*/
protected function getRandomClosingMotive()
{
$motives = static::$em
$motives = self::$em
->getRepository('ChillPersonBundle:AccompanyingPeriod\ClosingMotive')
->findAll();