Skip to content

Commit 6a127fc

Browse files
committed
chore: phpstan and deprecations
1 parent b788c78 commit 6a127fc

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

features/main/not_exposed.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ Feature: Expose only a collection of objects
171171
When I send a "GET" request to "<uri>"
172172
Then the response status code should be 404
173173
And the response should be in JSON
174-
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
175174
And the JSON node "hydra:description" should be equal to "<hydra:description>"
176175
Examples:
177176
| uri | hydra:description |

src/ApiResource/Error.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public function __construct(
6565
private ?string $instance = null,
6666
private string $type = 'about:blank',
6767
private array $headers = [],
68-
private ?\Exception $previous = null
68+
\Throwable $previous = null
6969
) {
70-
parent::__construct();
70+
parent::__construct($title, $status, $previous);
7171

7272
if (!$originalTrace) {
7373
return;

src/Symfony/EventListener/ErrorListener.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ protected function duplicateRequest(\Throwable $exception, Request $request): Re
142142
$operation = $operation->withProvider([self::class, 'provide']);
143143
}
144144

145-
if (!$this->debug && $operation->getStatus() >= 500) {
145+
/** @var HttpOperation $operation */
146+
if (!$this->debug && $operation->getStatus() >= 500 && $errorResource instanceof Error) {
146147
$errorResource->setDetail('Internal Server Error');
147148
}
148149

@@ -159,7 +160,7 @@ protected function duplicateRequest(\Throwable $exception, Request $request): Re
159160
]);
160161
}
161162

162-
if ($apiOperation && 'jsonld' === $format && !($apiOperation?->getExtraProperties()['rfc_7807_compliant_errors'] ?? false)) {
163+
if ($apiOperation && 'jsonld' === $format && !($apiOperation->getExtraProperties()['rfc_7807_compliant_errors'] ?? false)) {
163164
$operation = $operation->withOutputFormats(['jsonld' => ['application/ld+json']])
164165
->withLinks([])
165166
->withExtraProperties(['rfc_7807_compliant_errors' => false] + $operation->getExtraProperties());

tests/Fixtures/TestBundle/Serializer/ErrorNormalizer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function hasCacheableSupportsMethod(): bool
4646

4747
public function getSupportedTypes(?string $format): array
4848
{
49-
// @phpstan-ignore-next-line
5049
return $this->decorated->getSupportedTypes($format);
5150
}
5251
}

tests/Fixtures/app/AppKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [
248248
$c->prependExtensionConfig('doctrine', [
249249
'orm' => [
250250
'report_fields_where_declared' => true,
251+
'enable_lazy_ghost_objects' => true,
251252
],
252253
]);
253254
}

0 commit comments

Comments
 (0)