| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | function hexrgb($hex) { |
||
| 26 | $hex = preg_replace("/[^0-9A-Fa-f]/", '', $hex); |
||
| 27 | |||
| 28 | $strlenHex = strlen($hex); |
||
| 29 | |||
| 30 | if($strlenHex >= 3) { |
||
| 31 | if($strlenHex >= 6) { |
||
| 32 | if($strlenHex > 6) { |
||
| 33 | $hex = substr($hex,0,6); |
||
| 34 | } |
||
| 35 | $hexArray = str_split($hex,2); |
||
| 36 | } elseif($strlenHex < 6) { |
||
| 37 | $hexArray = array("$hex[0]$hex[0]", "$hex[1]$hex[1]", "$hex[2]$hex[2]"); |
||
| 38 | } |
||
| 39 | return array(hexdec($hexArray[0]), hexdec($hexArray[1]), hexdec($hexArray[2])); |
||
| 40 | } |
||
| 41 | |||
| 42 | return NULL; |
||
| 43 | } |
||
| 44 | /** |
||
| 63 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.