Skip to content

Commit f15681f

Browse files
committed
Merge 4.1
2 parents f2471c3 + fd937ca commit f15681f

15 files changed

+55
-25
lines changed

Eloquent/Filter/DateFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ public function getSchema(Parameter $parameter): array
8484
return ['type' => 'date'];
8585
}
8686

87-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
87+
/**
88+
* @return OpenApiParameter[]
89+
*/
90+
public function getOpenApiParameters(Parameter $parameter): array
8891
{
8992
$in = $parameter instanceof QueryParameter ? 'query' : 'header';
9093
$key = $parameter->getKey();

Eloquent/Filter/OrFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getSchema(Parameter $parameter): array
4949
return ['type' => 'array', 'items' => $schema];
5050
}
5151

52-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
52+
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter
5353
{
5454
return new OpenApiParameter(name: $parameter->getKey().'[]', in: 'query', style: 'deepObject', explode: true);
5555
}

Eloquent/Filter/OrderFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public function getSchema(Parameter $parameter): array
5454
return ['type' => 'string', 'enum' => ['asc', 'desc']];
5555
}
5656

57-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
57+
/**
58+
* @return OpenApiParameter[]|null
59+
*/
60+
public function getOpenApiParameters(Parameter $parameter): ?array
5861
{
5962
if (str_contains($parameter->getKey(), ':property')) {
6063
$parameters = [];

Eloquent/Filter/RangeFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public function getSchema(Parameter $parameter): array
5252
return ['type' => 'number'];
5353
}
5454

55-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
55+
/**
56+
* @return OpenApiParameter[]
57+
*/
58+
public function getOpenApiParameters(Parameter $parameter): array
5659
{
5760
$in = $parameter instanceof QueryParameter ? 'query' : 'header';
5861
$key = $parameter->getKey();

Eloquent/Metadata/Factory/Property/EloquentPropertyMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function create(string $resourceClass, string $property, array $options =
8888

8989
return $propertyMetadata
9090
->withBuiltinTypes([$type])
91-
->withWritable($propertyMetadata->isWritable() ?? true)
91+
->withWritable($propertyMetadata->isWritable() ?? true === $p['fillable'])
9292
->withReadable($propertyMetadata->isReadable() ?? false === $p['hidden']);
9393
}
9494

Eloquent/Paginator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434

3535
public function count(): int
3636
{
37-
return $this->paginator->count();
37+
return $this->paginator->count(); // @phpstan-ignore-line
3838
}
3939

4040
public function getLastPage(): float

Eloquent/PartialPaginator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333

3434
public function count(): int
3535
{
36-
return $this->paginator->count();
36+
return $this->paginator->count(); // @phpstan-ignore-line
3737
}
3838

3939
public function getCurrentPage(): float

Routing/IriConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private function generateRoute(object|string $resource, int $referenceType = Url
159159
if (\is_object($resource)) {
160160
try {
161161
$identifiers = $this->identifiersExtractor->getIdentifiersFromItem($resource, $identifiersExtractorOperation, $context);
162-
} catch (InvalidArgumentException|RuntimeException $e) {
162+
} catch (RuntimeException $e) {
163163
// We can try using context uri variables if any
164164
if (!$identifiers) {
165165
throw new InvalidArgumentException(\sprintf('Unable to generate an IRI for the item of type "%s"', $operation->getClass()), $e->getCode(), $e);

Routing/SkolemIriConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getResourceFromIri(string $iri, array $context = [], ?Operation
5353
/**
5454
* {@inheritdoc}
5555
*/
56-
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): ?string
56+
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): string
5757
{
5858
$referenceType = $operation ? ($operation->getUrlGenerationStrategy() ?? $referenceType) : $referenceType;
5959
if (($isObject = \is_object($resource)) && $this->objectHashMap->contains($resource)) {

Tests/Console/Maker/MakeStateProcessorCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MakeStateProcessorCommandTest extends TestCase
3030
/** @var string */
3131
private const CHOSEN_CLASS_NAME = 'Choose a class name for your state processor (e.g. <fg=yellow>AwesomeStateProcessor</>)';
3232

33-
private ?Filesystem $filesystem;
33+
private Filesystem $filesystem;
3434
private PathResolver $pathResolver;
3535
private AppServiceFileGenerator $appServiceFileGenerator;
3636

0 commit comments

Comments
 (0)