@@ -163,10 +163,10 @@ private function loadComposerAutoloader(Modules $modules): void
163163 public function register ()
164164 {
165165 // Register classmap loader for the files in our class map.
166- spl_autoload_register ([ $ this , ' loadClassmap ' ] , true );
166+ spl_autoload_register ($ this -> loadClassmap (...) , true );
167167
168168 // Register the PSR-4 autoloader.
169- spl_autoload_register ([ $ this , ' loadClass ' ] , true );
169+ spl_autoload_register ($ this -> loadClass (...) , true );
170170
171171 // Load our non-class files
172172 foreach ($ this ->files as $ file ) {
@@ -181,8 +181,8 @@ public function register()
181181 */
182182 public function unregister (): void
183183 {
184- spl_autoload_unregister ([ $ this , ' loadClass ' ] );
185- spl_autoload_unregister ([ $ this , ' loadClassmap ' ] );
184+ spl_autoload_unregister ($ this -> loadClass (...) );
185+ spl_autoload_unregister ($ this -> loadClassmap (...) );
186186 }
187187
188188 /**
@@ -281,12 +281,12 @@ public function loadClass(string $class): void
281281 */
282282 protected function loadInNamespace (string $ class )
283283 {
284- if (strpos ($ class , '\\' ) === false ) {
284+ if (! str_contains ($ class , '\\' )) {
285285 return false ;
286286 }
287287
288288 foreach ($ this ->prefixes as $ namespace => $ directories ) {
289- if (strpos ($ class , $ namespace ) === 0 ) {
289+ if (str_starts_with ($ class , $ namespace )) {
290290 $ relativeClassPath = str_replace ('\\' , DIRECTORY_SEPARATOR , substr ($ class , strlen ($ namespace )));
291291
292292 foreach ($ directories as $ directory ) {
@@ -425,7 +425,7 @@ private function loadComposerNamespaces(ClassLoader $composer, array $composerPa
425425
426426 foreach ($ srcPaths as $ path ) {
427427 foreach ($ installPaths as $ installPath ) {
428- if ($ installPath === substr ($ path , 0 , strlen ( $ installPath) )) {
428+ if (str_starts_with ($ path , $ installPath )) {
429429 $ add = true ;
430430 break 2 ;
431431 }
0 commit comments