diff --git a/src/PossibleRoot.php b/src/PossibleRoot.php index 1a94aab..cd0b69d 100644 --- a/src/PossibleRoot.php +++ b/src/PossibleRoot.php @@ -70,7 +70,7 @@ public static function getPossibleRootDirectory() if (class_exists(ClassLoader::class)) { if (class_exists(InstalledVersions::class)) { - $package = InstalledVersions::getRootPackage()['install_path']??null; + $package = InstalledVersions::getRootPackage()['install_path']?:null; $package = is_string($package) ? realpath($package) : null; if ($package && is_dir($package)) { $root = $package; @@ -102,14 +102,15 @@ public static function getPossibleRootDirectory() && is_string(TD_APP_DIRECTORY) && dirname(TD_APP_DIRECTORY) . '/vendor' ) { + $exists = false; $v = TD_APP_DIRECTORY; $c = 3; do { $v = dirname($v); } while (--$c > 0 && !($exists = file_exists($v . '/composer.json'))); - $root = ($exists??false) ? $v : dirname(TD_APP_DIRECTORY); + $root = $exists ? $v : dirname(TD_APP_DIRECTORY); $composerJson = "$root/composer.json"; - $composerJson = realpath($composerJson)??$composerJson; + $composerJson = realpath($composerJson)?:$composerJson; if (isset(self::$composerJsonConfig[$composerJson])) { $root = self::$composerJsonConfig[$composerJson]; } else {