| Conditions | 4 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function testSerializable() |
||
| 23 | { |
||
| 24 | if ($this instanceof \Serializable) { |
||
| 25 | echo get_class($this), ' implements `Serializable` interface now!', PHP_EOL; |
||
| 26 | $reflection = new \ReflectionObject($this); |
||
| 27 | echo "List of interfaces:", PHP_EOL; |
||
| 28 | foreach ($reflection->getInterfaceNames() as $interfaceName) { |
||
| 29 | echo '-> ', $interfaceName, PHP_EOL; |
||
| 30 | } |
||
| 31 | echo "List of traits:", PHP_EOL; |
||
| 32 | foreach ($reflection->getTraitNames() as $traitName) { |
||
| 33 | echo '-> ', $traitName, PHP_EOL; |
||
| 34 | } |
||
| 35 | } else { |
||
| 36 | echo get_class($this), ' does not implement `Serializable` interface', PHP_EOL; |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 |