10000 change code style according fabbot · symfony/symfony@4559269 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4559269

Browse files
committed
change code style according fabbot
1 parent 4324c55 commit 4559269

File tree

1 file changed

+54
-53
lines changed

1 file changed

+54
-53
lines changed

src/Symfony/Component/OptionsResolver/OptionsResolver.php

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,66 +29,66 @@ class OptionsResolver implements Options
2929
/**
3030
* The names of all defined options.
3131
*/
32-
private $defined = [];
32+
private $defined = array();
3333

3434
/**
3535
* The default option values.
3636
*/
37-
private $defaults = [];
37+
private $defaults = array();
3838

3939
/**
4040
* The names of required options.
4141
*/
42-
private $required = [];
42+
private $required = array();
4343

4444
/**
4545
* The resolved option values.
4646
*/
47-
private $resolved = [];
47+
private $resolved = array();
4848

4949
/**
5050
* A list of normalizer closures.
5151
*
5252
* @var \Closure[]
5353
*/
54-
private $normalizers = [];
54+
private $normalizers = array();
5555

5656
/**
5757
* A list of accepted values for each option.
5858
*/
59-
private $allowedValues = [];
59+
private $allowedValues = array();
6060

6161
/**
6262
* A list of accepted types for each option.
6363
*/
64-
private $allowedTypes = [];
64+
private $allowedTypes = array();
6565

6666
/**
6767
* A list of closures for evaluating lazy options.
6868
*/
69-
private $lazy = [];
69+
private $lazy = array();
7070

7171
/**
7272
* A list of lazy options whose closure is currently being called.
7373
*
7474
* This list helps detecting circular dependencies between lazy options.
7575
*/
76-
private $calling = [];
76+
private $calling = array();
7777

7878
/**
7979
* A list of nested OptionResolvers.
8080
*/
81-
private $nested = [];
81+
private $nested = array();
8282

8383
/**
8484
* A list of parent name. Use in exceptions.
8585
*/
86-
private $nestedLevelsName = [];
86+
private $nestedLevelsName = array();
8787

8888
/**
89-
* A list of resoilve data. Needs for root access from children
89+
* A list of resoilve data. Needs for root access from children.
9090
*/
91-
private $resolvedData = [];
91+
private $resolvedData = array();
9292

9393
/**
9494
* Parent OptionResolver.
@@ -107,11 +107,11 @@ class OptionsResolver implements Options
107107
*/
108108
private $locked = false;
109109

110-
private static $typeAliases = [
110+
private static $typeAliases = array(
111111
'boolean' => 'bool',
112112
'integer' => 'int',
113113
'double' => 'float',
114-
];
114+
);
115115

116116
/**
117117
* Sets the default value of a given option.
@@ -147,7 +147,7 @@ class OptionsResolver implements Options
147147
* sub-classes.
148148
*
149149
* @param string $option The name of the option
150-
* @param mixed $value The default value of the option
150+
* @param mixed $value The default value of the option
151151
*
152152
* @return $this
153153
*
@@ -171,7 +171,7 @@ public function setDefault($option, $value)
171171
$optionsResolver->setNestedLevelsName(
172172
array_merge(
173173
$this->getNestedLevelsName(),
174-
[$option]
174+
array($option)
175175
)
176176
);
177177
// Set parent for child OptionResolvers
@@ -198,7 +198,7 @@ public function setDefault($option, $value)
198198

199199
// Ignore previous lazy options if the closure has no second parameter
200200
if (!isset($this->lazy[$option]) || !isset($params[1])) {
201-
$this->lazy[$option] = [];
201+
$this->lazy[$option] = array();
202202
}
203203

204204
// Store closure for later evaluation
@@ -360,21 +360,21 @@ public function isRequired($option)
360360
*
361361
* @see isRequired()
362362
*/
363-
public function getRequiredOptions(array $nestedLevel = [])
363+
public function getRequiredOptions(array $nestedLevel = array())
364364
{
365-
< 10000 span class="pl-c1">$requiredOptions = [];
365+
$requiredOptions = array();
366366

367367
// Call recursive for all nested OptionResolvers
368368
foreach ($this->nested as $key => $nested) {
369-
if ($required = $nested->getRequiredOptions(array_merge($nestedLevel, [$key]))) {
369+
if ($required = $nested->getRequiredOptions(array_merge($nestedLevel, array($key)))) {
370370
$requiredOptions = $required;
371371
}
372372
}
373373

374374
foreach ($this->required as $key => $item) {
375375
// If we in child OptionResolver, return array
376376
if (count($nestedLevel)) {
377-
$key = array_merge($nestedLevel, [$key]);
377+
$key = array_merge($nestedLevel, array($key));
378378
}
379379
$requiredOptions[] = $key;
380380
}
@@ -421,13 +421,13 @@ public function isMissing($option)
421421
*
422422
* @see isMissing()
423423
*/
424-
public function getMissingOptions(array $nestedLevel = [])
424+
public function getMissingOptions(array $nestedLevel = array())
425425
{
426-
$missingOptions = [];
426+
$missingOptions = array();
427427

428428
// Call recursive for all nested OptionResolvers
429429
foreach ($this->nested as $key => $nested) {
430-
if ($required = $nested->getMissingOptions(array_merge($nestedLevel, [$key]))) {
430+
if ($required = $nested->getMissingOptions(array_merge($nestedLevel, array($key)))) {
431431
$missingOptions = $required;
432432
}
433433
}
@@ -439,7 +439,7 @@ public function getMissingOptions(array $nestedLevel = [])
439439

440440
// If we in child OptionResolver, return array
441441
if (count($nestedLevel)) {
442-
$key = array_merge($nestedLevel, [$key]);
442+
$key = array_merge($nestedLevel, array($key));
443443
}
444444

445445
$missingOptions[] = $key;
@@ -534,21 +534,21 @@ public function isDefined($option)
534534
*
535535
* @see isDefined()
536536
*/
537-
public function getDefinedOptions(array $nestedLevel = [])
537+
public function getDefinedOptions(array $nestedLevel = array())
538538
{
539-
$definedOptions = [];
539+
$definedOptions = array();
540540

541541
// Call recursive for all nested OptionResolvers
542542
foreach ($this->nested as $key => $nested) {
543-
if ($required = $nested->getDefinedOptions(array_merge($nestedLevel, [$key]))) {
543+
if ($required = $nested->getDefinedOptions(array_merge($nestedLevel, array($key)))) {
544544
$definedOptions = $required;
545545
}
546546
}
547547

548548
// If we in child OptionResolver, return array
549549
foreach ($this->defined as $key => $item) {
550550
if (count($nestedLevel)) {
551-
$key = array_merge($nestedLevel, [$key]);
551+
$key = array_merge($nestedLevel, array($key));
552552
}
553553
$definedOptions[] = $key;
554554
}
@@ -576,7 +576,7 @@ public function getDefinedOptions(array $nestedLevel = [])
576576
*
577577
* The resolved option value is set to the return value of the closure.
578578
*
579-
* @param string|string[] $option The option name
579+
* @param string|string[] $option The option name
580580
* @param \Closure $normalizer The normalizer
581581
*
582582
* @return $this
@@ -645,7 +645,7 @@ public function setNormalizer($option, \Closure $normalizer)
645645
* The closure receives the value as argument and should return true to
646646
* accept the value and false to reject the value.
647647
*
648-
* @param string|string[] $option The option name
648+
* @param string|string[] $option The option name
649649
* @param mixed $allowedValues One or more acceptable values/closures
650650
*
651651
* @return $this
@@ -693,7 +693,7 @@ public function setAllowedValues($option, $allowedValues)
693693
));
694694
}
695695

696-
$this->allowedValues[$option] = is_array($allowedValues) ? $allowedValues : [$allowedValues];
696+
$this->allowedValues[$option] = is_array($allowedValues) ? $allowedValues : array($allowedValues);
697697

698698
// Make sure the option is processed
699699
unset($this->resolved[$option]);
@@ -716,7 +716,7 @@ public function setAllowedValues($option, $allowedValues)
716716
* The closure receives the value as argument and should return true to
717717
* accept the value and false to reject the value.
718718
*
719-
* @param string|string[] $option The option name
719+
* @param string|string[] $option The option name
720720
* @param mixed $allowedValues One or more acceptable values/closures
721721
*
722722
* @return $this
@@ -765,7 +765,7 @@ public function addAllowedValues($option, $allowedValues)
765765
}
766766

767767
if (!is_array($allowedValues)) {
768-
$allowedValues = [$allowedValues];
768+
$allowedValues = array($allowedValues);
769769
}
770770

771771
if (!isset($this->allowedValues[$option])) {
@@ -787,7 +787,7 @@ public function addAllowedValues($option, $allowedValues)
787787
* acceptable. Additionally, fully-qualified class or interface names may
788788
* be passed.
789789
*
790-
* @param string|string[] $option The option name
790+
* @param string|string[] $option The option name
791791
* @param string|string[] $allowedTypes One or more accepted types
792792
*
793793
* @return $this
@@ -852,7 +852,7 @@ public function setAllowedTypes($option, $allowedTypes)
852852
* acceptable. Additionally, fully-qualified class or interface names may
853853
* be passed.
854854
*
855-
* @param string|string[] $option The option name
855+
* @param string|string[] $option The option name
856856
* @param string|string[] $allowedTypes One or more accepted types
857857
*
858858
* @return $this
@@ -1012,16 +1012,16 @@ public function clear($options = null)
10121012
return $this;
10131013
}
10141014

1015-
$this->defined = [];
1016-
$this->defaults = [];
1017-
$this->required = [];
1018-
$this->resolved = [];
1019-
$this->lazy = [];
1020-
$this->normalizers = [];
1021-
$this->allowedTypes = [];
1022-
$this->allowedValues = [];
1023-
$this->nested = [];
1024-
$this->nestedLevelsName = [];
1015+
$this->defined = array();
1016+
$this->defaults = array();
1017+
$this->required = array();
1018+
$this->resolved = array();
1019+
$this->lazy = array();
1020+
$this->normalizers = array();
1021+
$this->allowedTypes = array();
1022+
$this->allowedValues = array();
1023+
$this->nested = array();
1024+
$this->nestedLevelsName = array();
10251025

10261026
return $this;
10271027
}
@@ -1050,7 +1050,7 @@ public function clear($options = null)
10501050
* @throws NoSuchOptionException If a lazy option reads an unavailable option
10511051
* @throws AccessException If called from a lazy option or normalizer
10521052
*/
1053-
public function resolve(array $options = [])
1053+
public function resolve(array $options = array())
10541054
{
10551055
if ($this->locked) {
10561056
throw new AccessException('Options cannot be resolved from a lazy option or normalizer.');
@@ -1120,7 +1120,7 @@ public function resolve(array $options = [])
11201120
// If there are nested entities, then we pass them
11211121
if (count($this->nested)) {
11221122
foreach ($this->nested as $option => $item) {
1123-
$clone->resolved[$option] = $item->resolve($options[$option] ?? []);
1123+
$clone->resolved[$option] = $item->resolve($options[$option] ?? array());
11241124
}
11251125
}
11261126

@@ -1143,11 +1143,12 @@ public function resolve(array $options = [])
11431143
/**
11441144
* Last step for resolve data
11451145
* If there are closures without resolve, we tried to resolve it with finish data
1146-
* It needs when we want need access to parents resolver from nested resolvers
1146+
* It needs when we want need access to parents resolver from nested resolvers.
11471147
*
11481148
* @param array $data
11491149
*
11501150
* @return array
1151+
*
11511152
* @throws \ReflectionException
11521153
*/
11531154
private function rezolveParentAccess(array $data)
@@ -1255,7 +1256,7 @@ public function offsetGet($option)
12551256
// Validate the type of the resolved option
12561257
if (isset($this->allowedTypes[$option])) {
12571258
$valid = false;
1258-
$invalidTypes = [];
1259+
$invalidTypes = array();
12591260

12601261
foreach ($this->allowedTypes[$option] as $type) {
12611262
$type = isset(self::$typeAliases[$type]) ? self::$typeAliases[$type] : $type;
@@ -1283,7 +1284,7 @@ public function offsetGet($option)
12831284
// Validate the value of the resolved option
12841285
if (isset($this->allowedValues[$option])) {
12851286
$success = false;
1286-
$printableAllowedValues = [];
1287+
$printableAllowedValues = array();
12871288

12881289
foreach ($this->allowedValues[$option] as $allowedValue) {
12891290
if ($allowedValue instanceof \Closure) {
@@ -1522,7 +1523,7 @@ private function formatTypeOf($value, ?string $type): string
15221523
}
15231524

15241525
if (is_array($value)) {
1525-
$subTypes = [];
1526+
$subTypes = array();
15261527
foreach ($value as $val) {
15271528
$subTypes[$this->formatTypeOf($val, null)] = true;
15281529
}

0 commit comments

Comments
 (0)
0