Skip to content

Commit 08e4ed2

Browse files
committed
Check for DS / PS already set
- see phpstan/phpstan#6744
1 parent ddb0149 commit 08e4ed2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/Mage.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1515
*/
1616

17-
define('DS', DIRECTORY_SEPARATOR);
18-
define('PS', PATH_SEPARATOR);
17+
defined('DS') || define('DS', DIRECTORY_SEPARATOR);
18+
defined('PS') || define('PS', PATH_SEPARATOR);
19+
1920
define('BP', dirname(__DIR__));
2021

2122
Mage::register('original_include_path', get_include_path());
@@ -278,7 +279,7 @@ public static function register($key, $value, $graceful = false)
278279
if ($graceful) {
279280
return;
280281
}
281-
self::throwException('Mage registry key "' . $key . '" already exists');
282+
self::throwException("Mage registry key $key already exists");
282283
}
283284
self::$_registry[$key] = $value;
284285
}
@@ -331,7 +332,7 @@ public static function setRoot($appRoot = '')
331332
if (is_dir($appRoot) && is_readable($appRoot)) {
332333
self::$_appRoot = $appRoot;
333334
} else {
334-
self::throwException($appRoot . ' is not a directory or not readable by this user');
335+
self::throwException("$appRoot is not a directory or not readable by this user");
335336
}
336337
}
337338

0 commit comments

Comments
 (0)