Total Complexity | 2 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | abstract class AbstractParser implements ParserInterface |
||
20 | { |
||
21 | /** |
||
22 | * Returns an opaque string representing the object. |
||
23 | * |
||
24 | * Note: Use of MD5 here is not cryptographically significant. |
||
25 | * |
||
26 | * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring |
||
27 | */ |
||
28 | 1 | public function __toString(): string |
|
29 | { |
||
30 | 1 | return \sprintf('<%s: resource %s>', \get_called_class(), \md5(\spl_object_hash($this))); |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * Reads the contents of the stream resource. |
||
35 | * |
||
36 | * @param StreamInterface $stream A PSR-7 `StreamInterface` which is typically returned by the |
||
37 | * `getBody()` method of a `ResponseInterface` class. |
||
38 | * |
||
39 | * @throws \RuntimeException |
||
40 | * |
||
41 | * @return string The raw contents of the steam resource. |
||
42 | */ |
||
43 | 1 | public function readStream(StreamInterface $stream): string |
|
46 | } |
||
47 | } |
||
48 |