mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
cs: Enable more risky rules.
This commit is contained in:
parent
c8195e6df5
commit
a9188355c5
@ -35,9 +35,9 @@ $riskyRules = [
|
||||
'php_unit_test_annotation' => false,
|
||||
'php_unit_no_expectation_annotation' => false,
|
||||
'declare_strict_types' => false,
|
||||
'function_to_constant' => false,
|
||||
// 'function_to_constant' => false,
|
||||
// 'is_null' => false,
|
||||
'native_function_invocation' => false,
|
||||
// 'native_function_invocation' => false,
|
||||
'ternary_to_elvis_operator' => false,
|
||||
// 'no_trailing_whitespace_in_string' => false,
|
||||
'no_unreachable_default_argument_value' => false,
|
||||
@ -56,7 +56,7 @@ $riskyRules = [
|
||||
'ordered_traits' => false,
|
||||
'php_unit_mock_short_will_return' => false,
|
||||
'php_unit_set_up_tear_down_visibility' => false,
|
||||
'set_type_to_cast' => false,
|
||||
// 'set_type_to_cast' => false,
|
||||
// 'string_line_ending' => false,
|
||||
'ordered_interfaces' => false,
|
||||
'php_unit_expectation' => false,
|
||||
@ -65,7 +65,7 @@ $riskyRules = [
|
||||
'random_api_migration' => false,
|
||||
'static_lambda' => false,
|
||||
'php_unit_construct' => false,
|
||||
'psr_autoloading' => false,
|
||||
// 'psr_autoloading' => false,
|
||||
'php_unit_dedicate_assert' => false,
|
||||
];
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace Chill\MyBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
|
||||
class ItemController extends Controller
|
||||
class example extends Controller
|
||||
{
|
||||
public function yourAction()
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ namespace Chill\MainBundle\DependencyInjection;
|
||||
/**
|
||||
* Configure the main bundle.
|
||||
*/
|
||||
class Configuration implements ConfigurationInterface
|
||||
class ChillMainConfiguration implements ConfigurationInterface
|
||||
{
|
||||
use AddWidgetConfigurationTrait;
|
||||
|
||||
|
@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
/**
|
||||
* add configuration for the person_list widget.
|
||||
*/
|
||||
class PersonListWidgetFactory extends AbstractWidgetFactory
|
||||
class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
|
||||
{
|
||||
/*
|
||||
* append the option to the configuration
|
||||
|
@ -27,7 +27,7 @@ use Twig_Environment;
|
||||
*
|
||||
* The configuration is defined by `PersonListWidgetFactory`
|
||||
*/
|
||||
class PersonListWidget implements WidgetInterface
|
||||
class ChillPersonAddAPersonWidget implements WidgetInterface
|
||||
{
|
||||
/**
|
||||
* the authorization helper.
|
||||
|
@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use function array_key_exists;
|
||||
|
||||
final class ActivityController extends AbstractController
|
||||
{
|
||||
|
@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Add a role CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE for all groups except administrative,
|
||||
|
@ -11,6 +11,7 @@ namespace Chill\ActivityBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use function is_int;
|
||||
|
||||
/**
|
||||
* This is the class that validates and merges configuration from your app/config files.
|
||||
|
@ -25,6 +25,8 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
@ -28,6 +28,8 @@ use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
class ListActivity implements ListInterface
|
||||
{
|
||||
|
@ -25,6 +25,8 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
class ActivityReasonFilter implements FilterInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
@ -24,6 +24,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use function count;
|
||||
|
||||
class ActivityTypeFilter implements FilterInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
@ -31,6 +31,7 @@ use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use function count;
|
||||
|
||||
class PersonHavingActivityBetweenDateFilter implements FilterInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
@ -46,6 +46,7 @@ use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use function in_array;
|
||||
|
||||
class ActivityType extends AbstractType
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Menu;
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use function in_array;
|
||||
|
||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
|
@ -22,6 +22,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
|
||||
|
@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
// Feel free to remove this, extend it, or make something more sophisticated.
|
||||
if (isset($_SERVER['HTTP_CLIENT_IP'])
|
||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server')
|
||||
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || PHP_SAPI === 'cli-server')
|
||||
) {
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
|
||||
|
@ -12,6 +12,8 @@ namespace Chill\ActivityBundle\Tests\Controller;
|
||||
use RuntimeException;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
@ -11,6 +11,7 @@ namespace Chill\ActivityBundle\Tests\Filter;
|
||||
|
||||
use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
||||
use DateTime;
|
||||
use function array_slice;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
@ -16,6 +16,7 @@ use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
|
||||
class ActivityValidityValidator extends ConstraintValidator
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace Chill\Migrations\Activity;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
|
@ -11,6 +11,7 @@ namespace Chill\AsideActivityBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use function is_int;
|
||||
|
||||
class Configuration implements ConfigurationInterface
|
||||
{
|
||||
|
@ -30,6 +30,7 @@ use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use function in_array;
|
||||
|
||||
final class AsideActivityFormType extends AbstractType
|
||||
{
|
||||
|
@ -11,6 +11,7 @@ namespace Chill\AsideActivityBundle\Menu;
|
||||
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use function in_array;
|
||||
|
||||
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ use function shuffle;
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class AccompanyingCourseControllerTest extends WebTestCase
|
||||
class AsideActivityControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
|
@ -19,6 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function get_class;
|
||||
|
||||
abstract class AbstractElementController extends Controller
|
||||
{
|
||||
|
@ -21,6 +21,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
|
||||
class ElementController extends Controller
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use function count;
|
||||
|
||||
class CalendarRangeAPIController extends ApiController
|
||||
{
|
||||
|
@ -26,6 +26,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints\Range;
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_calendar.calendar")
|
||||
|
@ -12,6 +12,7 @@ namespace Chill\CalendarBundle\Event;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Doctrine\Persistence\Event\LifecycleEventArgs;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use function array_key_exists;
|
||||
|
||||
class ListenToActivityCreate
|
||||
{
|
||||
|
@ -23,6 +23,7 @@ use Symfony\Component\Console\Question\Question;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Component\Yaml\Exception\ParseException;
|
||||
use Symfony\Component\Yaml\Parser;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Class for the command 'chill:custom_fields:populate_group' that
|
||||
|
@ -24,6 +24,7 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Class CustomFieldsGroupController.
|
||||
|
@ -21,6 +21,10 @@ use Symfony\Bridge\Twig\TwigEngine;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
use function LogicException;
|
||||
|
||||
class CustomFieldChoice extends AbstractCustomField
|
||||
@ -229,10 +233,10 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
|
||||
if ($cf->getOptions()[self::MULTIPLE]) {
|
||||
if ($cf->getOptions()[self::ALLOW_OTHER]) {
|
||||
return \in_array($choiceSlug, $this->deserialize($data, $cf)['_choices']);
|
||||
return in_array($choiceSlug, $this->deserialize($data, $cf)['_choices']);
|
||||
}
|
||||
|
||||
return \in_array($choiceSlug, $this->deserialize($data, $cf));
|
||||
return in_array($choiceSlug, $this->deserialize($data, $cf));
|
||||
}
|
||||
|
||||
if ($cf->getOptions()[self::ALLOW_OTHER]) {
|
||||
|
@ -21,6 +21,9 @@ use LogicException;
|
||||
use Symfony\Bridge\Twig\TwigEngine;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use function get_class;
|
||||
use function gettype;
|
||||
use function is_object;
|
||||
|
||||
class CustomFieldLongChoice extends AbstractCustomField
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use function array_key_exists;
|
||||
|
||||
class CustomFieldText extends AbstractCustomField
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function count;
|
||||
|
||||
class CustomFieldsGroupType extends AbstractType
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\Form\DataTransformerInterface;
|
||||
use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
use function gettype;
|
||||
|
||||
class CustomFieldsGroupToIdTransformer implements DataTransformerInterface
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ namespace Chill\CustomFieldsBundle\Form\DataTransformer;
|
||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\Form\DataTransformerInterface;
|
||||
use function array_key_exists;
|
||||
|
||||
class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ use Symfony\Component\Form\AbstractTypeExtension;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* This extension create the possibility to add some text
|
||||
|
@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
// Feel free to remove this, extend it, or make something more sophisticated.
|
||||
if (isset($_SERVER['HTTP_CLIENT_IP'])
|
||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server')
|
||||
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || PHP_SAPI === 'cli-server')
|
||||
) {
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
|
||||
|
@ -15,7 +15,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class CustomFieldControllerTest extends WebTestCase
|
||||
class CustomFieldControllerTest_TODO extends WebTestCase
|
||||
{
|
||||
/*
|
||||
public function testCompleteScenario()
|
||||
|
@ -12,6 +12,7 @@ namespace Chill\CustomFieldsBundle\Tests;
|
||||
use Chill\CustomFieldsBundle\CustomFields\CustomFieldNumber;
|
||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Test CustomFieldsNumber.
|
||||
|
@ -13,6 +13,8 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Exception;
|
||||
use function count;
|
||||
use function get_class;
|
||||
|
||||
/**
|
||||
* Context that display a form to select a member of a houseHold.
|
||||
|
@ -25,9 +25,11 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
use function array_filter;
|
||||
use function array_key_exists;
|
||||
use function array_merge;
|
||||
use function get_class;
|
||||
use function implode;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
use function is_object;
|
||||
|
||||
class DocGenObjectNormalizer implements NormalizerInterface, NormalizerAwareInterface
|
||||
{
|
||||
|
@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Adding acl for person document.
|
||||
|
@ -37,6 +37,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Class EventController.
|
||||
|
@ -23,6 +23,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Class ParticipationController.
|
||||
|
@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Add roles to existing groups.
|
||||
|
@ -19,6 +19,7 @@ use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Class Participation.
|
||||
|
@ -15,6 +15,7 @@ use RuntimeException;
|
||||
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
|
||||
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
||||
use function call_user_func;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
|
@ -27,6 +27,8 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
|
||||
/**
|
||||
* Class PickEventType.
|
||||
|
@ -19,6 +19,7 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Templating\EngineInterface as TemplatingEngine;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Search within Events.
|
||||
|
@ -20,6 +20,8 @@ use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Description of EventVoter.
|
||||
@ -86,7 +88,7 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter
|
||||
public function supports($attribute, $subject)
|
||||
{
|
||||
return ($subject instanceof Event && in_array($attribute, self::ROLES))
|
||||
|| ($subject instanceof Person && \in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| ($subject instanceof Person && in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| (null === $subject && self::SEE === $attribute);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,8 @@ use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
@ -83,7 +85,7 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
public function supports($attribute, $subject)
|
||||
{
|
||||
return ($subject instanceof Participation && in_array($attribute, self::ROLES))
|
||||
|| ($subject instanceof Person && \in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| ($subject instanceof Person && in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| (null === $subject && self::SEE === $attribute);
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,8 @@
|
||||
namespace Chill\EventBundle\Tests\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Test the creation of participation controller.
|
||||
|
@ -13,6 +13,7 @@ use Chill\EventBundle\Entity\Event;
|
||||
use Chill\EventBundle\Search\EventSearch;
|
||||
use DateTime;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Test the EventSearch class.
|
||||
|
@ -22,6 +22,7 @@ use LogicException;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Class TimelineEventProvider.
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
namespace Chill\AMLI\FamilyMembersBundle\Config;
|
||||
|
||||
use function count;
|
||||
|
||||
class ConfigRepository
|
||||
{
|
||||
/**
|
||||
|
@ -19,6 +19,7 @@ use Symfony\Component\Routing\RouteCollection;
|
||||
use function array_filter;
|
||||
use function array_keys;
|
||||
use function array_search;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
class CRUDRoutesLoader extends Loader
|
||||
|
@ -36,6 +36,7 @@ use function array_key_exists;
|
||||
use function array_keys;
|
||||
use function array_merge;
|
||||
use function bin2hex;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function random_bytes;
|
||||
use function trim;
|
||||
|
@ -15,6 +15,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use function in_array;
|
||||
|
||||
/*
|
||||
* Load or update the languages entities command
|
||||
|
@ -24,6 +24,7 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use function count;
|
||||
|
||||
class LoadPostalCodesCommand extends Command
|
||||
{
|
||||
|
@ -23,6 +23,7 @@ use Symfony\Component\Form\FormFactoryInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function count;
|
||||
use function serialize;
|
||||
use function unserialize;
|
||||
|
||||
|
@ -24,6 +24,7 @@ use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Role\RoleHierarchy;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* Class PermissionsGroupController.
|
||||
|
@ -25,6 +25,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function count;
|
||||
use function key;
|
||||
use function reset;
|
||||
|
||||
@ -105,7 +106,7 @@ class SearchController extends AbstractController
|
||||
$advancedSearchProviders = $searchProvider
|
||||
->getHasAdvancedFormSearchServices();
|
||||
|
||||
if (\count($advancedSearchProviders) === 1) {
|
||||
if (count($advancedSearchProviders) === 1) {
|
||||
reset($advancedSearchProviders);
|
||||
|
||||
return $this->redirectToRoute('chill_main_advanced_search', [
|
||||
|
@ -15,6 +15,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use function count;
|
||||
|
||||
class TimelineCenterController extends AbstractController
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ class UserController extends CRUDController
|
||||
|
||||
return $this->redirect($this->generateUrl(
|
||||
'chill_crud_admin_user_edit',
|
||||
\array_merge(['id' => $uid], $returnPathParams)
|
||||
array_merge(['id' => $uid], $returnPathParams)
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Load languages into database.
|
||||
|
@ -42,6 +42,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Class ChillMainExtension
|
||||
|
@ -13,6 +13,7 @@ use LogicException;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Description of ConfigConsistencyCompilerPass.
|
||||
|
@ -19,6 +19,11 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use UnexpectedValueException;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function get_class;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
|
||||
/**
|
||||
* Compile the configurations and inject required service into container.
|
||||
|
@ -14,7 +14,10 @@ use Generator;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* This trait allow to add automatic configuration for widget inside your config.
|
||||
|
@ -14,6 +14,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Types\ConversionException;
|
||||
use Doctrine\DBAL\Types\DateIntervalType;
|
||||
use Exception;
|
||||
use function count;
|
||||
use function current;
|
||||
use function preg_match;
|
||||
use function reset;
|
||||
@ -84,7 +85,7 @@ class NativeDateIntervalType extends DateIntervalType
|
||||
$current = current($strings);
|
||||
|
||||
if (is_numeric($current)) {
|
||||
$next = \next($strings);
|
||||
$next = next($strings);
|
||||
|
||||
switch ($next) {
|
||||
case 'year':
|
||||
|
@ -16,6 +16,7 @@ use RuntimeException;
|
||||
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* User.
|
||||
|
@ -24,6 +24,11 @@ use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use UnexpectedValueException;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function get_class;
|
||||
use function gettype;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Collects all agregators, filters and export from
|
||||
@ -192,7 +197,7 @@ class ExportManager
|
||||
} elseif ($element instanceof FormatterInterface) {
|
||||
$this->addFormatter($element, $alias);
|
||||
} else {
|
||||
throw new LogicException('This element ' . \get_class($element) . ' '
|
||||
throw new LogicException('This element ' . get_class($element) . ' '
|
||||
. 'is not an instance of export element');
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,11 @@ use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function array_key_exists;
|
||||
use function array_slice;
|
||||
use function call_user_func;
|
||||
use function count;
|
||||
use function is_array;
|
||||
|
||||
/**
|
||||
* Command to get the report with curl:
|
||||
|
@ -20,6 +20,7 @@ use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function array_key_exists;
|
||||
use function array_keys;
|
||||
use function array_map;
|
||||
use function count;
|
||||
use function implode;
|
||||
|
||||
// command to get the report with curl : curl --user "center a_social:password" "http://localhost:8000/fr/exports/generate/count_person?export[filters][person_gender_filter][enabled]=&export[filters][person_nationality_filter][enabled]=&export[filters][person_nationality_filter][form][nationalities]=&export[aggregators][person_nationality_aggregator][order]=1&export[aggregators][person_nationality_aggregator][form][group_by_level]=country&export[submit]=&export[_token]=RHpjHl389GrK-bd6iY5NsEqrD5UKOTHH40QKE9J1edU" --globoff
|
||||
|
@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function array_map;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Create a CSV List for the export where the header are printed on the
|
||||
|
@ -22,7 +22,10 @@ use function array_map;
|
||||
use function array_merge;
|
||||
use function array_multisort;
|
||||
use function array_unique;
|
||||
use function call_user_func;
|
||||
use function count;
|
||||
use function fopen;
|
||||
use function is_array;
|
||||
use function stream_get_contents;
|
||||
use function sys_get_temp_dir;
|
||||
use function tempnam;
|
||||
|
@ -25,6 +25,7 @@ use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function array_key_exists;
|
||||
use function array_keys;
|
||||
use function array_map;
|
||||
use function count;
|
||||
use function fopen;
|
||||
use function implode;
|
||||
use function stream_get_contents;
|
||||
|
@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use function array_combine;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
|
||||
class PermissionsGroupType extends AbstractType
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Form to Edit/create a role scope. If the role scope does not
|
||||
|
@ -16,6 +16,7 @@ use Symfony\Component\Form\DataTransformerInterface;
|
||||
use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
use Traversable;
|
||||
use function count;
|
||||
|
||||
class CenterTransformer implements DataTransformerInterface
|
||||
{
|
||||
|
@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
use function array_diff;
|
||||
use function array_values;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function is_array;
|
||||
|
||||
/**
|
||||
* Show a dateInterval type.
|
||||
|
@ -25,6 +25,7 @@ use function array_intersect;
|
||||
use function array_key_exists;
|
||||
use function array_merge;
|
||||
use function array_unique;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,7 @@ use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use function array_combine;
|
||||
use function array_map;
|
||||
use function count;
|
||||
|
||||
final class FilterOrderType extends \Symfony\Component\Form\AbstractType
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use function array_merge;
|
||||
use function array_values;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Pick a center.
|
||||
|
@ -28,6 +28,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use function array_map;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Allow to pick amongst available scope for the current
|
||||
|
@ -17,6 +17,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Translation\Translator;
|
||||
use function in_array;
|
||||
|
||||
class TranslatableStringFormType extends AbstractType
|
||||
{
|
||||
|
@ -19,6 +19,7 @@ use function array_key_exists;
|
||||
use function in_array;
|
||||
use function json_decode;
|
||||
use function preg_replace;
|
||||
use function strlen;
|
||||
|
||||
/**
|
||||
* Helper to some task linked to phonenumber.
|
||||
|
@ -17,6 +17,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
use function count;
|
||||
|
||||
final class UserRepository implements ObjectRepository
|
||||
{
|
||||
|
@ -16,6 +16,7 @@ use Knp\Menu\ItemInterface;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Routing\RouterInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use function array_key_exists;
|
||||
use function array_merge;
|
||||
use function array_values;
|
||||
|
||||
@ -128,7 +129,7 @@ class MenuComposer
|
||||
*/
|
||||
public function hasLocalMenuBuilder($menuId): bool
|
||||
{
|
||||
return \array_key_exists($menuId, $this->localMenuBuilders);
|
||||
return array_key_exists($menuId, $this->localMenuBuilders);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,6 +10,7 @@
|
||||
namespace Chill\MainBundle\Search;
|
||||
|
||||
use DateTime;
|
||||
use function array_key_exists;
|
||||
use function strpos;
|
||||
|
||||
/**
|
||||
|
@ -18,6 +18,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query\ResultSetMappingBuilder;
|
||||
use function array_map;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function strtr;
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
namespace Chill\MainBundle\Search;
|
||||
|
||||
use function array_push;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function strtr;
|
||||
|
||||
|
@ -10,6 +10,8 @@
|
||||
namespace Chill\MainBundle\Search;
|
||||
|
||||
use function array_key_exists;
|
||||
use function chr;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* a service which gather all search services defined into the bundles
|
||||
|
@ -10,6 +10,7 @@
|
||||
namespace Chill\MainBundle\Search\Utils;
|
||||
|
||||
use LogicException;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function preg_match;
|
||||
use function str_split;
|
||||
|
@ -24,6 +24,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Traversable;
|
||||
use UnexpectedValueException;
|
||||
use function array_merge;
|
||||
use function get_class;
|
||||
|
||||
/**
|
||||
* Helper for authorizations.
|
||||
|
@ -13,6 +13,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
|
||||
use function array_keys;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Helper which traverse all role to find parents.
|
||||
@ -54,7 +55,7 @@ class ParentRoleHelper
|
||||
foreach ($roles as $r) {
|
||||
$childRoles = $this->roleHierarchy->getReachableRoleNames([$r]);
|
||||
|
||||
if (\in_array($role, $childRoles)) {
|
||||
if (in_array($role, $childRoles)) {
|
||||
$parentRoles[] = $r;
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ use Chill\MainBundle\Entity\User;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
||||
use function in_array;
|
||||
|
||||
class PasswordRecoverVoter extends Voter
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user