@@ -60,7 +60,7 @@ |
||
| 60 | 60 | * |
| 61 | 61 | * @param string $option |
| 62 | 62 | * @param string $value |
| 63 | - * @return PhpCodeSnifferReview |
|
| 63 | + * @return PhpCodeSnifferReviewNoBlade |
|
| 64 | 64 | */ |
| 65 | 65 | public function setOption($option, $value) |
| 66 | 66 | { |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | $builder = ''; |
| 44 | 44 | |
| 45 | 45 | foreach ($this->options as $option => $value) { |
| 46 | - $builder .= '--' . $option; |
|
| 46 | + $builder .= '--'.$option; |
|
| 47 | 47 | |
| 48 | 48 | if ($value) { |
| 49 | - $builder .= '=' . $value; |
|
| 49 | + $builder .= '='.$value; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $builder .= ' '; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function canReviewFile(FileInterface $file) |
| 83 | 83 | { |
| 84 | - return ($file->getExtension() === 'php' && substr($file->getFileName(),-strlen('blade.php'))!='blade.php'); |
|
| 84 | + return ($file->getExtension() === 'php' && substr($file->getFileName(), -strlen('blade.php')) != 'blade.php'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public function review(ReporterInterface $reporter, ReviewableInterface $file) |
| 91 | 91 | { |
| 92 | 92 | $bin = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, 'vendor/bin/phpcs'); |
| 93 | - $cmd = $bin . ' --report=json '; |
|
| 93 | + $cmd = $bin.' --report=json '; |
|
| 94 | 94 | |
| 95 | 95 | if ($this->getOptionsForConsole()) { |
| 96 | 96 | $cmd .= $this->getOptionsForConsole(); |
@@ -101,18 +101,18 @@ discard block |
||
| 101 | 101 | $process = $this->getProcess($cmd); |
| 102 | 102 | $process->run(); |
| 103 | 103 | |
| 104 | - if (! $process->isSuccessful()) { |
|
| 104 | + if (!$process->isSuccessful()) { |
|
| 105 | 105 | // Create the array of outputs and remove empty values. |
| 106 | 106 | $output = json_decode($process->getOutput(), true); |
| 107 | 107 | |
| 108 | - $filter = function ($acc, $file) { |
|
| 108 | + $filter = function($acc, $file) { |
|
| 109 | 109 | if ($file['errors'] > 0 || $file['warnings'] > 0) { |
| 110 | 110 | return $acc + $file['messages']; |
| 111 | 111 | } |
| 112 | 112 | }; |
| 113 | 113 | |
| 114 | 114 | foreach (array_reduce($output['files'], $filter, []) as $error) { |
| 115 | - $message = $error['message'] . ' on line ' . $error['line']; |
|
| 115 | + $message = $error['message'].' on line '.$error['line']; |
|
| 116 | 116 | $reporter->warning($message, $this, $file); |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function canReviewFile(FileInterface $file) |
| 30 | 30 | { |
| 31 | - return ($file->getExtension() === 'php' && substr($file->getFileName(),-strlen('blade.php'))!='blade.php'); |
|
| 31 | + return ($file->getExtension() === 'php' && substr($file->getFileName(), -strlen('blade.php')) != 'blade.php'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | fclose($f); |
| 46 | 46 | |
| 47 | 47 | |
| 48 | - if (! in_array(trim($line), ['<?php', '#!/usr/bin/env php'])) { |
|
| 48 | + if (!in_array(trim($line), ['<?php', '#!/usr/bin/env php'])) { |
|
| 49 | 49 | $message = 'File must begin with `<?php` or `#!/usr/bin/env php`'; |
| 50 | 50 | $reporter->error($message, $this, $file); |
| 51 | 51 | |