Skip to content

Commit b80dd87

Browse files
feat: laravel 11 compatibility
1 parent 863c108 commit b80dd87

File tree

10 files changed

+22
-36
lines changed

10 files changed

+22
-36
lines changed

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
11+
- uses: shivammathur/setup-php@v2
1212
with:
1313
php-version: '8.1'
1414
- uses: actions/checkout@v3

.github/workflows/pint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
11+
- uses: shivammathur/setup-php@v2
1212
with:
1313
php-version: '8.2'
1414

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
11+
- uses: shivammathur/setup-php@v2
1212
with:
1313
php-version: '8.1'
1414
- uses: actions/checkout@v3

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
"require": {
1212
"php": ">=8.1",
1313
"ext-json": "*",
14-
"cebe/php-openapi": "^1.7",
14+
"devizzent/cebe-php-openapi": "^1.0",
1515
"fakerphp/faker": "^1.0",
16-
"laravel/framework": "^7.0 || ^8.0 || ^9.0 || ^10.0",
16+
"laravel/framework": "^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
1717
"phpdocumentor/reflection-docblock": "^5.2"
1818
},
1919
"require-dev": {
2020
"laravel/pint": "^1.5",
21-
"nunomaduro/larastan": "^2.4",
22-
"orchestra/testbench": "^6.6 || ^7.0 || ^8.0"
21+
"larastan/larastan": "^2.4",
22+
"orchestra/testbench": "^9.0",
23+
"phpunit/phpunit": "^11.0"
2324
},
2425
"autoload-dev": {
2526
"psr-4": {

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
includes:
2-
- %currentWorkingDirectory%/vendor/nunomaduro/larastan/extension.neon
2+
- %currentWorkingDirectory%/vendor/larastan/larastan/extension.neon
33
- phpstan-baseline.neon
44

55
parameters:

tests/GeneratorTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Intermax\LaravelOpenApi\Tests\Utilities\ResourceInput\PetController;
1010
use Intermax\LaravelOpenApi\Tests\Utilities\ResourceInput\ThingController;
1111
use Orchestra\Testbench\TestCase;
12+
use PHPUnit\Framework\Attributes\Test;
1213

1314
class GeneratorTest extends TestCase
1415
{
@@ -22,9 +23,7 @@ protected function setUp(): void
2223
parent::setUp();
2324
}
2425

25-
/**
26-
* @test
27-
*/
26+
#[Test]
2827
public function it_generates_open_api_spec_for_route()
2928
{
3029
/** @var Generator $generator */
@@ -36,9 +35,7 @@ public function it_generates_open_api_spec_for_route()
3635
$this->assertEquals('postThings', $spec['paths']['/things']['post']['operationId'] ?? null);
3736
}
3837

39-
/**
40-
* @test
41-
*/
38+
#[Test]
4239
public function it_generates_distinct_operation_ids_with_nested_routes()
4340
{
4441
/** @var Generator $generator */
@@ -49,7 +46,7 @@ public function it_generates_distinct_operation_ids_with_nested_routes()
4946
$this->assertEquals('postPetOwner', Arr::get($spec, 'paths./pets/{pet}/owner.post.operationId'));
5047
}
5148

52-
/** @test */
49+
#[Test]
5350
public function it_generates_distinct_get_operation_ids()
5451
{
5552
/** @var Generator $generator */

tests/QueryParameters/QueryParameterCreatorTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
use Intermax\LaravelOpenApi\Generator\Parameters\QueryParametersCreator;
77
use Intermax\LaravelOpenApi\Tests\QueryParameters\Utilities\ThingCollectionRequest;
88
use Orchestra\Testbench\TestCase;
9+
use PHPUnit\Framework\Attributes\Test;
910

1011
class QueryParameterCreatorTest extends TestCase
1112
{
12-
/**
13-
* @test
14-
*/
13+
#[Test]
1514
public function it_creates_query_parameters_based_on_a_form_request_class()
1615
{
1716
/** @var QueryParametersCreator $creator */
@@ -25,9 +24,7 @@ public function it_creates_query_parameters_based_on_a_form_request_class()
2524
$this->assertTrue(in_array('include', $names));
2625
}
2726

28-
/**
29-
* @test
30-
*/
27+
#[Test]
3128
public function it_adds_an_enum_to_query_parameters_with_options()
3229
{
3330
/** @var QueryParametersCreator $creator */

tests/RequestBody/RequestBodyCreatorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
use Intermax\LaravelOpenApi\Generator\RequestBodyCreator;
66
use Intermax\LaravelOpenApi\Tests\QueryParameters\Utilities\ThingCollectionRequest;
77
use Orchestra\Testbench\TestCase;
8+
use PHPUnit\Framework\Attributes\Test;
89

910
class RequestBodyCreatorTest extends TestCase
1011
{
11-
/**
12-
* @test
13-
*/
12+
#[Test]
1413
public function it_omits_query_parameters_from_request_body()
1514
{
1615
/** @var RequestBodyCreator $creator */

tests/ResponseDiscoveryTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace Intermax\LaravelOpenApi\Tests;
44

5-
use cebe\openapi\exceptions\TypeErrorException;
65
use Illuminate\Routing\Router;
76
use Illuminate\Support\Arr;
87
use Intermax\LaravelOpenApi\Generator\Generator;
98
use Intermax\LaravelOpenApi\OpenApiServiceProvider;
109
use Intermax\LaravelOpenApi\Tests\Utilities\ResourceInput\ThingController;
1110
use Orchestra\Testbench\TestCase;
11+
use PHPUnit\Framework\Attributes\Test;
1212

1313
class ResponseDiscoveryTest extends TestCase
1414
{
@@ -22,11 +22,7 @@ protected function setUp(): void
2222
parent::setUp();
2323
}
2424

25-
/**
26-
* @test
27-
*
28-
* @throws TypeErrorException
29-
*/
25+
#[Test]
3026
public function it_can_map_a_resource_with_openapi_types_through_response_discovery()
3127
{
3228
/** @var Generator $generator */

tests/ResponseMappingTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace Intermax\LaravelOpenApi\Tests;
44

5-
use cebe\openapi\exceptions\TypeErrorException;
65
use Illuminate\Routing\Router;
76
use Intermax\LaravelOpenApi\Generator\Generator;
87
use Intermax\LaravelOpenApi\OpenApiServiceProvider;
98
use Intermax\LaravelOpenApi\Tests\Utilities\Mapping\ThingController;
109
use Intermax\LaravelOpenApi\Tests\Utilities\Mapping\ThingMapper;
1110
use Orchestra\Testbench\TestCase;
11+
use PHPUnit\Framework\Attributes\Test;
1212

1313
class ResponseMappingTest extends TestCase
1414
{
@@ -22,11 +22,7 @@ protected function setUp(): void
2222
parent::setUp();
2323
}
2424

25-
/**
26-
* @test
27-
*
28-
* @throws TypeErrorException
29-
*/
25+
#[Test]
3026
public function it_can_map_resource_with_a_mapper_class()
3127
{
3228
/** @var Generator $generator */

0 commit comments

Comments
 (0)