| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php namespace Propaganistas\LaravelPhone\Traits; |
||
| 33 | 63 | protected static function parseFormat($format) |
|
| 34 | { |
||
| 35 | 63 | static::loadFormats(); |
|
| 36 | |||
| 37 | // If the format equals a constant's value, just return it. |
||
| 38 | 63 | if (in_array($format, static::$formats, true)) { |
|
| 39 | 60 | return $format; |
|
| 40 | } |
||
| 41 | |||
| 42 | // Otherwise we'll assume the format is the constant's name. |
||
| 43 | 9 | return Arr::get(static::$formats, strtoupper($format)); |
|
| 44 | } |
||
| 45 | |||
| 55 | } |