diff --git a/src/Laravel/Eloquent/Filter/DateFilter.php b/src/Laravel/Eloquent/Filter/DateFilter.php index 67665dce87f..29903f50d44 100644 --- a/src/Laravel/Eloquent/Filter/DateFilter.php +++ b/src/Laravel/Eloquent/Filter/DateFilter.php @@ -84,7 +84,10 @@ public function getSchema(Parameter $parameter): array return ['type' => 'date']; } - public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null + /** + * @return OpenApiParameter[] + */ + public function getOpenApiParameters(Parameter $parameter): array { $in = $parameter instanceof QueryParameter ? 'query' : 'header'; $key = $parameter->getKey(); diff --git a/src/Laravel/Eloquent/Filter/OrFilter.php b/src/Laravel/Eloquent/Filter/OrFilter.php index 6c9e7f833b2..609608cb929 100644 --- a/src/Laravel/Eloquent/Filter/OrFilter.php +++ b/src/Laravel/Eloquent/Filter/OrFilter.php @@ -49,7 +49,7 @@ public function getSchema(Parameter $parameter): array return ['type' => 'array', 'items' => $schema]; } - public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null + public function getOpenApiParameters(Parameter $parameter): OpenApiParameter { return new OpenApiParameter(name: $parameter->getKey().'[]', in: 'query', style: 'deepObject', explode: true); } diff --git a/src/Laravel/Eloquent/Filter/OrderFilter.php b/src/Laravel/Eloquent/Filter/OrderFilter.php index 90315f3d083..233356d48bb 100644 --- a/src/Laravel/Eloquent/Filter/OrderFilter.php +++ b/src/Laravel/Eloquent/Filter/OrderFilter.php @@ -54,7 +54,10 @@ public function getSchema(Parameter $parameter): array return ['type' => 'string', 'enum' => ['asc', 'desc']]; } - public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null + /** + * @return OpenApiParameter[]|null + */ + public function getOpenApiParameters(Parameter $parameter): ?array { if (str_contains($parameter->getKey(), ':property')) { $parameters = []; diff --git a/src/Laravel/Eloquent/Filter/RangeFilter.php b/src/Laravel/Eloquent/Filter/RangeFilter.php index 82f7e4457ec..bb86f7dc78f 100644 --- a/src/Laravel/Eloquent/Filter/RangeFilter.php +++ b/src/Laravel/Eloquent/Filter/RangeFilter.php @@ -52,7 +52,10 @@ public function getSchema(Parameter $parameter): array return ['type' => 'number']; } - public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null + /** + * @return OpenApiParameter[] + */ + public function getOpenApiParameters(Parameter $parameter): array { $in = $parameter instanceof QueryParameter ? 'query' : 'header'; $key = $parameter->getKey(); diff --git a/src/Laravel/Eloquent/Paginator.php b/src/Laravel/Eloquent/Paginator.php index 77784ce6c70..feabdf2eaac 100644 --- a/src/Laravel/Eloquent/Paginator.php +++ b/src/Laravel/Eloquent/Paginator.php @@ -34,7 +34,7 @@ public function __construct( public function count(): int { - return $this->paginator->count(); + return $this->paginator->count(); // @phpstan-ignore-line } public function getLastPage(): float diff --git a/src/Laravel/Eloquent/PartialPaginator.php b/src/Laravel/Eloquent/PartialPaginator.php index e8dd57aae8f..e193d9cfc64 100644 --- a/src/Laravel/Eloquent/PartialPaginator.php +++ b/src/Laravel/Eloquent/PartialPaginator.php @@ -33,7 +33,7 @@ public function __construct( public function count(): int { - return $this->paginator->count(); + return $this->paginator->count(); // @phpstan-ignore-line } public function getCurrentPage(): float diff --git a/src/Laravel/Routing/IriConverter.php b/src/Laravel/Routing/IriConverter.php index cc9ab93a49a..ad1e6f1b78b 100644 --- a/src/Laravel/Routing/IriConverter.php +++ b/src/Laravel/Routing/IriConverter.php @@ -159,7 +159,7 @@ private function generateRoute(object|string $resource, int $referenceType = Url if (\is_object($resource)) { try { $identifiers = $this->identifiersExtractor->getIdentifiersFromItem($resource, $identifiersExtractorOperation, $context); - } catch (InvalidArgumentException|RuntimeException $e) { + } catch (RuntimeException $e) { // We can try using context uri variables if any if (!$identifiers) { throw new InvalidArgumentException(\sprintf('Unable to generate an IRI for the item of type "%s"', $operation->getClass()), $e->getCode(), $e); diff --git a/src/Laravel/Routing/SkolemIriConverter.php b/src/Laravel/Routing/SkolemIriConverter.php index 6aa7f16f6c2..fcb67798536 100644 --- a/src/Laravel/Routing/SkolemIriConverter.php +++ b/src/Laravel/Routing/SkolemIriConverter.php @@ -53,7 +53,7 @@ public function getResourceFromIri(string $iri, array $context = [], ?Operation /** * {@inheritdoc} */ - public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): ?string + public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): string { $referenceType = $operation ? ($operation->getUrlGenerationStrategy() ?? $referenceType) : $referenceType; if (($isObject = \is_object($resource)) && $this->objectHashMap->contains($resource)) { diff --git a/src/Laravel/Tests/Console/Maker/MakeStateProcessorCommandTest.php b/src/Laravel/Tests/Console/Maker/MakeStateProcessorCommandTest.php index c51b5de1fc9..fcb05239fce 100644 --- a/src/Laravel/Tests/Console/Maker/MakeStateProcessorCommandTest.php +++ b/src/Laravel/Tests/Console/Maker/MakeStateProcessorCommandTest.php @@ -30,7 +30,7 @@ class MakeStateProcessorCommandTest extends TestCase /** @var string */ private const CHOSEN_CLASS_NAME = 'Choose a class name for your state processor (e.g. AwesomeStateProcessor)'; - private ?Filesystem $filesystem; + private Filesystem $filesystem; private PathResolver $pathResolver; private AppServiceFileGenerator $appServiceFileGenerator; diff --git a/src/Laravel/Tests/Console/Maker/MakeStateProviderCommandTest.php b/src/Laravel/Tests/Console/Maker/MakeStateProviderCommandTest.php index c259c79fa39..f7d8c8e8e5b 100644 --- a/src/Laravel/Tests/Console/Maker/MakeStateProviderCommandTest.php +++ b/src/Laravel/Tests/Console/Maker/MakeStateProviderCommandTest.php @@ -30,7 +30,7 @@ class MakeStateProviderCommandTest extends TestCase /** @var string */ private const STATE_PROVIDER_CLASS_NAME = 'Choose a class name for your state provider (e.g. AwesomeStateProvider)'; - private ?Filesystem $filesystem; + private Filesystem $filesystem; private PathResolver $pathResolver; private AppServiceFileGenerator $appServiceFileGenerator;