-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php70] Handle crash on First class callable on ThisCallOnStaticMetho…
…dToStaticCallRector (#3003)
- Loading branch information
1 parent
71ffc80
commit e4ec1f9
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...odCall/ThisCallOnStaticMethodToStaticCallRector/Fixture/skip_first_class_callable.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector\Fixture; | ||
|
||
final class SkipFirstClassCallable | ||
{ | ||
public function getFunctions(): array | ||
{ | ||
return [ | ||
new TwigFunction('top_level_domain', $this->topLevelDomain(...)), | ||
]; | ||
} | ||
|
||
public static function topLevelDomain(?string $host = null): string | ||
{ | ||
if (null === $host) { | ||
$host = $_SERVER['HTTP_HOST']; | ||
} | ||
|
||
$urlPieces = explode('.', (string) $host); | ||
|
||
return end($urlPieces); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters