Skip to content

Commit

Permalink
Merge pull request #15 from artemeon/cleanup
Browse files Browse the repository at this point in the history
Clean up and code styling
  • Loading branch information
marcreichel authored Feb 17, 2022
2 parents ec85368 + 00c3132 commit 87247e5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions mantis2github
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@

unset($GLOBALS['_composer_autoload_path']);
} else {
foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) {
foreach (
[
__DIR__ . '/../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/vendor/autoload.php'
] as $file
) {
if (file_exists($file)) {
define('COMPOSER_INSTALL_PATH', $file);

Expand All @@ -58,14 +64,22 @@
$name = $packageJson['name'] ?? null;
$this->name = explode('/', $name)[1] ?? null;

foreach ([__DIR__ . '/../../composer/installed.php', __DIR__ . '/../vendor/composer/installed.php', __DIR__ . '/vendor/composer/installed.php'] as $file) {
foreach (
[
__DIR__ . '/../../composer/installed.php',
__DIR__ . '/../vendor/composer/installed.php',
__DIR__ . '/vendor/composer/installed.php'
] as $file
) {
if (file_exists($file)) {
$installed = require $file;
$this->version = $installed['versions'][$name]['pretty_version'] ?? null;

break;
}
}

unset($file, $installed);
}
})->main();

Expand Down

0 comments on commit 87247e5

Please sign in to comment.