@@ -30,20 +30,19 @@ public function getName(): string
3030
3131 public function resolve (Environment $ environment , string $ data ): ResolvedReference
3232 {
33- $ className = explode (':: ' , $ data )[0 ];
34- $ className = str_replace ('\\\\' , '\\' , $ className );
35-
36- if (!u ($ data )->containsAny (':: ' )) {
33+ $ data = u ($ data );
34+ if (!$ data ->containsAny (':: ' )) {
3735 throw new \RuntimeException (sprintf ('Malformed method reference "%s" in file "%s" ' , $ data , $ environment ->getCurrentFileName ()));
3836 }
3937
40- $ methodName = explode (':: ' , $ data )[1 ];
38+ [$ className , $ methodName ] = $ data ->split (':: ' , 2 );
39+ $ className = $ className ->replace ('\\\\' , '\\' );
4140
4241 $ scrollTextFragment = sprintf ('#:~:text=%s ' , rawurlencode ('function ' .$ methodName ));
4342 return new ResolvedReference (
4443 $ environment ->getCurrentFileName (),
4544 $ methodName .'() ' ,
46- sprintf ('%s/%s.php%s ' , $ this ->symfonyRepositoryUrl , str_replace ('\\' , '/ ' , $ className ), $ scrollTextFragment ),
45+ sprintf ('%s/%s.php%s ' , $ this ->symfonyRepositoryUrl , $ className -> replace ('\\' , '/ ' ), $ scrollTextFragment ),
4746 [],
4847 [
4948 'title ' => sprintf ('%s::%s() ' , $ className , $ methodName ),
0 commit comments