mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
stricter cs
This commit is contained in:
parent
309ae17036
commit
d9a843ecd6
54 changed files with 346 additions and 168 deletions
|
|
@ -1,4 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Demostf\API\Demo;
|
||||
|
||||
|
|
@ -6,7 +8,7 @@ use GuzzleHttp\Client;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
|
||||
/**
|
||||
* Wrapper around demo.js parser
|
||||
* Wrapper around demo.js parser.
|
||||
*
|
||||
* Doesn't do any post-processing on the result
|
||||
*/
|
||||
|
|
@ -22,10 +24,10 @@ class RawParser {
|
|||
try {
|
||||
$client = new Client();
|
||||
$response = $client->post($this->parserUrl, [
|
||||
'body' => fopen($path, 'r')
|
||||
'body' => fopen($path, 'r'),
|
||||
]);
|
||||
$result = json_decode($response->getBody()->getContents(), true);
|
||||
if (is_null($result)) {
|
||||
if (null === $result) {
|
||||
throw new \Exception('Failed to parse demo, unexpected result from parser');
|
||||
} else {
|
||||
return $result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue