| 1 | <?php |
||
| 13 | class StringQuerySerializer implements DispatchableSerializer { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @see DispatchableSerializer::isSerializerFor |
||
| 17 | */ |
||
| 18 | 8 | public function isSerializerFor( $object ) { |
|
| 21 | |||
| 22 | /** |
||
| 23 | * @see Serializer::serialize |
||
| 24 | */ |
||
| 25 | 4 | public function serialize( $object ) { |
|
| 26 | 4 | if ( !$this->isSerializerFor( $object ) ) { |
|
| 27 | 3 | throw new UnsupportedObjectException( |
|
| 28 | 3 | $object, |
|
| 29 | 'StringQuerySerializer can only serialize StringQuery objects' |
||
| 30 | 3 | ); |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | return $this->getSerialized( $object ); |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | private function getSerialized( StringQuery $query ) { |
|
| 39 | } |
||
| 40 |