Skip to content

Commit

Permalink
Bugfix with PHP 5.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Aug 15, 2016
1 parent 5c26ad9 commit 3b8398a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Command/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class LintCommand extends Command
/**
* @var string
*/
protected $cacheFile = __DIR__.'/../../.phplint-cache';
protected $cacheFile = '../../.phplint-cache';

/**
* Configures the current command.
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit 3b8398a

Please sign in to comment.