Skip to content

Commit 3e5f758

Browse files
committed
4268: Cleaned up
1 parent be5923d commit 3e5f758

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Taskfile.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ tasks:
167167
COMPOSE_ARGS: run --rm prettier {{.YAML_FILES_GLOB}} --check
168168
silent: true
169169

170+
code-analysis:
171+
desc: "Run code analysis"
172+
cmds:
173+
- task: compose
174+
vars:
175+
COMPOSE_ARGS: exec phpfpm vendor/bin/psalm --no-cache
176+
silent: true
177+
170178
default:
171179
cmds:
172180
- task --list

src/Fixtures/FixtureLoader.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
use Elastic\Elasticsearch\Exception\MissingParameterException;
99
use Elastic\Elasticsearch\Exception\ServerResponseException;
1010
use Symfony\Component\HttpFoundation\Response;
11-
use Symfony\Component\HttpKernel\Exception\HttpException;
12-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1311
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
1412
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
1513
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
@@ -60,19 +58,19 @@ public function process(string $indexName, string $url): void
6058
* @throws RedirectionExceptionInterface
6159
* @throws ServerExceptionInterface
6260
* @throws TransportExceptionInterface
63-
* @throws HttpException
61+
* @throws \HttpException
6462
*/
6563
private function download(string $url): array
6664
{
6765
// Load from local file if using "file" URL scheme.
6866
if (preg_match('~^file://(?<path>/.+)$~', $url, $matches)) {
6967
$path = $matches['path'];
7068
if (!is_readable($path)) {
71-
throw new NotFoundHttpException('Unable to download fixture data');
69+
throw new \HttpException('Unable to load fixture data');
7270
}
7371
$data = json_decode(file_get_contents($path), true);
7472
if (empty($data)) {
75-
throw new NotFoundHttpException('Unable to download fixture data');
73+
throw new \HttpException('Unable to load fixture data');
7674
}
7775

7876
return $data;
@@ -81,7 +79,7 @@ private function download(string $url): array
8179
$response = $this->httpClient->request('GET', $url);
8280

8381
if (Response::HTTP_OK !== $response->getStatusCode()) {
84-
throw new NotFoundHttpException('Unable to download fixture data');
82+
throw new \HttpException('Unable to download fixture data');
8583
}
8684

8785
return $response->toArray();

0 commit comments

Comments
 (0)