Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
49 | public function load(string $uri): \stdClass |
||
50 | { |
||
51 | $response = $this->reader->read($uri); |
||
52 | |||
53 | foreach ($this->parsers as $parser) { |
||
54 | if (!$parser->canParse($response->getContentType())) { |
||
55 | continue; |
||
56 | } |
||
57 | |||
58 | return $parser->parse($response->getContent()); |
||
59 | } |
||
60 | |||
61 | throw new ResourceNotParsableException("No parser for response of '$uri''"); |
||
62 | } |
||
63 | } |
||
64 |