@@ -7,7 +7,6 @@ |
||
| 7 | 7 | |
| 8 | 8 | namespace Symplify\PHP7_CodeSniffer\EventDispatcher; |
| 9 | 9 | |
| 10 | -use Closure; |
|
| 11 | 10 | use ReflectionFunction; |
| 12 | 11 | use SplObjectStorage; |
| 13 | 12 | use Symplify\PHP7_CodeSniffer\SniffFinder\Naming\SniffNaming; |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | public function writeErrorReports(array $errorReports) |
| 55 | 55 | { |
| 56 | 56 | foreach ($errorReports as $file => $errors) { |
| 57 | - $this->symfonyStyle->section('FILE: ' . $file); |
|
| 57 | + $this->symfonyStyle->section('FILE: '.$file); |
|
| 58 | 58 | |
| 59 | 59 | $tableRows = $this->formatErrorsToTableRows($errors); |
| 60 | 60 | $this->symfonyStyle->table(['Line', 'Error', 'Sniff Code', 'Fixable'], $tableRows); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | |
| 37 | 37 | private function loadServicesFromConfig() |
| 38 | 38 | { |
| 39 | - $config = $this->loadFromFile(__DIR__ . '/../config/services.neon'); |
|
| 39 | + $config = $this->loadFromFile(__DIR__.'/../config/services.neon'); |
|
| 40 | 40 | $this->compiler->parseServices($this->getContainerBuilder(), $config); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -19,14 +19,14 @@ |
||
| 19 | 19 | $configurator = new Configurator(); |
| 20 | 20 | $configurator->setDebugMode(false); |
| 21 | 21 | $configurator->setTempDirectory($this->createAndReturnTempDir()); |
| 22 | - $configurator->addConfig(__DIR__ . '/../config/config.neon'); |
|
| 22 | + $configurator->addConfig(__DIR__.'/../config/config.neon'); |
|
| 23 | 23 | |
| 24 | 24 | return $configurator->createContainer(); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | private function createAndReturnTempDir() : string |
| 28 | 28 | { |
| 29 | - $tempDir = sys_get_temp_dir() . '/php7_codesniffer'; |
|
| 29 | + $tempDir = sys_get_temp_dir().'/php7_codesniffer'; |
|
| 30 | 30 | FileSystem::delete($tempDir); |
| 31 | 31 | FileSystem::createDir($tempDir); |
| 32 | 32 | |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | foreach (explode(',', $value) as $val) { |
| 130 | 130 | $v = ''; |
| 131 | 131 | |
| 132 | - list($k,$v) = explode('=>', $val.'=>'); |
|
| 132 | + list($k, $v) = explode('=>', $val.'=>'); |
|
| 133 | 133 | if ($v !== '') { |
| 134 | 134 | $values[$k] = $v; |
| 135 | 135 | } else { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * @param array|string[] $sniffs |
|
| 28 | + * @param Sniff[] $sniffs |
|
| 29 | 29 | */ |
| 30 | 30 | public function addSniffListeners(array $sniffs) |
| 31 | 31 | { |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | { |
| 57 | 57 | $this->addListener( |
| 58 | 58 | $token, |
| 59 | - function (CheckFileTokenEvent $checkFileToken) use ($sniffObject) { |
|
| 59 | + function(CheckFileTokenEvent $checkFileToken) use ($sniffObject) { |
|
| 60 | 60 | $sniffObject->process( |
| 61 | 61 | $checkFileToken->getFile(), |
| 62 | 62 | $checkFileToken->getStackPointer() |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | private function setAllowedValues(OptionsResolver $optionsResolver) |
| 39 | 39 | { |
| 40 | - $optionsResolver->setAllowedValues('standards', function (array $standards) { |
|
| 40 | + $optionsResolver->setAllowedValues('standards', function(array $standards) { |
|
| 41 | 41 | $standards = $this->normalizeCommaSeparatedValues($standards); |
| 42 | 42 | |
| 43 | 43 | $availableStandards = $this->standardFinder->getStandards(); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | return true; |
| 55 | 55 | }); |
| 56 | 56 | |
| 57 | - $optionsResolver->setAllowedValues('sniffs', function (array $sniffs) { |
|
| 57 | + $optionsResolver->setAllowedValues('sniffs', function(array $sniffs) { |
|
| 58 | 58 | $sniffs = $this->normalizeCommaSeparatedValues($sniffs); |
| 59 | 59 | |
| 60 | 60 | foreach ($sniffs as $sniff) { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | return true; |
| 72 | 72 | }); |
| 73 | 73 | |
| 74 | - $optionsResolver->setAllowedValues('source', function (array $source) { |
|
| 74 | + $optionsResolver->setAllowedValues('source', function(array $source) { |
|
| 75 | 75 | foreach ($source as $singleSource) { |
| 76 | 76 | if (!file_exists($singleSource)) { |
| 77 | 77 | throw new SourceNotFoundException(sprintf( |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $optionsResolver->setNormalizer( |
| 91 | 91 | 'standards', |
| 92 | - function (OptionsResolver $optionsResolver, array $standardNames) { |
|
| 92 | + function(OptionsResolver $optionsResolver, array $standardNames) { |
|
| 93 | 93 | $standardNames = $this->normalizeCommaSeparatedValues($standardNames); |
| 94 | 94 | return $this->standardFinder->getRulesetPathsForStandardNames($standardNames); |
| 95 | 95 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | /** |
| 78 | 78 | * {@inheritdoc} |
| 79 | 79 | */ |
| 80 | - public function addFixableError($error, $stackPtr, $code, $data=[], $severity=0) |
|
| 80 | + public function addFixableError($error, $stackPtr, $code, $data = [], $severity = 0) |
|
| 81 | 81 | { |
| 82 | 82 | $this->addError($error, $stackPtr, $code, $data, $severity, true); |
| 83 | 83 | return $this->isFixer; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $code, |
| 95 | 95 | $data, |
| 96 | 96 | $severity, |
| 97 | - $isFixable=false |
|
| 97 | + $isFixable = false |
|
| 98 | 98 | ) : bool { |
| 99 | 99 | if (!$error) { // skip warnings |
| 100 | 100 | return false; |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | continue; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - uasort($errorMessagesForFile, function ($first, $second) { |
|
| 132 | + uasort($errorMessagesForFile, function($first, $second) { |
|
| 133 | 133 | return ($first['line'] > $second['line']); |
| 134 | 134 | }); |
| 135 | 135 | |