Skip to content

Commit a0b93f4

Browse files
committed
make StyleCI happy
1 parent 6108dac commit a0b93f4

File tree

66 files changed

+276
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+276
-315
lines changed

Context/Context.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
final class Context
2222
{
23-
private $attributes = array();
23+
private $attributes = [];
2424
private $version;
2525
private $groups;
2626
private $maxDepth;
@@ -30,7 +30,7 @@ final class Context
3030
/**
3131
* @var ExclusionStrategyInterface[]
3232
*/
33-
private $exclusionStrategies = array();
33+
private $exclusionStrategies = [];
3434

3535
public function setAttribute(string $key, $value): self
3636
{

Controller/Annotations/AbstractParam.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract class AbstractParam implements ParamInterface
4141
public $nullable = false;
4242

4343
/** @var array */
44-
public $incompatibles = array();
44+
public $incompatibles = [];
4545

4646
/** {@inheritdoc} */
4747
public function getName()
@@ -70,7 +70,7 @@ public function getIncompatibilities()
7070
/** {@inheritdoc} */
7171
public function getConstraints()
7272
{
73-
$constraints = array();
73+
$constraints = [];
7474
if (!$this->nullable) {
7575
$constraints[] = new Constraints\NotNull();
7676
}

Controller/Annotations/AbstractScalarParam.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ public function getConstraints()
4141
if ($this->requirements instanceof Constraint) {
4242
$constraints[] = $this->requirements;
4343
} elseif (is_scalar($this->requirements)) {
44-
$constraints[] = new Regex(array(
44+
$constraints[] = new Regex([
4545
'pattern' => '#^(?:'.$this->requirements.')$#xsu',
4646
'message' => sprintf(
4747
'Parameter \'%s\' value, does not match requirements \'%s\'',
4848
$this->getName(),
4949
$this->requirements
5050
),
51-
));
51+
]);
5252
} elseif (is_array($this->requirements) && isset($this->requirements['rule']) && $this->requirements['error_message']) {
53-
$constraints[] = new Regex(array(
53+
$constraints[] = new Regex([
5454
'pattern' => '#^(?:'.$this->requirements['rule'].')$#xsu',
5555
'message' => $this->requirements['error_message'],
56-
));
56+
]);
5757
} elseif (is_array($this->requirements)) {
5858
foreach ($this->requirements as $requirement) {
5959
if ($requirement instanceof Constraint) {
@@ -75,9 +75,9 @@ public function getConstraints()
7575
// If the user wants to map the value, apply all constraints to every
7676
// value of the map
7777
if ($this->map) {
78-
$constraints = array(
79-
new All(array('constraints' => $constraints)),
80-
);
78+
$constraints = [
79+
new All(['constraints' => $constraints]),
80+
];
8181
if (false === $this->nullable) {
8282
$constraints[] = new NotNull();
8383
}

Controller/Annotations/FileParam.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getConstraints()
4949
$constraints[] = $this->requirements;
5050
}
5151

52-
$options = is_array($this->requirements) ? $this->requirements : array();
52+
$options = is_array($this->requirements) ? $this->requirements : [];
5353
if ($this->image) {
5454
$constraints[] = new Image($options);
5555
} else {
@@ -58,9 +58,9 @@ public function getConstraints()
5858

5959
// If the user wants to map the value
6060
if ($this->map) {
61-
$constraints = array(
62-
new All(array('constraints' => $constraints)),
63-
);
61+
$constraints = [
62+
new All(['constraints' => $constraints]),
63+
];
6464
}
6565

6666
return $constraints;

Controller/Annotations/ParamInterface.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ public function isStrict();
5858
/**
5959
* Get param value in function of the current request.
6060
*
61-
* @param Request $request
62-
* @param mixed $default value
61+
* @param mixed $default value
6362
*
6463
* @return mixed
6564
*/

Controller/TemplatingExceptionController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ public function __construct(
4343
/**
4444
* Finds the template for the given format and status code.
4545
*
46-
* @param Request $request
47-
* @param int $statusCode
48-
* @param bool $showException
46+
* @param int $statusCode
47+
* @param bool $showException
4948
*
5049
* @return string|TemplateReferenceInterface
5150
*/

DependencyInjection/Compiler/FormatListenerRulesPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function process(ContainerBuilder $container)
4242
'path' => "^/$path/",
4343
'priorities' => ['html', 'json'],
4444
'fallback_format' => 'html',
45-
'attributes' => array(),
45+
'attributes' => [],
4646
'prefer_extension' => true,
4747
];
4848

@@ -76,7 +76,7 @@ private function addRule(array $rule, ContainerBuilder $container)
7676
->addMethodCall('add', [$matcher, $rule]);
7777
}
7878

79-
private function createRequestMatcher(ContainerBuilder $container, $path = null, $host = null, $methods = null, array $attributes = array())
79+
private function createRequestMatcher(ContainerBuilder $container, $path = null, $host = null, $methods = null, array $attributes = [])
8080
{
8181
$arguments = [$path, $host, $methods, null, $attributes];
8282
$serialized = serialize($arguments);

DependencyInjection/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function getConfigTreeBuilder(): TreeBuilder
195195
->end()
196196
->arrayNode('ips')
197197
->beforeNormalization()->ifString()->then(function ($v) {
198-
return array($v);
198+
return [$v];
199199
})->end()
200200
->prototype('scalar')->end()
201201
->end()
@@ -254,7 +254,7 @@ private function addViewSection(ArrayNodeDefinition $rootNode)
254254
->prototype('array')
255255
->beforeNormalization()
256256
->ifString()
257-
->then(function ($v) { return array($v); })
257+
->then(function ($v) { return [$v]; })
258258
->end()
259259
->prototype('scalar')->end()
260260
->end()
@@ -467,7 +467,7 @@ private function addExceptionSection(ArrayNodeDefinition $rootNode)
467467
->always()
468468
->then(function ($v) {
469469
if (!$v['enabled']) {
470-
return $v;
470+
return $v;
471471
}
472472

473473
if ($v['exception_listener']) {

DependencyInjection/FOSRestExtension.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function load(array $configs, ContainerBuilder $container)
8484
if (null !== $service) {
8585
if ('view_handler' === $key) {
8686
$container->setAlias('fos_rest.'.$key, new Alias($service, true));
87-
} elseif(in_array($key, ['inflector', 'router', 'templating'], true)) {
87+
} elseif (in_array($key, ['inflector', 'router', 'templating'], true)) {
8888
$alias = new Alias($service);
8989

9090
if (method_exists($alias, 'setDeprecated')) {
@@ -174,12 +174,12 @@ private function loadBodyListener(array $config, XmlFileLoader $loader, Containe
174174
}
175175

176176
$service->replaceArgument(1, $config['body_listener']['throw_exception_on_unsupported_content_type']);
177-
$service->addMethodCall('setDefaultFormat', array($config['body_listener']['default_format']));
177+
$service->addMethodCall('setDefaultFormat', [$config['body_listener']['default_format']]);
178178

179179
$container->getDefinition('fos_rest.decoder_provider')->replaceArgument(1, $config['body_listener']['decoders']);
180180

181181
if (class_exists(ServiceLocatorTagPass::class)) {
182-
$decoderServicesMap = array();
182+
$decoderServicesMap = [];
183183

184184
foreach ($config['body_listener']['decoders'] as $id) {
185185
$decoderServicesMap[$id] = new Reference($id);
@@ -466,7 +466,7 @@ private function loadSerializer(array $config, ContainerBuilder $container)
466466
{
467467
$bodyConverter = $container->hasDefinition('fos_rest.converter.request_body') ? $container->getDefinition('fos_rest.converter.request_body') : null;
468468
$viewHandler = $container->getDefinition('fos_rest.view_handler.default');
469-
$options = array();
469+
$options = [];
470470

471471
if (!empty($config['serializer']['version'])) {
472472
if ($bodyConverter) {
@@ -501,22 +501,22 @@ private function loadZoneMatcherListener(array $config, XmlFileLoader $loader, C
501501
$zone['ips']
502502
);
503503

504-
$zoneMatcherListener->addMethodCall('addRequestMatcher', array($matcher));
504+
$zoneMatcherListener->addMethodCall('addRequestMatcher', [$matcher]);
505505
}
506506
}
507507
}
508508

509-
private function createZoneRequestMatcher(ContainerBuilder $container, $path = null, $host = null, $methods = array(), $ip = null)
509+
private function createZoneRequestMatcher(ContainerBuilder $container, $path = null, $host = null, $methods = [], $ip = null)
510510
{
511511
if ($methods) {
512512
$methods = array_map('strtoupper', (array) $methods);
513513
}
514514

515-
$serialized = serialize(array($path, $host, $methods, $ip));
515+
$serialized = serialize([$path, $host, $methods, $ip]);
516516
$id = 'fos_rest.zone_request_matcher.'.md5($serialized).sha1($serialized);
517517

518518
// only add arguments that are necessary
519-
$arguments = array($path, $host, $methods, $ip);
519+
$arguments = [$path, $host, $methods, $ip];
520520
while (count($arguments) > 0 && !end($arguments)) {
521521
array_pop($arguments);
522522
}

EventListener/ExceptionListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ public function onKernelException($event)
8686
*/
8787
public static function getSubscribedEvents()
8888
{
89-
return array(
90-
KernelEvents::EXCEPTION => array('onKernelException', -100),
91-
);
89+
return [
90+
KernelEvents::EXCEPTION => ['onKernelException', -100],
91+
];
9292
}
9393
}

0 commit comments

Comments
 (0)