| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | function is_app(...$identifiers) |
||
| 11 | { |
||
| 12 | 1 | $currentUrl = app('request')->getUri(); |
|
| 13 | |||
| 14 | 1 | foreach ($identifiers as $identifier) { |
|
| 15 | 1 | if ($url = config("apps.url.$identifier")) { |
|
| 16 | 1 | $url = preg_replace('#^https?://#', '', $url); |
|
| 17 | 1 | $pattern = '#^https?://'.preg_quote($url, '#').'([\?/].*)?$#'; |
|
| 18 | 1 | if (preg_match($pattern, $currentUrl)) { |
|
| 19 | 1 | return true; |
|
| 20 | } |
||
| 21 | } |
||
| 22 | } |
||
| 23 | |||
| 24 | 1 | return false; |
|
| 25 | } |
||
| 54 |