Skip to content

Commit

Permalink
chore(internal): relay on autoloading when not using preloading
Browse files Browse the repository at this point in the history
Signed-off-by: azjezz <azjezz@protonmail.com>
  • Loading branch information
azjezz committed Nov 13, 2021
1 parent 26dbdb9 commit 1e815fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions composer.json
Expand Up @@ -27,6 +27,9 @@
"php-standard-library/psalm-plugin": "^1.1.1"
},
"autoload": {
"psr-4": {
"Psl\\": "src/Psl"
},
"files": [
"src/bootstrap.php"
]
Expand Down
3 changes: 2 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/Psl/Internal/Loader.php
Expand Up @@ -694,11 +694,10 @@ private function __construct()

public static function bootstrap(): void
{
if (!function_exists(self::FUNCTIONS[0])) {
self::preload();
} elseif (!defined(self::CONSTANTS[0])) {
self::loadConstants();
}
self::loadConstants();
self::autoload(static function (): void {
self::loadFunctions();
});
}

public static function preload(): void
Expand Down

0 comments on commit 1e815fc

Please sign in to comment.