From 6809fb0d2d23695dd9338ad55ef66fe2f37db768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Tue, 4 Jul 2017 21:13:20 +0800 Subject: [PATCH] Apply fixes from StyleCI (#21) --- src/Cache.php | 5 ++++- src/Command/LintCommand.php | 7 +++++-- src/Console/Application.php | 5 ++++- src/Linter.php | 11 +++++++---- src/Output/ConsoleOutput.php | 5 ++++- src/Process/Lint.php | 5 ++++- 6 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/Cache.php b/src/Cache.php index 55cb1512..2fe21df5 100644 --- a/src/Cache.php +++ b/src/Cache.php @@ -3,7 +3,10 @@ /* * This file is part of the overtrue/phplint. * - * (c) 2016 overtrue + * (c) overtrue + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. */ namespace Overtrue\PHPLint; diff --git a/src/Command/LintCommand.php b/src/Command/LintCommand.php index ca7233d0..2b0d2850 100644 --- a/src/Command/LintCommand.php +++ b/src/Command/LintCommand.php @@ -3,7 +3,10 @@ /* * This file is part of the overtrue/phplint. * - * (c) 2016 overtrue + * (c) overtrue + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. */ namespace Overtrue\PHPLint\Command; @@ -200,7 +203,7 @@ protected function executeLint($linter, $output, $fileCount, $cache = true) } ++$i; if ($verbosity >= OutputInterface::VERBOSITY_VERBOSE) { - $output->writeln('Linting: '.$filename. "\t".($status === 'ok' ? 'OK' : 'Error')); + $output->writeln('Linting: '.$filename."\t".($status === 'ok' ? 'OK' : 'Error')); } else { $output->write($status === 'ok' ? '.' : 'E'); } diff --git a/src/Console/Application.php b/src/Console/Application.php index 2e0db507..e3920085 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -3,7 +3,10 @@ /* * This file is part of the overtrue/phplint. * - * (c) 2016 overtrue + * (c) overtrue + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. */ namespace Overtrue\PHPLint\Console; diff --git a/src/Linter.php b/src/Linter.php index c1ba3cba..645216f3 100644 --- a/src/Linter.php +++ b/src/Linter.php @@ -3,7 +3,10 @@ /* * This file is part of the overtrue/phplint. * - * (c) 2016 overtrue + * (c) overtrue + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. */ namespace Overtrue\PHPLint; @@ -81,7 +84,7 @@ public function lint($files = [], $cache = true) $files = $this->getFiles(); } - $processCallback = is_callable($this->processCallback) ? $this->processCallback : function() { + $processCallback = is_callable($this->processCallback) ? $this->processCallback : function () { }; $errors = []; @@ -148,7 +151,7 @@ public function getFiles() foreach ((array) $this->path as $path) { if (is_dir($path)) { $this->files = array_merge($this->files, $this->getFilesFromDir($path)); - } else if (is_file($path)) { + } elseif (is_file($path)) { $file = new SplFileInfo($path); $this->files[$file->getRealPath()] = $file; } @@ -161,7 +164,7 @@ public function getFiles() /** * Get files from directory. * - * @param string $dir + * @param string $dir * * @return array */ diff --git a/src/Output/ConsoleOutput.php b/src/Output/ConsoleOutput.php index 728e8b32..efaa0056 100644 --- a/src/Output/ConsoleOutput.php +++ b/src/Output/ConsoleOutput.php @@ -3,7 +3,10 @@ /* * This file is part of the overtrue/phplint. * - * (c) 2016 overtrue + * (c) overtrue + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. */ namespace Overtrue\PHPLint\Output; diff --git a/src/Process/Lint.php b/src/Process/Lint.php index 6b86e965..baa5b2dd 100644 --- a/src/Process/Lint.php +++ b/src/Process/Lint.php @@ -3,7 +3,10 @@ /* * This file is part of the overtrue/phplint. * - * (c) 2016 overtrue + * (c) overtrue + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. */ namespace Overtrue\PHPLint\Process;