From 3b8398aefe027928768e4459009a8f68dc18a4e8 Mon Sep 17 00:00:00 2001 From: overtrue Date: Mon, 15 Aug 2016 20:52:51 +0800 Subject: [PATCH] Bugfix with PHP 5.x. --- src/Command/LintCommand.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Command/LintCommand.php b/src/Command/LintCommand.php index 40821345..adb5a316 100644 --- a/src/Command/LintCommand.php +++ b/src/Command/LintCommand.php @@ -45,7 +45,7 @@ class LintCommand extends Command /** * @var string */ - protected $cacheFile = __DIR__.'/../../.phplint-cache'; + protected $cacheFile = '../../.phplint-cache'; /** * Configures the current command. @@ -142,8 +142,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $linter = new Linter($options['path'], $options['exclude'], $options['extensions']); $linter->setProcessLimit($options['jobs']); - if (!$input->getOption('no-cache') && file_exists($this->cacheFile)) { - $linter->setCache(json_decode(file_get_contents($this->cacheFile), true)); + if (!$input->getOption('no-cache') && file_exists(__DIR__.'/'.$this->cacheFile)) { + $linter->setCache(json_decode(file_get_contents(__DIR__.'/'.$this->cacheFile), true)); } $fileCount = count($linter->getFiles()); @@ -284,14 +284,14 @@ protected function getScreenColumns() } elseif (function_exists('proc_open')) { $process = proc_open( 'mode CON', - array( - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w'), - ), + [ + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], + ], $pipes, null, null, - array('suppress_errors' => true) + ['suppress_errors' => true] ); if (is_resource($process)) { $info = stream_get_contents($pipes[1]);