mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
php cs fixes after updating php cs fixer
This commit is contained in:
@@ -43,7 +43,7 @@ class GeographicalUnitByAddressApiControllerTest extends WebTestCase
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
$nb = $em->createQuery('SELECT COUNT(a) FROM '.Address::class.' a')->getSingleScalarResult();
|
||||
/** @var \Chill\MainBundle\Entity\Address $random */
|
||||
/** @var Address $random */
|
||||
$random = $em->createQuery('SELECT a FROM '.Address::class.' a')
|
||||
->setFirstResult(random_int(0, $nb))
|
||||
->setMaxResults(1)
|
||||
|
@@ -161,7 +161,9 @@ final class CronManagerTest extends TestCase
|
||||
|
||||
class JobCanRun implements CronJobInterface
|
||||
{
|
||||
public function __construct(private readonly string $key) {}
|
||||
public function __construct(private readonly string $key)
|
||||
{
|
||||
}
|
||||
|
||||
public function canRun(?CronJobExecution $cronJobExecution): bool
|
||||
{
|
||||
|
@@ -58,7 +58,7 @@ final class ExportManagerTest extends KernelTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->prophet = new \Prophecy\Prophet();
|
||||
$this->prophet = new Prophet();
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
@@ -370,7 +370,7 @@ final class ExportManagerTest extends KernelTestCase
|
||||
$user = $this->prepareUser([]);
|
||||
|
||||
$authorizationChecker = $this->prophet->prophesize();
|
||||
$authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class);
|
||||
$authorizationChecker->willImplement(AuthorizationCheckerInterface::class);
|
||||
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center)
|
||||
->willReturn(true);
|
||||
|
||||
@@ -399,7 +399,7 @@ final class ExportManagerTest extends KernelTestCase
|
||||
$user = $this->prepareUser([]);
|
||||
|
||||
$authorizationChecker = $this->prophet->prophesize();
|
||||
$authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class);
|
||||
$authorizationChecker->willImplement(AuthorizationCheckerInterface::class);
|
||||
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center)
|
||||
->willReturn(true);
|
||||
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $centerB)
|
||||
@@ -435,7 +435,7 @@ final class ExportManagerTest extends KernelTestCase
|
||||
);
|
||||
|
||||
$export = $this->prophet->prophesize();
|
||||
$export->willImplement(\Chill\MainBundle\Export\ExportInterface::class);
|
||||
$export->willImplement(ExportInterface::class);
|
||||
$export->requiredRole()->willReturn('CHILL_STAT_DUMMY');
|
||||
|
||||
$result = $exportManager->isGrantedForElement($export->reveal(), null, []);
|
||||
@@ -532,14 +532,17 @@ class DummyFilterWithApplying implements FilterInterface
|
||||
public function __construct(
|
||||
private readonly ?string $role,
|
||||
private readonly string $applyOn
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
return 'dummy';
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
@@ -556,7 +559,9 @@ class DummyFilterWithApplying implements FilterInterface
|
||||
return $this->role;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data) {}
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
@@ -572,14 +577,17 @@ class DummyExport implements ExportInterface
|
||||
* @var array<string>
|
||||
*/
|
||||
private readonly array $supportedModifiers,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
return 'dummy';
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
|
@@ -117,9 +117,13 @@ class SortExportElementTest extends KernelTestCase
|
||||
private function makeAggregator(string $title): AggregatorInterface
|
||||
{
|
||||
return new class ($title) implements AggregatorInterface {
|
||||
public function __construct(private readonly string $title) {}
|
||||
public function __construct(private readonly string $title)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
@@ -146,7 +150,9 @@ class SortExportElementTest extends KernelTestCase
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data) {}
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
@@ -158,14 +164,18 @@ class SortExportElementTest extends KernelTestCase
|
||||
private function makeFilter(string $title): FilterInterface
|
||||
{
|
||||
return new class ($title) implements FilterInterface {
|
||||
public function __construct(private readonly string $title) {}
|
||||
public function __construct(private readonly string $title)
|
||||
{
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
@@ -182,7 +192,9 @@ class SortExportElementTest extends KernelTestCase
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data) {}
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
|
@@ -258,8 +258,8 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
]);
|
||||
$helper = $this->getAuthorizationHelper();
|
||||
$entity = $this->prophesize();
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class);
|
||||
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.HasScopeInterface::class);
|
||||
$entity->getCenter()->willReturn($center);
|
||||
$entity->getScope()->willReturn($scope);
|
||||
|
||||
@@ -383,7 +383,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
]);
|
||||
$helper = $this->getAuthorizationHelper();
|
||||
$entity = $this->prophesize();
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||
$entity->getCenter()->willReturn($center);
|
||||
|
||||
$this->assertTrue($helper->userHasAccess(
|
||||
@@ -407,7 +407,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
|
||||
$helper = $this->getAuthorizationHelper();
|
||||
$entity = $this->prophesize();
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||
$entity->getCenter()->willReturn($center);
|
||||
|
||||
$this->assertTrue($helper->userHasAccess(
|
||||
@@ -431,8 +431,8 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
]);
|
||||
$helper = $this->getAuthorizationHelper();
|
||||
$entity = $this->prophesize();
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class);
|
||||
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.HasScopeInterface::class);
|
||||
$entity->getCenter()->willReturn($centerB);
|
||||
$entity->getScope()->willReturn($scope);
|
||||
|
||||
@@ -452,7 +452,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
]);
|
||||
$helper = $this->getAuthorizationHelper();
|
||||
$entity = $this->prophesize();
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||
$entity->getCenter()->willReturn($center);
|
||||
|
||||
$this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE'));
|
||||
@@ -471,8 +471,8 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
]);
|
||||
$helper = $this->getAuthorizationHelper();
|
||||
$entity = $this->prophesize();
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class);
|
||||
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.HasScopeInterface::class);
|
||||
$entity->getCenter()->willReturn($center);
|
||||
$entity->getScope()->willReturn($scope);
|
||||
|
||||
@@ -503,7 +503,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
]);
|
||||
$helper = $this->getAuthorizationHelper();
|
||||
$entity = $this->prophesize();
|
||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
||||
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||
$entity->getCenter()->willReturn($centerA);
|
||||
|
||||
$this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE'));
|
||||
@@ -577,7 +577,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Chill\MainBundle\Security\Authorization\AuthorizationHelper
|
||||
* @return AuthorizationHelper
|
||||
*/
|
||||
private function getAuthorizationHelper()
|
||||
{
|
||||
|
@@ -34,7 +34,9 @@ final class TokenManagerTest extends KernelTestCase
|
||||
$this->tokenManager = new TokenManager('secret', $logger);
|
||||
}
|
||||
|
||||
public static function setUpBefore() {}
|
||||
public static function setUpBefore()
|
||||
{
|
||||
}
|
||||
|
||||
public function testGenerate()
|
||||
{
|
||||
|
@@ -35,7 +35,9 @@ final class DefaultScopeResolverTest extends TestCase
|
||||
{
|
||||
$scope = new Scope();
|
||||
$entity = new class ($scope) implements HasScopeInterface {
|
||||
public function __construct(private readonly Scope $scope) {}
|
||||
public function __construct(private readonly Scope $scope)
|
||||
{
|
||||
}
|
||||
|
||||
public function getScope()
|
||||
{
|
||||
@@ -51,7 +53,9 @@ final class DefaultScopeResolverTest extends TestCase
|
||||
public function testHasScopesInterface()
|
||||
{
|
||||
$entity = new class ($scopeA = new Scope(), $scopeB = new Scope()) implements HasScopesInterface {
|
||||
public function __construct(private readonly Scope $scopeA, private readonly Scope $scopeB) {}
|
||||
public function __construct(private readonly Scope $scopeA, private readonly Scope $scopeB)
|
||||
{
|
||||
}
|
||||
|
||||
public function getScopes(): iterable
|
||||
{
|
||||
|
@@ -36,7 +36,9 @@ final class ScopeResolverDispatcherTest extends TestCase
|
||||
{
|
||||
$scope = new Scope();
|
||||
$entity = new class ($scope) implements HasScopeInterface {
|
||||
public function __construct(private readonly Scope $scope) {}
|
||||
public function __construct(private readonly Scope $scope)
|
||||
{
|
||||
}
|
||||
|
||||
public function getScope()
|
||||
{
|
||||
|
Reference in New Issue
Block a user