Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Apr 16, 2020
1 parent bc18c7b commit 832b11f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Cache.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the overtrue/phplint.
* This file is part of the overtrue/phplint
*
* (c) overtrue <[email protected]>
*
Expand Down Expand Up @@ -100,6 +100,6 @@ public static function getFilename()
return self::$filename;
}

return (getcwd() ?: './').'/'.self::$filename;
return (getcwd() ?: './') . '/' . self::$filename;
}
}
16 changes: 8 additions & 8 deletions src/Command/LintCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the overtrue/phplint.
* This file is part of the overtrue/phplint
*
* (c) overtrue <[email protected]>
*
Expand Down Expand Up @@ -167,13 +167,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$startTime = microtime(true);
$startMemUsage = memory_get_usage(true);

$output->writeln($this->getApplication()->getLongVersion()." by overtrue and contributors.\n");
$output->writeln($this->getApplication()->getLongVersion() . " by overtrue and contributors.\n");

$options = $this->mergeOptions();
$verbosity = $output->getVerbosity();

if ($verbosity >= OutputInterface::VERBOSITY_DEBUG) {
$output->writeln('Options: '.json_encode($options)."\n");
$output->writeln('Options: ' . json_encode($options) . "\n");
}

$linter = new Linter($options['path'], $options['exclude'], $options['extensions']);
Expand Down Expand Up @@ -302,7 +302,7 @@ protected function executeLint($linter, $input, $output, $fileCount)
$process = str_pad(" {$i} / {$fileCount} ({$percent}%)", 18, ' ', STR_PAD_LEFT);

if ($verbosity >= OutputInterface::VERBOSITY_VERBOSE) {
$filename = str_pad(" {$i}: ".$file->getRelativePathname(), $maxColumns - 10, ' ', \STR_PAD_RIGHT);
$filename = str_pad(" {$i}: " . $file->getRelativePathname(), $maxColumns - 10, ' ', \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 {
Expand All @@ -329,10 +329,10 @@ protected function executeLint($linter, $input, $output, $fileCount)
protected function showErrors($errors)
{
$i = 0;
$this->output->writeln("\nThere was ".count($errors).' errors:');
$this->output->writeln("\nThere was " . count($errors) . ' errors:');

foreach ($errors as $filename => $error) {
$this->output->writeln('<comment>'.++$i.". {$filename}:{$error['line']}".'</comment>');
$this->output->writeln('<comment>' . ++$i . ". {$filename}:{$error['line']}" . '</comment>');

$this->output->write($this->getHighlightedCodeSnippet($filename, $error['line']));

Expand Down Expand Up @@ -361,7 +361,7 @@ protected function getCodeSnippet($filePath, $lineNumber, $linesBefore = 3, $lin

foreach ($lines as $i => $line) {
$snippet .= (abs($lineNumber) === $i + 1 ? ' > ' : ' ');
$snippet .= str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT).'| '.rtrim($line).PHP_EOL;
$snippet .= str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT) . '| ' . rtrim($line) . PHP_EOL;
}

return $snippet;
Expand Down Expand Up @@ -445,7 +445,7 @@ protected function getConfigFile()
$dir = is_dir($first) ? $first : dirname($first);
}

$filename = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'.phplint.yml';
$filename = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '.phplint.yml';

return realpath($filename);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Application.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the overtrue/phplint.
* This file is part of the overtrue/phplint
*
* (c) overtrue <[email protected]>
*
Expand Down
6 changes: 3 additions & 3 deletions src/Linter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the overtrue/phplint.
* This file is part of the overtrue/phplint
*
* (c) overtrue <[email protected]>
*
Expand Down Expand Up @@ -185,7 +185,7 @@ protected function getFilesFromDir($dir)
}

foreach ($this->extensions as $extension) {
$finder->name('*.'.$extension);
$finder->name('*.' . $extension);
}

return iterator_to_array($finder);
Expand Down Expand Up @@ -251,7 +251,7 @@ public function setProcessLimit($processLimit)
protected function createLintProcess($filename)
{
$command = [
PHP_SAPI == 'cli' ? PHP_BINARY : PHP_BINDIR.'/php',
PHP_SAPI == 'cli' ? PHP_BINARY : PHP_BINDIR . '/php',
'-d error_reporting=E_ALL',
'-d display_errors=On',
'-l', $filename,
Expand Down
2 changes: 1 addition & 1 deletion src/Output/ConsoleOutput.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the overtrue/phplint.
* This file is part of the overtrue/phplint
*
* (c) overtrue <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Process/Lint.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the overtrue/phplint.
* This file is part of the overtrue/phplint
*
* (c) overtrue <[email protected]>
*
Expand Down

0 comments on commit 832b11f

Please sign in to comment.