Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3767565
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/Registration/PSR4/Autoloader.php b/src/Registration/PSR4/Autoloader.php
index fee7515..641dbe9 100644
--- a/src/Registration/PSR4/Autoloader.php
+++ b/src/Registration/PSR4/Autoloader.php
@@ -1,55 +1,53 @@
<?php
declare(strict_types=1);
namespace Keruald\OmniTools\Registration\PSR4;
use Keruald\OmniTools\Reflection\CodeFile;
final class Autoloader {
///
/// Private members
///
/**
* @var string
*/
private $namespace;
/**
* @var string The base path where files for this namespace are located
*/
private $path;
///
/// Constructor
///
public function __construct (string $namespace, string $path) {
$this->namespace = $namespace;
$this->path = $path;
}
///
/// Public methods
///
public function getSolver (string $class) : Solver {
return new Solver($this->namespace, $this->path, $class);
}
public function register () : void {
- $loader = $this;
-
- spl_autoload_register(function ($class) use ($loader) {
- $solver = $loader->getSolver($class);
+ spl_autoload_register(function ($class) {
+ $solver = $this->getSolver($class);
if (!$solver->canResolve()) {
return;
}
CodeFile::from($solver->resolve())->tryInclude();
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 01:23 (17 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259324
Default Alt Text
(1 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment