-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
…hen there is no access to the package directory.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,36 +44,39 @@ public function run(): void | |
|
||
$rootDirectory = $this->configuration->getRootDirectory(); | ||
|
||
if (is_dir($rootDirectory) && is_readable($rootDirectory) && is_writable($rootDirectory)) { | ||
|
||
$iterator = new \RecursiveIteratorIterator( | ||
new \RecursiveDirectoryIterator($rootDirectory), | ||
\RecursiveIteratorIterator::CHILD_FIRST, | ||
if (!is_dir($rootDirectory) || !is_readable($rootDirectory) || !is_writable($rootDirectory)) { | ||
Check warning on line 47 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 47 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 47 in src/Action.php GitHub Actions / mutation-tests (8.3)
|
||
throw new \Exception( | ||
\sprintf('Directory "%s" is not exists or is not readable or is not writable', $rootDirectory), | ||
); | ||
} | ||
|
||
$iterator = new \RecursiveIteratorIterator( | ||
new \RecursiveDirectoryIterator($rootDirectory), | ||
\RecursiveIteratorIterator::CHILD_FIRST, | ||
); | ||
|
||
foreach ($iterator as $path) { | ||
Check warning on line 58 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 58 in src/Action.php GitHub Actions / mutation-tests (8.3)
|
||
/** | ||
* @var \SplFileInfo $path | ||
*/ | ||
if ($path->getBasename() === '.gitignore') { | ||
$ignore->add( | ||
file_get_contents($path->getRealPath()), | ||
\dirname($path->getRealPath()) . '/', | ||
); | ||
} | ||
} | ||
|
||
foreach ($iterator as $path) { | ||
/** | ||
* @var \SplFileInfo $path | ||
*/ | ||
if ($path->getBasename() === '.gitignore') { | ||
$ignore->add( | ||
file_get_contents($path->getRealPath()), | ||
\dirname($path->getRealPath()) . '/', | ||
); | ||
} | ||
foreach ($iterator as $path) { | ||
/** | ||
* @var \SplFileInfo $path | ||
*/ | ||
if (!$path->isFile()) { | ||
continue; | ||
Check warning on line 75 in src/Action.php GitHub Actions / mutation-tests (8.3)
|
||
} | ||
|
||
foreach ($iterator as $path) { | ||
/** | ||
* @var \SplFileInfo $path | ||
*/ | ||
if (!$path->isFile()) { | ||
continue; | ||
} | ||
|
||
if (!$ignore->ignores($path->getPathname())) { | ||
$zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); | ||
} | ||
if (!$ignore->ignores($path->getPathname())) { | ||
$zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); | ||
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
Check warning on line 79 in src/Action.php GitHub Actions / mutation-tests (8.3)
|
||
} | ||
} | ||
|
||
|