不要な成否判定の削除

ref: c0b76e5
This commit is contained in:
eai04191
2019-09-10 07:03:46 +09:00
parent fb6c1a0574
commit 033784bfc8
17 changed files with 257 additions and 335 deletions

View File

@@ -19,11 +19,7 @@ class OGPResolver implements Resolver, Parser
public function resolve(string $url): Metadata
{
$res = $this->client->get($url);
if ($res->getStatusCode() === 200) {
return $this->parse($res->getBody());
} else {
throw new \RuntimeException("{$res->getStatusCode()}: $url");
}
return $this->parse($res->getBody());
}
public function parse(string $html): Metadata