Page MenuHomeDevCentral

No OneTemporary

diff --git a/src/Registration/PSR4/Solver.php b/src/Registration/PSR4/Solver.php
index a3d98fa..d854071 100644
--- a/src/Registration/PSR4/Solver.php
+++ b/src/Registration/PSR4/Solver.php
@@ -1,66 +1,64 @@
<?php
declare(strict_types=1);
namespace Keruald\OmniTools\Registration\PSR4;
-use Keruald\OmniTools\Strings\Multibyte\StringUtilities;
-
final class Solver {
/**
* @var string
*/
private $namespace;
/**
* @var string The base path for the namespace
*/
private $path;
/**
* @var string The fully qualified class name
*/
private $class;
///
/// Constructors
///
public function __construct (string $namespace, string $path, string $class) {
$this->namespace = $namespace;
$this->path = $path;
$this->class = $class;
}
///
/// Resolve methods
///
public function resolve () : string {
return $this->path
. '/'
. $this->getRelativePath();
}
public function canResolve () : bool {
- return StringUtilities::startsWith($this->class, $this->namespace);
+ return str_starts_with($this->class, $this->namespace);
}
public static function getPathFor (string $name) : string {
return str_replace("\\", "/", $name) . '.php';
}
///
/// Helper methods
///
private function getRelativePath () : string {
return self::getPathFor($this->getLocalClassName());
}
private function getLocalClassName () : string {
$len = strlen($this->namespace);
return substr($this->class, $len);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 18, 02:07 (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2984597
Default Alt Text
(1 KB)

Event Timeline