mirror of
https://github.com/the-programmers-hangout/Mimic.git
synced 2026-09-04 01:06:00 +02:00
github actions take 1
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$directories = ['app', 'bootstrap', 'config', 'database'];
|
||||
|
||||
foreach ($directories as $directory) {
|
||||
if (! is_dir($directory)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS)
|
||||
);
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
if (! $file->isFile() || $file->getExtension() !== 'php') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$command = sprintf('php -l %s', escapeshellarg($file->getPathname()));
|
||||
passthru($command, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
exit($exitCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user