mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Enable more risky rules.
This commit is contained in:
@@ -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!
|
||||
|
Reference in New Issue
Block a user