Skip to content

Commit a5864de

Browse files
patrickhoogkamertomasvanrijsse
authored andcommitted
feat: add laravel 10 support
1 parent f584bd0 commit a5864de

File tree

13 files changed

+15
-68
lines changed

13 files changed

+15
-68
lines changed

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
"php": ">=8.1",
1313
"ext-json": "*",
1414
"intermax/laravel-open-api": "^1.0",
15-
"laravel/framework": "^8.0 || ^9.0",
15+
"laravel/framework": "^8.0 || ^9.0 || ^10.0",
1616
"spatie/laravel-json-api-paginate": "^1.12",
1717
"spatie/laravel-query-builder": "^4.0 || ^5.0"
1818
},
1919
"require-dev": {
2020
"laravel/pint": "^1.1",
21-
"nunomaduro/collision": "^5.0 || ^6.1",
21+
"nunomaduro/collision": "^7.0",
22+
"phpunit/phpunit": "^9.0 || ^10.0",
2223
"nunomaduro/larastan": "^2.2",
23-
"orchestra/testbench": "^6.6 || ^7.0"
24+
"orchestra/testbench": "^6.6 || ^7.0 || ^8.0"
2425
},
2526
"autoload-dev": {
2627
"psr-4": {

phpunit.xml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
cacheResult="false"
7-
printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer"
8-
>
9-
<coverage processUncoveredFiles="true">
10-
<include>
11-
<directory suffix=".php">./src</directory>
12-
</include>
13-
</coverage>
14-
<testsuites>
15-
<testsuite name="Main">
16-
<directory>./tests</directory>
17-
</testsuite>
18-
</testsuites>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" cacheResult="false" cacheDirectory=".phpunit.cache">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">./src</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="Main">
10+
<directory>./tests</directory>
11+
</testsuite>
12+
</testsuites>
1913
</phpunit>

src/Exceptions/Handler.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ public function __construct(
2727
* Render an exception into an HTTP response.
2828
*
2929
* @param Request $request
30-
* @param Throwable $e
31-
* @return Response
3230
*
3331
* @throws Throwable
3432
*/
@@ -119,10 +117,7 @@ protected function renderDefaultException(Throwable $e, Request $request): Respo
119117
}
120118

121119
/**
122-
* @param Request $request
123120
* @param iterable<Error> $errors
124-
* @param int|string $statusCode
125-
* @return Response
126121
*/
127122
protected function renderException(Request $request, iterable $errors, int|string $statusCode): Response
128123
{

src/Exceptions/JsonApiException.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ class JsonApiException extends HttpException implements RenderableError
1919
protected ?iterable $errors;
2020

2121
/**
22-
* @param int $statusCode
23-
* @param string|null $message
24-
* @param Throwable|null $previous
25-
* @param int|null $code
2622
* @param iterable<Error>|null $errors
2723
*/
2824
public function __construct(

src/Filters/OperatorFilter.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ class OperatorFilter implements QueryBuilderFilter, Filter
4545
protected string $type;
4646

4747
/**
48-
* @param string $fieldName
49-
* @param string|null $columnName
50-
* @param string $type
5148
* @param array|string[]|null $allowedOperators
5249
*/
5350
public function __construct(
@@ -70,7 +67,6 @@ public function __construct(
7067
/**
7168
* @param Builder<Model> $query
7269
* @param mixed $value
73-
* @param string $property
7470
*/
7571
public function __invoke(Builder $query, $value, string $property): void
7672
{

src/Filters/ScopeFilter.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
class ScopeFilter implements Filter
1212
{
1313
/**
14-
* @param string $fieldName
15-
* @param string $type
1614
* @param array<int, string>|null $options
17-
* @param mixed|null $example
18-
* @param string|null $scopeName
1915
*/
2016
public function __construct(
2117
protected string $fieldName,

src/Includes/Contracts/Relation.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ interface Relation
1010
{
1111
/**
1212
* Make custom AllowedInclude with AllowedInclude::custom, otherwise use name of the relationship
13-
*
14-
* @return AllowedInclude|string
1513
*/
1614
public function allowedInclude(): AllowedInclude|string;
1715
}

src/Middleware/RenderJsonApiExceptions.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ public function __construct(
2323
/**
2424
* Handle an incoming request.
2525
*
26-
* @param Request $request
27-
* @param Closure $next
28-
* @return mixed
2926
*
3027
* @throws Exception
3128
*/

src/Requests/QueryResolver.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class QueryResolver
1919
/**
2020
* @template TModelClass of Model
2121
*
22-
* @param CollectionRequest $request
2322
* @param Builder<TModelClass> $query
2423
*/
2524
public function resolve(CollectionRequest $request, Builder $query): void
@@ -46,7 +45,6 @@ public function resolve(CollectionRequest $request, Builder $query): void
4645
}
4746

4847
/**
49-
* @param CollectionRequest $request
5048
* @return array<AllowedFilter>
5149
*/
5250
protected function filters(CollectionRequest $request): array
@@ -55,7 +53,6 @@ protected function filters(CollectionRequest $request): array
5553
}
5654

5755
/**
58-
* @param CollectionRequest $request
5956
* @return array<AllowedSort>
6057
*/
6158
protected function sorts(CollectionRequest $request): array
@@ -64,7 +61,6 @@ protected function sorts(CollectionRequest $request): array
6461
}
6562

6663
/**
67-
* @param CollectionRequest $request
6864
* @return array<AllowedInclude|string>
6965
*/
7066
protected function includes(CollectionRequest $request): array

src/Resources/IncludesBag.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public function __construct()
2424

2525
/**
2626
* @param array<mixed> $resource
27-
* @return void
2827
*/
2928
public function add(array $resource): void
3029
{

0 commit comments

Comments
 (0)