cs: Second part - ignore test/app subdirectory.

This commit is contained in:
Pol Dellaiera 2021-11-23 14:34:34 +01:00
parent 5f37304796
commit 3ea35682eb
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
72 changed files with 326 additions and 365 deletions

View File

@ -15,6 +15,7 @@ $config = require __DIR__ . '/tests/app/vendor/drupol/php-conventions/config/php
$config
->getFinder()
->ignoreDotFiles(false)
->notPath('tests/app')
->name(['.php_cs.dist.php']);
$rules = $config->getRules();

View File

@ -29,8 +29,7 @@ namespace Chill\MainBundle\DependencyInjection;
public function __construct(
array $widgetFactories = [],
ContainerBuilder $containerBuilder
)
{
) {
// we register here widget factories (see below)
$this->setWidgetFactories($widgetFactories);
// we will need the container builder later...

View File

@ -50,7 +50,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
foreach ($persons as $person) {
$activityNbr = rand(0, 3);
for ($i = 0; $i < $activityNbr; ++$i ) {
for ($i = 0; $i < $activityNbr; ++$i) {
$activity = $this->newRandomActivity($person);
if (null !== $activity) {

View File

@ -30,8 +30,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
public function __construct(
AuthorizationCheckerInterface $authorizationChecker,
TranslatorInterface $translator
)
{
) {
$this->translator = $translator;
$this->authorizationChecker = $authorizationChecker;
}

View File

@ -71,8 +71,7 @@ class TranslatableActivityReasonTest extends TypeTestCase
protected function getTranslatableStringHelper(
$locale = 'en',
$fallbackLocale = 'en'
)
{
) {
$prophet = new \Prophecy\Prophet();
$requestStack = $prophet->prophesize();
$request = $prophet->prophesize();

View File

@ -26,11 +26,11 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
*/
class ActivityVoterTest extends KernelTestCase
{
use PrepareUserTrait;
use PrepareCenterTrait;
use PrepareScopeTrait;
use PreparePersonTrait;
use PrepareActivityTrait;
use PrepareCenterTrait;
use PreparePersonTrait;
use PrepareScopeTrait;
use PrepareUserTrait;
/**
* @var \Prophecy\Prophet
@ -132,8 +132,7 @@ class ActivityVoterTest extends KernelTestCase
Center $center,
$attribute,
$message
)
{
) {
$token = $this->prepareToken($user);
$activity = $this->prepareActivity($scope, $this->preparePerson($center));

View File

@ -54,8 +54,7 @@ class CustomFieldChoice extends AbstractCustomField
TranslatorInterface $translator,
TwigEngine $templating,
TranslatableStringHelper $translatableStringHelper
)
{
) {
$this->defaultLocales = $translator->getFallbackLocales();
$this->templating = $templating;
$this->translatableStringHelper = $translatableStringHelper;

View File

@ -41,8 +41,7 @@ class CustomFieldText extends AbstractCustomField
RequestStack $requestStack,
TwigEngine $templating,
TranslatableStringHelper $translatableStringHelper
)
{
) {
$this->requestStack = $requestStack;
$this->templating = $templating;
$this->translatableStringHelper = $translatableStringHelper;

View File

@ -41,8 +41,7 @@ class CustomFieldTitle extends AbstractCustomField
RequestStack $requestStack,
TwigEngine $templating,
TranslatableStringHelper $translatableStringHelper
)
{
) {
$this->requestStack = $requestStack;
$this->templating = $templating;
$this->translatableStringHelper = $translatableStringHelper;

View File

@ -25,8 +25,7 @@ class CustomFieldDataTransformer implements DataTransformerInterface
public function __construct(
CustomFieldInterface $customFieldDefinition,
CustomField $customField
)
{
) {
$this->customFieldDefinition = $customFieldDefinition;
$this->customField = $customField;
}

View File

@ -39,8 +39,7 @@ class CustomFieldsHelper
public function __construct(
EntityManagerInterface $em,
CustomFieldProvider $provider
)
{
) {
$this->em = $em;
$this->provider = $provider;
}

View File

@ -137,8 +137,7 @@ class DocGeneratorTemplateController extends AbstractController
public function listTemplateApiAction(
string $entityClassName,
DocGeneratorTemplateRepository $templateRepository
): Response
{
): Response {
$entities = $templateRepository->findByEntity($entityClassName);
$ret = [];

View File

@ -551,8 +551,7 @@ class ParticipationController extends AbstractController
Request $request,
Participation $participation,
bool $multiple = false
)
{
) {
$em = $this->getDoctrine()->getManager();
if ($em->contains($participation)) {

View File

@ -92,8 +92,7 @@ class EventSearch extends AbstractSearch
$limit = 50,
array $options = [],
$format = 'html'
)
{
) {
$total = $this->count($terms);
$paginator = $this->paginationFactory->create($total);

View File

@ -476,8 +476,7 @@ class ParticipationControllerTest extends WebTestCase
protected function getRandomEventWithMultipleParticipations(
$centerName = 'Center A',
$circleName = 'social'
)
{
) {
$event = $this->getRandomEvent($centerName, $circleName);
return $event->getParticipations()->count() > 1 ?

View File

@ -714,8 +714,7 @@ class CRUDController extends AbstractController
int $totalItems,
PaginatorInterface $paginator,
?FilterOrderHelper $filterOrder = null
)
{
) {
$query = $this->queryEntities($action, $request, $paginator, $filterOrder);
return $query->getQuery()->getResult();

View File

@ -206,6 +206,7 @@ class ExportController extends AbstractController
*
* @param string $alias
* @param array $data the data from previous step. Required for steps 'formatter' and 'generate_formatter'
* @param mixed $step
*
* @return \Symfony\Component\Form\Form
*/

View File

@ -35,8 +35,7 @@ class NotificationController extends AbstractController
NotificationRepository $notificationRepository,
NotificationRenderer $notificationRenderer,
PaginatorFactory $paginatorFactory
)
{
) {
$currentUser = $this->security->getUser();
$notificationsNbr = $notificationRepository->countAllForAttendee(($currentUser));

View File

@ -526,8 +526,7 @@ class PermissionsGroupController extends AbstractController
private function createDeleteRoleScopeForm(
PermissionsGroup $permissionsGroup,
RoleScope $roleScope
)
{
) {
return $this->createFormBuilder()
->setAction($this->generateUrl(
'admin_permissionsgroup_delete_role_scope',

View File

@ -47,8 +47,7 @@ class ExportsCompilerPass implements CompilerPassInterface
private function compileAggregators(
Definition $chillManagerDefinition,
ContainerBuilder $container
)
{
) {
$taggedServices = $container->findTaggedServiceIds(
'chill.export_aggregator'
);
@ -79,8 +78,7 @@ class ExportsCompilerPass implements CompilerPassInterface
private function compileExportElementsProvider(
Definition $chillManagerDefinition,
ContainerBuilder $container
)
{
) {
$taggedServices = $container->findTaggedServiceIds(
'chill.export_elements_provider'
);
@ -111,8 +109,7 @@ class ExportsCompilerPass implements CompilerPassInterface
private function compileExports(
Definition $chillManagerDefinition,
ContainerBuilder $container
)
{
) {
$taggedServices = $container->findTaggedServiceIds(
'chill.export'
);
@ -143,8 +140,7 @@ class ExportsCompilerPass implements CompilerPassInterface
private function compileFilters(
Definition $chillManagerDefinition,
ContainerBuilder $container
)
{
) {
$taggedServices = $container->findTaggedServiceIds(
'chill.export_filter'
);
@ -175,8 +171,7 @@ class ExportsCompilerPass implements CompilerPassInterface
private function compileFormatters(
Definition $chillManagerDefinition,
ContainerBuilder $container
)
{
) {
$taggedServices = $container->findTaggedServiceIds(
'chill.export_formatter'
);

View File

@ -27,8 +27,7 @@ class Configuration implements ConfigurationInterface
public function __construct(
array $widgetFactories,
ContainerBuilder $containerBuilder
)
{
) {
$this->setWidgetFactories($widgetFactories);
$this->containerBuilder = $containerBuilder;
}

View File

@ -92,8 +92,7 @@ class ExportManager
AuthorizationCheckerInterface $authorizationChecker,
AuthorizationHelper $authorizationHelper,
TokenStorageInterface $tokenStorage
)
{
) {
$this->logger = $logger;
$this->em = $em;
$this->authorizationChecker = $authorizationChecker;
@ -602,8 +601,7 @@ class ExportManager
QueryBuilder $qb,
$data,
array $center
)
{
) {
$aggregators = $this->retrieveUsedAggregators($data);
foreach ($aggregators as $alias => $aggregator) {
@ -626,8 +624,7 @@ class ExportManager
QueryBuilder $qb,
$data,
array $centers
)
{
) {
$filters = $this->retrieveUsedFilters($data);
foreach ($filters as $alias => $filter) {

View File

@ -55,8 +55,7 @@ class CSVFormatter implements FormatterInterface
public function __construct(
TranslatorInterface $translator,
ExportManager $manager
)
{
) {
$this->translator = $translator;
$this->exportManager = $manager;
}

View File

@ -102,8 +102,7 @@ trait AppendScopeChoiceTypeTrait
TranslatableStringHelper $translatableStringHelper,
ObjectManager $om,
$name = 'scope'
)
{
) {
$reachableScopes = $authorizationHelper
->getReachableScopes($user, $role, $center);

View File

@ -58,8 +58,7 @@ class PickCenterType extends AbstractType
TokenStorageInterface $tokenStorage,
ExportManager $exportManager,
AuthorizationHelper $authorizationHelper
)
{
) {
$this->exportManager = $exportManager;
$this->user = $tokenStorage->getToken()->getUser();
$this->authorizationHelper = $authorizationHelper;

View File

@ -21,8 +21,7 @@ final class NotificationRenderer
public function __construct(
AccompanyingPeriodNotificationRenderer $accompanyingPeriodNotificationRenderer,
ActivityNotificationRenderer $activityNotificationRenderer
)
{
) {
// TODO configure automatically
// TODO CREER UNE INTERFACE POUR ETRE SUR QUE LES RENDERERS SONT OK

View File

@ -138,8 +138,7 @@ class SearchProvider
$limit = 50,
array $options = [],
$format = 'html'
)
{
) {
$terms = $this->parse($pattern);
$search = $this->getByName($name);
@ -169,8 +168,7 @@ class SearchProvider
$limit = 50,
array $options = [],
$format = 'html'
)
{
) {
$terms = $this->parse($pattern);
$results = [];

View File

@ -35,6 +35,7 @@ class AddressRender implements ChillEntityRenderInterface
/**
* @param Address addr
* @param mixed $addr
*/
public function renderBox($addr, array $options): string
{

View File

@ -136,8 +136,7 @@ class PaginatorTest extends KernelTestCase
$itemPerpage,
$pageNumber,
$expectedHasPage
)
{
) {
$paginator = $this->generatePaginator($totalItems, $itemPerpage);
$this->assertEquals($expectedHasPage, $paginator->hasPage($pageNumber));

View File

@ -30,9 +30,9 @@ use function array_map;
*/
class AuthorizationHelperTest extends KernelTestCase
{
use PrepareUserTrait;
use PrepareCenterTrait;
use PrepareScopeTrait;
use PrepareUserTrait;
use ProphecyTrait;
public function setUp()
@ -247,8 +247,7 @@ class AuthorizationHelperTest extends KernelTestCase
Role $role,
Center $center,
$message
)
{
) {
$reachableScopes = $this->getAuthorizationHelper()
->getReachableScopes($user, $role, $center);

View File

@ -27,8 +27,7 @@ class TestHelper
public static function getAuthenticatedClientOptions(
$username = 'center a_social',
$password = 'password'
)
{
) {
return [
'PHP_AUTH_USER' => $username,
'PHP_AUTH_PW' => $password,

View File

@ -39,8 +39,7 @@ class RoleScopeScopePresence extends ConstraintValidator
RoleProvider $roleProvider,
LoggerInterface $logger,
TranslatorInterface $translator
)
{
) {
$this->roleProvider = $roleProvider;
$this->logger = $logger;
$this->translator = $translator;

View File

@ -30,7 +30,7 @@ class LoadHouseholdPosition extends Fixture
public function load(ObjectManager $manager)
{
foreach (self::POSITIONS_DATA as [$name, $share, $allowHolder,
$ordering, $ref]) {
$ordering, $ref, ]) {
$position = (new Position())
->setLabel(['fr' => $name])
->setAllowHolder($allowHolder)

View File

@ -197,7 +197,9 @@ class Household
}
return -1;
} elseif ($b->getPosition() === null) {
}
if ($b->getPosition() === null) {
return 1;
}

View File

@ -26,9 +26,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
*/
class PersonVoterTest extends KernelTestCase
{
use PrepareUserTrait;
use PrepareCenterTrait;
use PrepareScopeTrait;
use PrepareUserTrait;
/**
* @var \Prophecy\Prophet

View File

@ -22,8 +22,7 @@ class AddAPersonWidget implements WidgetInterface
$place,
array $context,
array $config
)
{
) {
return $env->render('ChillPersonBundle:Widget:homepage_add_a_person.html.twig');
}
}

View File

@ -59,8 +59,7 @@ class LoadCustomFieldsGroup extends AbstractFixture implements OrderedFixtureInt
ObjectManager $manager,
array $name,
array $options = []
)
{
) {
echo $name['fr'] . " \n";
$cFGroup = (new CustomFieldsGroup())

View File

@ -49,8 +49,7 @@ class ReportType extends AbstractType
TokenStorageInterface $tokenStorage,
TranslatableStringHelper $translatableStringHelper,
ObjectManager $om
)
{
) {
$this->authorizationHelper = $helper;
$this->user = $tokenStorage->getToken()->getUser();
$this->translatableStringHelper = $translatableStringHelper;

View File

@ -46,8 +46,7 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface
EntityManagerInterface $em,
AuthorizationHelper $helper,
TokenStorageInterface $tokenStorage
)
{
) {
$this->em = $em;
$this->helper = $helper;

View File

@ -416,8 +416,7 @@ class ReportControllerTest extends WebTestCase
Person $person,
CustomFieldsGroup $group,
\Symfony\Component\BrowserKit\Client $client
)
{
) {
$url = sprintf(
'fr/person/%d/report/cfgroup/%d/new',
$person->getId(),

View File

@ -25,9 +25,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
*/
class ReportVoterTest extends KernelTestCase
{
use PrepareUserTrait;
use PrepareCenterTrait;
use PrepareScopeTrait;
use PrepareUserTrait;
/**
* @var \Prophecy\Prophet
@ -131,8 +131,7 @@ class ReportVoterTest extends KernelTestCase
$action,
$message,
?User $user = null
)
{
) {
$token = $this->prepareToken($user);
$result = $this->voter->vote($token, $report, [$action]);
$this->assertEquals($expectedResult, $result, $message);

View File

@ -31,8 +31,7 @@ class MenuBuilder implements LocalMenuBuilderInterface
public function __construct(
AuthorizationCheckerInterface $authorizationChecker,
TranslatorInterface $translator
)
{
) {
$this->translator = $translator;
$this->authorizationChecker = $authorizationChecker;
}

View File

@ -32,8 +32,6 @@ class ThirdPartyTypeManager
* Method used during the load of the manager by Dependency Injection
*
* @param \Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface $provider
*
* @return self
*/
public function addProvider(ThirdPartyTypeProviderInterface $provider): self
{