| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 4 | public function parseProviderReference($value): string |
|
| 17 | { |
||
| 18 | 4 | if (strpos($value, 'vimeo.com')) { |
|
| 19 | 4 | $urlParts = explode('/', parse_url($value, PHP_URL_PATH)); |
|
| 20 | 4 | foreach ($urlParts as $urlPart) { |
|
| 21 | 4 | if (ctype_digit($urlPart)) { |
|
| 22 | 4 | return $urlPart; |
|
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | 2 | throw new InvalidProviderUrlException('Vimeo'); |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | return $value; |
|
| 30 | } |
||
| 31 | |||
| 65 |