Skip to content

Commit

Permalink
Apply fixes from StyleCI (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored Dec 28, 2017
1 parent af04183 commit e0b2ec0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Command/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$linter = new Linter($options['path'], $options['exclude'], $options['extensions']);
$linter->setProcessLimit($options['jobs']);

if ($input->getOption('cache') !== null) {
if (null !== $input->getOption('cache')) {
Cache::setFilename($input->getOption('cache'));
}

Expand Down Expand Up @@ -221,13 +221,13 @@ protected function executeLint($linter, $input, $output, $fileCount)

if ($verbosity >= OutputInterface::VERBOSITY_VERBOSE) {
$filename = str_pad(" {$i}: ".$file->getRelativePathname(), $maxColumns - 10, ' ', \STR_PAD_RIGHT);
$status = \str_pad(($status === 'ok' ? '<info>OK</info>' : '<error>Error</error>'), 20, ' ', \STR_PAD_RIGHT);
$status = \str_pad(('ok' === $status ? '<info>OK</info>' : '<error>Error</error>'), 20, ' ', \STR_PAD_RIGHT);
$output->writeln(\sprintf("%s\t%s\t%s", $filename, $status, $process));
} else {
if ($i && $i % $maxColumns === 0) {
if ($i && 0 === $i % $maxColumns) {
$output->writeln($process);
}
$output->write($status === 'ok' ? '<info>.</info>' : '<error>E</error>');
$output->write('ok' === $status ? '<info>.</info>' : '<error>E</error>');
}
++$i;
});
Expand Down Expand Up @@ -299,7 +299,7 @@ protected function getConfigFile()

$dir = './';

if (count($inputPath) == 1 && $first = reset($inputPath)) {
if (1 == count($inputPath) && $first = reset($inputPath)) {
$dir = is_dir($first) ? $first : dirname($first);
}

Expand Down
1 change: 1 addition & 0 deletions src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
class Application extends BaseApplication
{
const NAME = 'phplint';

const VERSION = '1.0.1';

/**
Expand Down

0 comments on commit e0b2ec0

Please sign in to comment.