Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11.x Compatibility #36

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
jobs:
setup:
timeout-minutes: 15

runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ '8.2', '8.3' ]
laravel: [ 10.* ]
laravel: ['10.*', '11.*']
stability: [ prefer-lowest, prefer-stable ]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
Expand Down
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
"type": "project",
"require": {
"php": "^8.2",
"illuminate/support": "^10.0",
"illuminate/support": "^10.0|^11.0",
"jawira/case-converter": "^3.5",
"symfony/config": "^6.0",
"symfony/console": "^6.1",
"symfony/dependency-injection": "^6.0",
"symfony/filesystem": "^6.4",
"symfony/http-kernel": "^6.0",
"symplify/autowire-array-parameter": "^11.0",
"symplify/package-builder": "^11.0",
"thecodingmachine/safe": "^2.4",
"webonyx/graphql-php": "^15.0.1"
"symfony/config": "^6.4|^7.0",
"symfony/console": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/filesystem": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symplify/autowire-array-parameter": "^11.1",
"symplify/package-builder": "^11.3",
"thecodingmachine/safe": "^2.5",
"webonyx/graphql-php": "^15.14"
},
"require-dev": {
"pestphp/pest": "^2.34",
"symfony/var-dumper": "^6.4",
"symplify/easy-testing": "^11.0",
"worksome/coding-style": "^2.10.2"
"symfony/finder": "^6.4|^7.0",
"symfony/var-dumper": "^6.4|^7.0",
"worksome/coding-style": "^2.11"
},
"license": "MIT",
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<directory>./tests</directory>
</testsuite>
</testsuites>
<coverage>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</source>
</phpunit>
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
type User {
full_name: String!
}
-----
type User {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
input User {
fullName: String!
}
-----
input UserInput {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type User @model {
name: String!
}
-----
type User @model {
id: ID!
name: String!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Mutation {
version(environment: String!): String!
}

-----
type Mutation {
version(input: String!): String!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Person {
id: ID
}

-----
type Person {
id: ID!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Person {
friends: [Person]!
}

-----
type Person {
friends: [Person!]!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Person {
friends: [Person]
}

-----
type Person {
friends: [Person]!
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
type user_information {
fullName: String!
}
-----
type UserInformation {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
inProgress
}
-----
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
in_progress
}
-----
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
Active
}
-----
enum Status {
ACTIVE
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
InProgress
}
-----
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type User {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enum Some {
"A test"
TEST
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"Input for a user"
input UserInput {
name: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scalar something
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
union Pro = User | Company
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"Allowed cakes"
enum Cake {
CHOCOLATE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
interface Admin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type User
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"Some user"
type User {
name: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
input Something
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enum MyEnum {
GOOD
BAD
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
input UserInput {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type User @model {
id: ID!
name: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Mutation {
version(input: String!): String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Person {
id: ID!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Person {
friends: [Person!]!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Person {
friends: [Person]!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type UserInformation {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
ACTIVE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
IN_PROGRESS
}
9 changes: 4 additions & 5 deletions tests/Feature/Inspections/CamelCaseFieldInspectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

namespace Worksome\Graphlint\Tests\Feature\Inspections;

use Symplify\SmartFileSystem\SmartFileInfo;
use Symfony\Component\Finder\SplFileInfo;
use Worksome\Graphlint\Inspections\CamelCaseFieldDefinitionInspection;

use function Worksome\Graphlint\Tests\getFixturesForDirectory;

it('can rename field', function (SmartFileInfo $smartFileInfo) {
it('can rename field', function (SplFileInfo $fileInfo) {
$inspection = $this->app->get(CamelCaseFieldDefinitionInspection::class);

expect($smartFileInfo)
expect($fileInfo)
->toPassInspection($inspection);
})->with(getFixturesForDirectory(
})->with(fn () => getFixturesForDirectory(
__DIR__ . '/../../../test-resources/Inspections/CamelCaseFieldInspectionTest'
));
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

namespace Worksome\Graphlint\Tests\Feature\Inspections;

use Symplify\SmartFileSystem\SmartFileInfo;
use Symfony\Component\Finder\SplFileInfo;
use Worksome\Graphlint\Inspections\DescriptionRequiredInspection;

use function Worksome\Graphlint\Tests\getFixturesForDirectory;

it('can require description', function (SmartFileInfo $smartFileInfo) {
it('can require description', function (SplFileInfo $smartFileInfo) {
$inspection = $this->app->get(DescriptionRequiredInspection::class);

expect($smartFileInfo)
->toPassInspection($inspection);
})->with(getFixturesForDirectory(
})->with(fn () => getFixturesForDirectory(
__DIR__ . '/../../../test-resources/Inspections/DescriptionRequiredInspectionTest'
));
7 changes: 3 additions & 4 deletions tests/Feature/Inspections/DisallowEnumInspectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

namespace Worksome\Graphlint\Tests\Feature\Inspections;

use Symplify\SmartFileSystem\SmartFileInfo;
use Symfony\Component\Finder\SplFileInfo;
use Worksome\Graphlint\Inspections\DisallowEnumInspection;

use function Worksome\Graphlint\Tests\getFixturesForDirectory;

it('can disallow enums', function (SmartFileInfo $smartFileInfo) {
it('can disallow enums', function (SplFileInfo $smartFileInfo) {
$inspection = $this->app->get(DisallowEnumInspection::class);

expect($smartFileInfo)
->toPassInspection($inspection);
})->with(getFixturesForDirectory(
})->with(fn () => getFixturesForDirectory(
__DIR__ . '/../../../test-resources/Inspections/DisallowEnumInspectionTest'
));
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

namespace Worksome\Graphlint\Tests\Feature\Inspections;

use Symplify\SmartFileSystem\SmartFileInfo;
use Symfony\Component\Finder\SplFileInfo;
use Worksome\Graphlint\Inspections\IgnoreByNameSuppressorInspection;

use Worksome\Graphlint\Inspections\NonNullableInsideListInspection;

use function Worksome\Graphlint\Tests\getFixturesForDirectory;

it('ignores list inspection by name', function (SmartFileInfo $smartFileInfo) {
it('ignores list inspection by name', function (SplFileInfo $smartFileInfo) {
$inspection = $this->app->get(NonNullableInsideListInspection::class);
$suppressor = $this->app->get(IgnoreByNameSuppressorInspection::class);
$suppressor->configure('User.alwaysTwoItems');

expect($smartFileInfo)
->toPassInspection($inspection, $suppressor);
})->with(getFixturesForDirectory(
})->with(fn () => getFixturesForDirectory(
__DIR__ . '/../../../test-resources/Inspections/IgnoreByNameSuppressorInspectionTest'
));
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@

namespace Worksome\Graphlint\Tests\Feature\Inspections;

use Symplify\SmartFileSystem\SmartFileInfo;
use Symfony\Component\Finder\SplFileInfo;
use Worksome\Graphlint\Inspections\CamelCaseFieldDefinitionInspection;
use Worksome\Graphlint\Inspections\IgnoreNextLineSuppressorInspection;

use function Worksome\Graphlint\Tests\getFixturesForDirectory;

it('can skip next line22', function (SmartFileInfo $smartFileInfo) {
it('can skip next line22', function (SplFileInfo $smartFileInfo) {
// Load in an inspection which should error, but will be skipped instead.
$inspection = $this->app->get(CamelCaseFieldDefinitionInspection::class);
$suppressor = $this->app->get(IgnoreNextLineSuppressorInspection::class);

expect($smartFileInfo)
->toPassInspection($inspection, $suppressor);
})->with(getFixturesForDirectory(
})->with(fn () => getFixturesForDirectory(
__DIR__ . '/../../../test-resources/Inspections/IgnoreNextLineSuppressorInspectionTest'
));
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

namespace Worksome\Graphlint\Tests\Feature\Inspections;

use Symplify\SmartFileSystem\SmartFileInfo;
use Symfony\Component\Finder\SplFileInfo;
use Worksome\Graphlint\Inspections\InputSuffixInputObjectTypeDefinitionInspection;

use function Worksome\Graphlint\Tests\getFixturesForDirectory;

it('can rename input object type', function (SmartFileInfo $smartFileInfo) {
it('can rename input object type', function (SplFileInfo $smartFileInfo) {
$inspection = $this->app->get(InputSuffixInputObjectTypeDefinitionInspection::class);

expect($smartFileInfo)
->toPassInspection($inspection);
})->with(getFixturesForDirectory(
})->with(fn () => getFixturesForDirectory(
__DIR__ . '/../../../test-resources/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest'
));
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

namespace Worksome\Graphlint\Tests\Feature\Inspections;

use Symplify\SmartFileSystem\SmartFileInfo;
use Symfony\Component\Finder\SplFileInfo;
use Worksome\Graphlint\Inspections\ModelDirectiveRequiresIdFieldInspection;

use function Worksome\Graphlint\Tests\getFixturesForDirectory;

it('can disallow enums', function (SmartFileInfo $smartFileInfo) {
it('can disallow enums', function (SplFileInfo $smartFileInfo) {
$inspection = $this->app->get(ModelDirectiveRequiresIdFieldInspection::class);

expect($smartFileInfo)
->toPassInspection($inspection);
})->with(getFixturesForDirectory(
})->with(fn () => getFixturesForDirectory(
__DIR__ . '/../../../test-resources/Inspections/ModelDirectiveRequiresIdFieldInspectionTest'
));
Loading