| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | { |
||
| 36 | 1 | app()->forgetInstance(static::IDENTIFIER_KEY); |
|
| 37 | 1 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Get application identifier for the given URL. |
||
| 41 | * |
||
| 42 | * @param string $url |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 1 | protected static function getForUrl($url) |
|
| 46 | { |
||
| 47 | 1 | $identifier = null; |
|
| 48 | |||
| 49 | 1 | foreach (config('apps.url') as $id => $root) { |
|
| 50 | 1 | $root = preg_replace('#^https?://#', '', $root); |
|
| 51 | 1 | $pattern = '#^https?://'.preg_quote($root, '#').'([\?/].*)?$#'; |
|
| 52 | 1 | if (preg_match($pattern, $url)) { |
|
| 64 |