Skip to content

Commit 95bc42f

Browse files
committed
CS.
1 parent a73449a commit 95bc42f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/Command/LintCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\Console\Input\InputOption;
2121
use Symfony\Component\Console\Output\OutputInterface;
2222
use Symfony\Component\Console\Terminal;
23+
use Symfony\Component\Finder\SplFileInfo;
2324
use Symfony\Component\Yaml\Exception\ParseException;
2425
use Symfony\Component\Yaml\Yaml;
2526

@@ -212,7 +213,7 @@ protected function executeLint($linter, $input, $output, $fileCount)
212213
$maxColumns = floor((new Terminal())->getWidth() / 2);
213214
$verbosity = $output->getVerbosity();
214215

215-
$linter->setProcessCallback(function ($status, \SplFileInfo $file) use ($output, $verbosity, $fileCount, $maxColumns) {
216+
$linter->setProcessCallback(function ($status, SplFileInfo $file) use ($output, $verbosity, $fileCount, $maxColumns) {
216217
static $i = 1;
217218

218219
$percent = floor(($i / $fileCount) * 100);

src/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Application extends BaseApplication
2121
{
2222
const NAME = 'phplint';
2323

24-
const VERSION = '1.0.1';
24+
const VERSION = '1.0.2';
2525

2626
/**
2727
* Constructor.

src/Linter.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use InvalidArgumentException;
1515
use Overtrue\PHPLint\Process\Lint;
16-
use SplFileInfo;
16+
use Symfony\Component\Finder\SplFileInfo;
1717
use Symfony\Component\Finder\Finder;
1818

1919
/**
@@ -155,8 +155,7 @@ public function getFiles()
155155
if (is_dir($path)) {
156156
$this->files = array_merge($this->files, $this->getFilesFromDir($path));
157157
} elseif (is_file($path)) {
158-
$file = new SplFileInfo($path);
159-
$this->files[$file->getRealPath()] = $file;
158+
$this->files[$path] = new SplFileInfo($path, $path, $path);
160159
}
161160
}
162161
}
@@ -198,14 +197,13 @@ public function setFiles(array $files)
198197
{
199198
foreach ($files as $file) {
200199
if (is_file($file)) {
201-
$file = new SplFileInfo($file);
200+
$file = new SplFileInfo($file, $file, $file);
202201
}
203202

204203
if (!($file instanceof SplFileInfo)) {
205204
throw new InvalidArgumentException("File $file not exists.");
206205
}
207206

208-
$file = new SplFileInfo($file);
209207
$this->files[$file->getRealPath()] = $file;
210208
}
211209

0 commit comments

Comments
 (0)