diff --git a/src/Symfony/Bridge/Monolog/Processor/ConsoleCommandProcessor.php b/src/Symfony/Bridge/Monolog/Processor/ConsoleCommandProcessor.php index 1fb8cc1ef3..2891f4f2f4 100644 --- a/src/Symfony/Bridge/Monolog/Processor/ConsoleCommandProcessor.php +++ b/src/Symfony/Bridge/Monolog/Processor/ConsoleCommandProcessor.php @@ -49,9 +49,9 @@ class ConsoleCommandProcessor implements EventSubscriberInterface, ResetInterfac public function addCommandData(ConsoleEvent $event) { - $this->commandData = array( + $this->commandData = [ 'name' => $event->getCommand()->getName(), - ); + ]; if ($this->includeArguments) { $this->commandData['arguments'] = $event->getInput()->getArguments(); } @@ -62,8 +62,8 @@ class ConsoleCommandProcessor implements EventSubscriberInterface, ResetInterfac public static function getSubscribedEvents() { - return array( - ConsoleEvents::COMMAND => array('addCommandData', 1), - ); + return [ + ConsoleEvents::COMMAND => ['addCommandData', 1], + ]; } } diff --git a/src/Symfony/Bridge/Monolog/Processor/RouteProcessor.php b/src/Symfony/Bridge/Monolog/Processor/RouteProcessor.php index b00c97079b..0160754ad9 100644 --- a/src/Symfony/Bridge/Monolog/Processor/RouteProcessor.php +++ b/src/Symfony/Bridge/Monolog/Processor/RouteProcessor.php @@ -44,7 +44,7 @@ class RouteProcessor implements EventSubscriberInterface, ResetInterface public function reset() { - $this->routeData = array(); + $this->routeData = []; } public function addRouteData(GetResponseEvent $event) @@ -58,10 +58,10 @@ class RouteProcessor implements EventSubscriberInterface, ResetInterface return; } - $currentRequestData = array( + $currentRequestData = [ 'controller' => $request->attributes->get('_controller'), 'route' => $request->attributes->get('_route'), - ); + ]; if ($this->includeParams) { $currentRequestData['route_params'] = $request->attributes->get('_route_params'); @@ -78,9 +78,9 @@ class RouteProcessor implements EventSubscriberInterface, ResetInterface public static function getSubscribedEvents() { - return array( - KernelEvents::REQUEST => array('addRouteData', 1), - KernelEvents::FINISH_REQUEST => array('removeRouteData', 1), - ); + return [ + KernelEvents::REQUEST => ['addRouteData', 1], + KernelEvents::FINISH_REQUEST => ['removeRouteData', 1], + ]; } } diff --git a/src/Symfony/Bridge/Monolog/Tests/Processor/ConsoleCommandProcessorTest.php b/src/Symfony/Bridge/Monolog/Tests/Processor/ConsoleCommandProcessorTest.php index 2709c6a395..4c9774b4a4 100644 --- a/src/Symfony/Bridge/Monolog/Tests/Processor/ConsoleCommandProcessorTest.php +++ b/src/Symfony/Bridge/Monolog/Tests/Processor/ConsoleCommandProcessorTest.php @@ -19,8 +19,8 @@ use Symfony\Component\Console\Input\InputInterface; class ConsoleCommandProcessorTest extends TestCase { - private const TEST_ARGUMENTS = array('test' => 'argument'); - private const TEST_OPTIONS = array('test' => 'option'); + private const TEST_ARGUMENTS = ['test' => 'argument']; + private const TEST_OPTIONS = ['test' => 'option']; private const TEST_NAME = 'some:test'; public function testProcessor() @@ -28,11 +28,11 @@ class ConsoleCommandProcessorTest extends TestCase $processor = new ConsoleCommandProcessor(); $processor->addCommandData($this->getConsoleEvent()); - $record = $processor(array('extra' => array())); + $record = $processor(['extra' => []]); $this->assertArrayHasKey('command', $record['extra']); $this->assertEquals( - array('name' => self::TEST_NAME, 'arguments' => self::TEST_ARGUMENTS), + ['name' => self::TEST_NAME, 'arguments' => self::TEST_ARGUMENTS], $record['extra']['command'] ); } @@ -42,11 +42,11 @@ class ConsoleCommandProcessorTest extends TestCase $processor = new ConsoleCommandProcessor(true, true); $processor->addCommandData($this->getConsoleEvent()); - $record = $processor(array('extra' => array())); + $record = $processor(['extra' => []]); $this->assertArrayHasKey('command', $record['extra']); $this->assertEquals( - array('name' => self::TEST_NAME, 'arguments' => self::TEST_ARGUMENTS, 'options' => self::TEST_OPTIONS), + ['name' => self::TEST_NAME, 'arguments' => self::TEST_ARGUMENTS, 'options' => self::TEST_OPTIONS], $record['extra']['command'] ); } @@ -55,8 +55,8 @@ class ConsoleCommandProcessorTest extends TestCase { $processor = new ConsoleCommandProcessor(true, true); - $record = $processor(array('extra' => array())); - $this->assertEquals(array('extra' => array()), $record); + $record = $processor(['extra' => []]); + $this->assertEquals(['extra' => []], $record); } private function getConsoleEvent(): ConsoleEvent diff --git a/src/Symfony/Bridge/Monolog/Tests/Processor/RouteProcessorTest.php b/src/Symfony/Bridge/Monolog/Tests/Processor/RouteProcessorTest.php index 2a9c065886..5534240ba2 100644 --- a/src/Symfony/Bridge/Monolog/Tests/Processor/RouteProcessorTest.php +++ b/src/Symfony/Bridge/Monolog/Tests/Processor/RouteProcessorTest.php @@ -22,7 +22,7 @@ class RouteProcessorTest extends TestCase { private const TEST_CONTROLLER = 'App\Controller\SomeController::someMethod'; private const TEST_ROUTE = 'someRouteName'; - private const TEST_PARAMS = array('param1' => 'value1'); + private const TEST_PARAMS = ['param1' => 'value1']; public function testProcessor() { @@ -30,12 +30,12 @@ class RouteProcessorTest extends TestCase $processor = new RouteProcessor(); $processor->addRouteData($this->mockGetResponseEvent($request)); - $record = $processor(array('extra' => array())); + $record = $processor(['extra' => []]); $this->assertArrayHasKey('requests', $record['extra']); $this->assertCount(1, $record['extra']['requests']); $this->assertEquals( - array('controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE, 'route_params' => self::TEST_PARAMS), + ['controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE, 'route_params' => self::TEST_PARAMS], $record['extra']['requests'][0] ); } @@ -46,12 +46,12 @@ class RouteProcessorTest extends TestCase $processor = new RouteProcessor(false); $processor->addRouteData($this->mockGetResponseEvent($request)); - $record = $processor(array('extra' => array())); + $record = $processor(['extra' => []]); $this->assertArrayHasKey('requests', $record['extra']); $this->assertCount(1, $record['extra']['requests']); $this->assertEquals( - array('controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE), + ['controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE], $record['extra']['requests'][0] ); } @@ -66,16 +66,16 @@ class RouteProcessorTest extends TestCase $processor->addRouteData($this->mockGetResponseEvent($mainRequest)); $processor->addRouteData($this->mockGetResponseEvent($subRequest)); - $record = $processor(array('extra' => array())); + $record = $processor(['extra' => []]); $this->assertArrayHasKey('requests', $record['extra']); $this->assertCount(2, $record['extra']['requests']); $this->assertEquals( - array('controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE), + ['controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE], $record['extra']['requests'][0] ); $this->assertEquals( - array('controller' => $controllerFromSubRequest, 'route' => self::TEST_ROUTE), + ['controller' => $controllerFromSubRequest, 'route' => self::TEST_ROUTE], $record['extra']['requests'][1] ); } @@ -89,17 +89,17 @@ class RouteProcessorTest extends TestCase $processor->addRouteData($this->mockGetResponseEvent($mainRequest)); $processor->addRouteData($this->mockGetResponseEvent($subRequest)); $processor->removeRouteData($this->mockFinishRequestEvent($subRequest)); - $record = $processor(array('extra' => array())); + $record = $processor(['extra' => []]); $this->assertArrayHasKey('requests', $record['extra']); $this->assertCount(1, $record['extra']['requests']); $this->assertEquals( - array('controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE), + ['controller' => self::TEST_CONTROLLER, 'route' => self::TEST_ROUTE], $record['extra']['requests'][0] ); $processor->removeRouteData($this->mockFinishRequestEvent($mainRequest)); - $record = $processor(array('extra' => array())); + $record = $processor(['extra' => []]); $this->assertArrayNotHasKey('requests', $record['extra']); } @@ -110,16 +110,16 @@ class RouteProcessorTest extends TestCase $processor = new RouteProcessor(); $processor->addRouteData($this->mockGetResponseEvent($request)); - $record = $processor(array('extra' => array())); - $this->assertEquals(array('extra' => array()), $record); + $record = $processor(['extra' => []]); + $this->assertEquals(['extra' => []], $record); } public function testProcessorDoesNothingWhenNoRequest() { $processor = new RouteProcessor(); - $record = $processor(array('extra' => array())); - $this->assertEquals(array('extra' => array()), $record); + $record = $processor(['extra' => []]); + $this->assertEquals(['extra' => []], $record); } private function mockGetResponseEvent(Request $request): GetResponseEvent @@ -140,16 +140,16 @@ class RouteProcessorTest extends TestCase private function mockEmptyRequest(): Request { - return $this->mockRequest(array()); + return $this->mockRequest([]); } private function mockFilledRequest(string $controller = self::TEST_CONTROLLER): Request { - return $this->mockRequest(array( + return $this->mockRequest([ '_controller' => $controller, '_route' => self::TEST_ROUTE, '_route_params' => self::TEST_PARAMS, - )); + ]); } private function mockRequest(array $attributes): Request diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index 3fbeb87ab0..8980a9ee41 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -93,7 +93,7 @@ class TextDescriptor extends Descriptor ]; if ('' !== $route->getCondition()) { - $tableRows[] = array('Condition', $route->getCondition()); + $tableRows[] = ['Condition', $route->getCondition()]; } $table = new Table($this->getOutput()); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating.php index 162d09199f..a7edabf763 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating.php @@ -1,14 +1,14 @@ loadFromExtension('framework', array( - 'templating' => array( +$container->loadFromExtension('framework', [ + 'templating' => [ 'cache' => '/path/to/cache', - 'engines' => array('php', 'twig'), - 'loader' => array('loader.foo', 'loader.bar'), - 'form' => array( - 'resources' => array('theme1', 'theme2'), - ), + 'engines' => ['php', 'twig'], + 'loader' => ['loader.foo', 'loader.bar'], + 'form' => [ + 'resources' => ['theme1', 'theme2'], + ], 'hinclude_default_template' => 'global_hinclude_template', - ), + ], 'assets' => null, -)); +]); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php index 8e582b13a8..e4338e3746 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php @@ -42,7 +42,7 @@ class AutowiringTypesTest extends WebTestCase */ public function testTemplatingAutowiring() { - static::bootKernel(array('root_config' => 'templating.yml', 'environment' => 'templating')); + static::bootKernel(['root_config' => 'templating.yml', 'environment' => 'templating']); $autowiredServices = static::$container->get('test.autowiring_types.autowired_services'); $this->assertInstanceOf(FrameworkBundleEngineInterface::class, $autowiredServices->getFrameworkBundleEngine()); diff --git a/src/Symfony/Component/EventDispatcher/Tests/LegacyEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/LegacyEventDispatcherTest.php index d17e9f1406..49aa2f9ff3 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/LegacyEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/LegacyEventDispatcherTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\EventDispatcher\Tests; -use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; diff --git a/src/Symfony/Component/HttpKernel/Tests/Event/ControllerArgumentsEventTest.php b/src/Symfony/Component/HttpKernel/Tests/Event/ControllerArgumentsEventTest.php index 50faf23291..7758a66667 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Event/ControllerArgumentsEventTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Event/ControllerArgumentsEventTest.php @@ -11,7 +11,7 @@ class ControllerArgumentsEventTest extends TestCase { public function testControllerArgumentsEvent() { - $filterController = new ControllerArgumentsEvent(new TestHttpKernel(), function () {}, array('test'), new Request(), 1); - $this->assertEquals($filterController->getArguments(), array('test')); + $filterController = new ControllerArgumentsEvent(new TestHttpKernel(), function () {}, ['test'], new Request(), 1); + $this->assertEquals($filterController->getArguments(), ['test']); } } diff --git a/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php index 5a3a4cec53..fca4add09c 100644 --- a/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php +++ b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php @@ -16,8 +16,8 @@ use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\AuthenticationEvents; -use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent; use Symfony\Component\Security\Core\Event\AuthenticationFailureEvent; +use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent; use Symfony\Component\Security\Core\Exception\AccountStatusException; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\ProviderNotFoundException; diff --git a/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php b/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php index c2a66a49f6..4252bfe64d 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php @@ -16,8 +16,8 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\AuthenticationEvents; -use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent; use Symfony\Component\Security\Core\Event\AuthenticationFailureEvent; +use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent; use Symfony\Component\Security\Core\Exception\AccountStatusException; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\ProviderNotFoundException; diff --git a/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php b/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php index 2821d2a91d..25de3ce440 100644 --- a/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php +++ b/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php @@ -21,8 +21,8 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Guard\AuthenticatorInterface; use Symfony\Component\Security\Guard\GuardAuthenticatorHandler; use Symfony\Component\Security\Guard\Token\PreAuthenticationGuardToken; -use Symfony\Component\Security\Http\Firewall\ListenerInterface; use Symfony\Component\Security\Http\Firewall\LegacyListenerTrait; +use Symfony\Component\Security\Http\Firewall\ListenerInterface; use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface; /** diff --git a/src/Symfony/Component/Security/Http/Firewall.php b/src/Symfony/Component/Security/Http/Firewall.php index a1bdaa02be..bff8e3e884 100644 --- a/src/Symfony/Component/Security/Http/Firewall.php +++ b/src/Symfony/Component/Security/Http/Firewall.php @@ -14,8 +14,8 @@ namespace Symfony\Component\Security\Http; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Security\Http\Firewall\AccessListener; use Symfony\Component\Security\Http\Firewall\LogoutListener; diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php index 96b8940ccb..ecbf614a69 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php @@ -14,9 +14,9 @@ namespace Symfony\Component\Security\Http\Tests\Firewall; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; diff --git a/src/Symfony/Component/Workflow/Workflow.php b/src/Symfony/Component/Workflow/Workflow.php index c0866c6637..69e36a133a 100644 --- a/src/Symfony/Component/Workflow/Workflow.php +++ b/src/Symfony/Component/Workflow/Workflow.php @@ -13,13 +13,12 @@ namespace Symfony\Component\Workflow; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; -use Symfony\Component\Workflow\Event\Event; -use Symfony\Component\Workflow\Event\GuardEvent; use Symfony\Component\Workflow\Event\AnnounceEvent; -use Symfony\Component\Workflow\Event\EnterEvent; -use Symfony\Component\Workflow\Event\EnteredEvent; -use Symfony\Component\Workflow\Event\LeaveEvent; use Symfony\Component\Workflow\Event\CompletedEvent; +use Symfony\Component\Workflow\Event\EnteredEvent; +use Symfony\Component\Workflow\Event\EnterEvent; +use Symfony\Component\Workflow\Event\GuardEvent; +use Symfony\Component\Workflow\Event\LeaveEvent; use Symfony\Component\Workflow\Event\TransitionEvent; use Symfony\Component\Workflow\Exception\LogicException; use Symfony\Component\Workflow\Exception\NotEnabledTransitionException;