Page MenuHomeDevCentral

No OneTemporary

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

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)

Event Timeline