@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $optionsResolver->setNormalizer( |
46 | 46 | self::NAME, |
47 | - function (OptionsResolver $optionsResolver, array $sniffCodes) { |
|
47 | + function(OptionsResolver $optionsResolver, array $sniffCodes) { |
|
48 | 48 | $sniffCodeToClasses = []; |
49 | 49 | foreach ($sniffCodes as $sniffCode) { |
50 | 50 | $sniffCodeToClasses[$sniffCode] = SniffNaming::guessClassByCode($sniffCode); |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | |
58 | 58 | private function setSniffsAllowedValues(OptionsResolver $optionsResolver) |
59 | 59 | { |
60 | - $optionsResolver->setAllowedValues(self::NAME, function (array $sniffs) { |
|
60 | + $optionsResolver->setAllowedValues(self::NAME, function(array $sniffs) { |
|
61 | 61 | $sniffs = ValueNormalizer::normalizeCommaSeparatedValues($sniffs); |
62 | 62 | |
63 | 63 | foreach ($sniffs as $sniff) { |
64 | 64 | if (substr_count($sniff, '.') !== 2) { |
65 | 65 | throw new InvalidSniffCodeException(sprintf( |
66 | - 'The specified sniff code "%s" is invalid.' . |
|
67 | - PHP_EOL . |
|
66 | + 'The specified sniff code "%s" is invalid.'. |
|
67 | + PHP_EOL. |
|
68 | 68 | 'Correct format is "StandardName.Category.SniffName".', |
69 | 69 | $sniff |
70 | 70 | )); |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | $parts = explode('\\', $sniffClass); |
48 | 48 | |
49 | - $standardName = $parts[count($parts)-4]; |
|
49 | + $standardName = $parts[count($parts) - 4]; |
|
50 | 50 | if (Strings::endsWith($standardName, 'CodingStandard')) { |
51 | 51 | $standardName = substr($standardName, 0, -strlen('CodingStandard')); |
52 | 52 | } |
53 | 53 | |
54 | - $categoryName = $parts[count($parts)-2]; |
|
54 | + $categoryName = $parts[count($parts) - 2]; |
|
55 | 55 | |
56 | - $sniffName = $parts[count($parts)-1]; |
|
56 | + $sniffName = $parts[count($parts) - 1]; |
|
57 | 57 | $sniffName = substr($sniffName, 0, -strlen('Sniff')); |
58 | 58 | |
59 | 59 | return $standardName.'.'.$categoryName.'.'.$sniffName; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | throw new SniffClassCouldNotBeFoundException(sprintf( |
94 | 94 | 'Sniff class for code "%s" could not be found. We tried:'.PHP_EOL.' - %s ', |
95 | 95 | $sniffCode, |
96 | - implode(PHP_EOL . ' - ', $guessedClasses) |
|
96 | + implode(PHP_EOL.' - ', $guessedClasses) |
|
97 | 97 | )); |
98 | 98 | } |
99 | 99 | } |
@@ -35,8 +35,8 @@ |
||
35 | 35 | $standardDir = dirname($standardRuleset); |
36 | 36 | |
37 | 37 | $classLoader->addPsr4( |
38 | - $standardNamespace . '\\', |
|
39 | - $standardDir . DIRECTORY_SEPARATOR . $standardNamespace |
|
38 | + $standardNamespace.'\\', |
|
39 | + $standardDir.DIRECTORY_SEPARATOR.$standardNamespace |
|
40 | 40 | ); |
41 | 41 | } |
42 | 42 | } |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | return $this->resolveArrayValue($property); |
58 | 58 | } |
59 | 59 | |
60 | - return (string)$property['value']; |
|
60 | + return (string) $property['value']; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | private function isArrayValue(SimpleXMLElement $property) : bool |
64 | 64 | { |
65 | - return isset($property['type']) === true && (string)$property['type'] === 'array'; |
|
65 | + return isset($property['type']) === true && (string) $property['type'] === 'array'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | private function resolveArrayValue(SimpleXMLElement $arrayProperty) : array |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | foreach (explode(',', $value) as $val) { |
74 | 74 | $v = ''; |
75 | 75 | |
76 | - list($key, $v) = explode('=>', $val . '=>'); |
|
76 | + list($key, $v) = explode('=>', $val.'=>'); |
|
77 | 77 | if ($v !== '') { |
78 | 78 | $values[$key] = $v; |
79 | 79 | } else { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function createFromSniffClassNames( |
20 | 20 | array $sniffClasses, |
21 | - array $customProperties=[] |
|
21 | + array $customProperties = [] |
|
22 | 22 | ) : array { |
23 | 23 | $sniffs = []; |
24 | 24 | foreach ($sniffClasses as $sniffCode => $sniffClass) { |