| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 14 | public static function encode($mixed) |
||
| 15 | { |
||
| 16 | if (is_numeric($mixed)) { |
||
| 17 | return self::encodeInteger($mixed); |
||
| 18 | } |
||
| 19 | if (is_array($mixed)) { |
||
| 20 | return self::encodeArray($mixed); |
||
| 21 | } |
||
| 22 | if (is_string($mixed) || is_null($mixed)) { |
||
| 23 | return self::encodeString((string) $mixed); |
||
| 24 | } |
||
| 25 | |||
| 26 | throw new InvalidArgumentException('Variables of type ' . gettype($mixed) . ' can not be encoded.'); |
||
| 27 | } |
||
| 28 | |||
| 70 | } |