| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 54 | public function getHash() { |
||
| 55 | $data = $this->getData(); |
||
| 56 | if ( is_object( $data ) ) { |
||
| 57 | if ( method_exists( $data, 'getHash' ) ) { |
||
| 58 | return $data->getHash(); |
||
| 59 | } else { |
||
| 60 | return sha1( serialize( $data ) ); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | if ( is_string( $data ) ) { |
||
| 64 | return sha1( $data ); |
||
| 65 | } |
||
| 66 | throw new LogicException( "Cant get hash for data of type: " . gettype( $data ) ); |
||
| 67 | } |
||
| 68 | |||
| 86 |