| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public static function fromContent(string $content): self |
||
| 25 | { |
||
| 26 | $target = new static(); |
||
| 27 | $target->content = $content; |
||
| 28 | |||
| 29 | if ( |
||
| 30 | stripos($content, 'Phar::mapPhar(') !== false |
||
| 31 | && preg_match('#Phar\:\:mapPhar\(([^)]+)\)#', $content, $matches) |
||
| 32 | ) { |
||
| 33 | // remove spaces, single & double quotes |
||
| 34 | // @todo `'my' . 'alias' . '.phar'` is not evaluated here |
||
| 35 | $target->mappedAlias = trim($matches[1], ' \'"'); |
||
| 36 | } |
||
| 37 | |||
| 38 | return $target; |
||
| 39 | } |
||
| 67 |