Skip to content

Commit

Permalink
Merge pull request #5 from cmgmyr/rm-version-dep
Browse files Browse the repository at this point in the history
rm use of version dependency
  • Loading branch information
cmgmyr authored Aug 5, 2023
2 parents 35e3080 + 5d67f3c commit 10ef0b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"ext-dom": "*",
"ext-json": "*",
"sebastian/cli-parser": "^1.0|^2.0",
"sebastian/version": "^3.0|^4.0",
"phpunit/php-file-iterator": "^3.0|^4.0"
},
"require-dev": {
Expand Down
20 changes: 12 additions & 8 deletions src/CLI/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Cmgmyr\PHPLOC\Log\Text as TextPrinter;
use Cmgmyr\PHPLOC\Log\Xml as XmlPrinter;
use SebastianBergmann\FileIterator\Facade;
use SebastianBergmann\Version;

final class Application
{
Expand Down Expand Up @@ -46,12 +45,17 @@ public function run(array $argv): int
return 0;
}

$files = (new Facade)->getFilesAsArray(
$arguments->directories(),
$arguments->suffixes(),
'',
$arguments->exclude()
);
$files = [];

foreach ($arguments->directories() as $directory) {
$newFiles = (new Facade)->getFilesAsArray(
$directory,
$arguments->suffixes(),
'',
$arguments->exclude()
);
$files = $files + $newFiles;
}

if (empty($files)) {
print 'No files found to scan' . PHP_EOL;
Expand Down Expand Up @@ -88,7 +92,7 @@ private function printVersion(): void
{
printf(
'phploc %s by Chris Gmyr.' . PHP_EOL,
(new Version(self::VERSION, dirname(__DIR__)))->getVersion()
self::VERSION
);
}

Expand Down

0 comments on commit 10ef0b7

Please sign in to comment.