We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
30 | 52 | public static function shortenClassFromCode($code, callable $callback = null) |
|
31 | { |
||
32 | 52 | if (null === $code) { |
|
33 | 2 | return ''; |
|
34 | } |
||
35 | |||
36 | 51 | if (null === $callback) { |
|
37 | $callback = function ($matches) { |
||
38 | 2 | return static::shortenClassName($matches[1]); |
|
39 | 2 | }; |
|
40 | } |
||
41 | |||
42 | 51 | $codeParsed = \preg_replace_callback('@((?:\\\\{1,2}\w+|\w+\\\\{1,2})(?:\w+\\\\{0,2})+)@', $callback, $code); |
|
43 | |||
44 | 51 | return $codeParsed; |
|
45 | } |
||
52 |