cs: Enable more risky rules.

This commit is contained in:
Pol Dellaiera 2021-11-30 12:27:49 +01:00
parent 733bee06a8
commit 28d2c42454
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
34 changed files with 45 additions and 45 deletions

View File

@ -25,20 +25,20 @@ $riskyRules = [
'strict_param' => false,
'declare_strict_types' => false,
'ternary_to_elvis_operator' => false,
'no_unreachable_default_argument_value' => false,
'php_unit_test_case_static_method_calls' => false,
'strict_comparison' => false,
'ereg_to_preg' => false,
'php_unit_mock_short_will_return' => false,
'php_unit_set_up_tear_down_visibility' => false,
'ordered_interfaces' => false,
'php_unit_construct' => false,
'php_unit_dedicate_assert' => false,
'php_unit_expectation' => false,
'php_unit_mock' => false,
'php_unit_namespaced' => false,
'php_unit_no_expectation_annotation' => false,
'php_unit_test_case_static_method_calls' => false,
'php_unit_test_annotation' => false,
// 'no_unreachable_default_argument_value' => false,
// 'ereg_to_preg' => false,
// 'ordered_interfaces' => false,
// 'error_suppression' => false,
// 'non_printable_character' => false,
// 'ordered_traits' => false,

View File

@ -16,7 +16,7 @@ use Doctrine\ORM\Query\Expr;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
class BirthdateFilter implements FilterInterface, ExportElementValidatedInterface
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
{
// add specific role for this filter
public function addRole()

View File

@ -27,7 +27,7 @@ namespace Chill\MainBundle\DependencyInjection;
private $containerBuilder;
public function __construct(
array $widgetFactories = [],
array $widgetFactories,
ContainerBuilder $containerBuilder
) {
// we register here widget factories (see below)

View File

@ -53,7 +53,7 @@ use Symfony\Component\Serializer\Annotation\SerializedName;
* getUserFunction="getUser",
* path="scope")
*/
class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCenterInterface, HasScopeInterface
{
public const SENTRECEIVED_RECEIVED = 'received';

View File

@ -28,7 +28,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function array_key_exists;
use function count;
class ActivityReasonFilter implements FilterInterface, ExportElementValidatedInterface
class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
{
protected ActivityReasonRepository $activityReasonRepository;

View File

@ -26,7 +26,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function count;
class ActivityTypeFilter implements FilterInterface, ExportElementValidatedInterface
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
{
protected ActivityTypeRepository $activityTypeRepository;

View File

@ -33,7 +33,7 @@ use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function count;
class PersonHavingActivityBetweenDateFilter implements FilterInterface, ExportElementValidatedInterface
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
{
protected ActivityReasonRepository $activityReasonRepository;

View File

@ -22,7 +22,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Entity
* @ORM\Table(schema="chill_asideactivity")
*/
class AsideActivity implements TrackUpdateInterface, TrackCreationInterface
class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
{
/**
* @ORM\ManyToOne(targetEntity=User::class)

View File

@ -31,7 +31,7 @@ use function in_array;
use function is_array;
use function is_object;
class DocGenObjectNormalizer implements NormalizerInterface, NormalizerAwareInterface
class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
use NormalizerAwareTrait;

View File

@ -230,7 +230,7 @@ class EventController extends AbstractController
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function newAction(?Center $center = null, Request $request)
public function newAction(?Center $center, Request $request)
{
if (null === $center) {
$center_id = $request->query->get('center_id');

View File

@ -29,7 +29,7 @@ use function in_array;
* @ORM\Table(name="chill_event_participation")
* @ORM\HasLifecycleCallbacks
*/
class Participation implements HasCenterInterface, HasScopeInterface, ArrayAccess
class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterface
{
/**
* @var Event

View File

@ -26,7 +26,7 @@ use function str_replace;
* create a user for each permission_group and center.
* username and password are identicals.
*/
class LoadUsers extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
class LoadUsers extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface
{
public static $refs = [
'center a_social' => [

View File

@ -17,7 +17,7 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use function array_key_exists;
class CenterNormalizer implements NormalizerInterface, DenormalizerInterface
class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
{
private CenterRepository $repository;

View File

@ -14,7 +14,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class CollectionNormalizer implements NormalizerInterface, NormalizerAwareInterface
class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
use NormalizerAwareTrait;

View File

@ -15,7 +15,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class UserNormalizer implements NormalizerInterface, NormalizerAwareInterface
class UserNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
use NormalizerAwareTrait;

View File

@ -26,8 +26,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class LoadCustomFields extends AbstractFixture implements
OrderedFixtureInterface,
ContainerAwareInterface
ContainerAwareInterface,
OrderedFixtureInterface
{
/**
* @var ContainerInterface

View File

@ -47,7 +47,7 @@ use function ucfirst;
/**
* Load people into database.
*/
class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
class LoadPeople extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface
{
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;

View File

@ -58,11 +58,11 @@ use const SORT_REGULAR;
* )
*/
class AccompanyingPeriod implements
TrackCreationInterface,
TrackUpdateInterface,
HasScopesInterface,
GroupSequenceProviderInterface,
HasCentersInterface,
GroupSequenceProviderInterface
HasScopesInterface,
TrackCreationInterface,
TrackUpdateInterface
{
public const INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR];

View File

@ -30,7 +30,7 @@ use Symfony\Component\Serializer\Annotation as Serializer;
* "accompanying_period_work_evaluation": AccompanyingPeriodWorkEvaluation::class,
* })
*/
class AccompanyingPeriodWorkEvaluation implements TrackUpdateInterface, TrackCreationInterface
class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackUpdateInterface
{
/**
* @ORM\ManyToOne(

View File

@ -44,7 +44,7 @@ use function uniqid;
/**
* Render a list of people.
*/
class ListPerson implements ListInterface, ExportElementValidatedInterface
class ListPerson implements ExportElementValidatedInterface, ListInterface
{
protected CustomFieldProvider $customFieldProvider;

View File

@ -16,7 +16,7 @@ use Doctrine\ORM\Query\Expr;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
class BirthdateFilter implements FilterInterface, ExportElementValidatedInterface
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
{
public function addRole()
{

View File

@ -25,8 +25,8 @@ use function in_array;
use function is_array;
class GenderFilter implements
FilterInterface,
ExportElementValidatedInterface
ExportElementValidatedInterface,
FilterInterface
{
/**
* @var TranslatorInterface

View File

@ -20,8 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
class NationalityFilter implements
FilterInterface,
ExportElementValidatedInterface
ExportElementValidatedInterface,
FilterInterface
{
/**
* @var TranslatableStringHelper

View File

@ -13,7 +13,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class AccompanyingPeriodParticipationNormalizer implements NormalizerInterface, NormalizerAwareInterface
class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
protected ?NormalizerInterface $normalizer = null;

View File

@ -23,7 +23,7 @@ use function array_key_exists;
use function array_merge;
use function count;
class AccompanyingPeriodResourceNormalizer implements DenormalizerInterface, DenormalizerAwareInterface
class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface, DenormalizerInterface
{
use DenormalizerAwareTrait;
use ObjectToPopulateTrait;

View File

@ -27,7 +27,7 @@ use function is_array;
* This denormalizer rely on AbstractNormalizer for most of the job, and
* add some logic for synchronizing collection.
*/
class AccompanyingPeriodWorkDenormalizer implements DenormalizerAwareInterface, ContextAwareDenormalizerInterface
class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInterface, DenormalizerAwareInterface
{
use DenormalizerAwareTrait;
use ObjectToPopulateTrait;

View File

@ -23,7 +23,7 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use function array_key_exists;
class MembersEditorNormalizer implements DenormalizerInterface, DenormalizerAwareInterface
class MembersEditorNormalizer implements DenormalizerAwareInterface, DenormalizerInterface
{
use DenormalizerAwareTrait;

View File

@ -31,10 +31,10 @@ use function array_key_exists;
* Serialize a Person entity.
*/
class PersonJsonNormalizer implements
NormalizerInterface,
NormalizerAwareInterface,
DenormalizerAwareInterface,
DenormalizerInterface,
DenormalizerAwareInterface
NormalizerAwareInterface,
NormalizerInterface
{
use DenormalizerAwareTrait;
use NormalizerAwareTrait;

View File

@ -15,7 +15,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class SocialActionNormalizer implements NormalizerInterface, NormalizerAwareInterface
class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
use NormalizerAwareTrait;

View File

@ -15,7 +15,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class SocialIssueNormalizer implements NormalizerInterface, NormalizerAwareInterface
class SocialIssueNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
use NormalizerAwareTrait;

View File

@ -25,7 +25,7 @@ use function in_array;
/**
* Load reports into DB.
*/
class LoadReports extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
class LoadReports extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface
{
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;

View File

@ -47,7 +47,7 @@ use function strtolower;
use function ucfirst;
use function uniqid;
class ReportList implements ListInterface, ExportElementValidatedInterface
class ReportList implements ExportElementValidatedInterface, ListInterface
{
protected CustomFieldProvider $customFieldProvider;

View File

@ -25,7 +25,7 @@ use function array_keys;
*
* @ORM\MappedSuperclass
*/
abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
{
/**
* @var User

View File

@ -17,7 +17,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class ThirdPartyNormalizer implements NormalizerInterface, NormalizerAwareInterface
class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
use NormalizerAwareTrait;