diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aafb2117..33ce2cc5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,12 +6,14 @@ jobs: integration: strategy: matrix: - php: [7.2, 7.3, 7.4] + php: [7.2, 7.3, 7.4, 8.0] laravel: [^6.0, ^7.0, ^8.0] lazy_types: ['false', 'true'] exclude: - php: 7.2 laravel: ^8.0 + - php: 8.0 + laravel: ^6.0 name: P=${{ matrix.php }} L=${{ matrix.laravel }} Lazy types=${{ matrix.lazy_types }} runs-on: ubuntu-18.04 env: @@ -30,6 +32,7 @@ jobs: - run: composer remove --dev matt-allan/laravel-code-style --no-update - run: composer require illuminate/contracts:${{ matrix.laravel }} --no-update - run: composer remove --dev nunomaduro/larastan --no-update + - run: composer remove --dev friendsofphp/php-cs-fixer --no-update - run: composer remove --dev laravel/legacy-factories --no-update if: (matrix.laravel == '^6.0' || matrix.laravel == '^7.0') diff --git a/CHANGELOG.md b/CHANGELOG.md index 05cab6e5..e1db531b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ CHANGELOG ### Added - Support for Laravel 8 [\#672 / mfn](https://github.com/rebing/graphql-laravel/pull/672) +2020-11-16, 5.1.5-rc1 +--------------------- + +### Added +- Support for PHP 8 [\#686 / mfn](https://github.com/rebing/graphql-laravel/pull/686) + 2020-09-03, 5.1.4 ----------------- Hotfix release to replace 5.1.3 diff --git a/composer.json b/composer.json index 33445589..59ddebec 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ }, "require-dev": { "orchestra/testbench": "4.0.*|5.0.*|^6.0", - "phpunit/phpunit": "~7.0|~8.0", + "phpunit/phpunit": "~7.0|~8.0|^9", "nunomaduro/larastan": "0.6.4", "mockery/mockery": "^1.2", "friendsofphp/php-cs-fixer": "^2.15", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c522fb27..10eb5ee9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -205,6 +205,11 @@ parameters: count: 1 path: src/Support/Field.php + - + message: "#^Cannot call method isBuiltin\\(\\) on ReflectionType\\|null\\.$#" + count: 1 + path: src/Support/Field.php + - message: "#^Cannot call method getName\\(\\) on ReflectionType\\|null\\.$#" count: 1 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 87930374..62993eca 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -10,7 +10,6 @@ parameters: - %currentWorkingDirectory%/tests/Support/database/ ignoreErrors: - '/Call to an undefined method Rebing\\GraphQL\\Tests\\TestCaseDatabase::setupSqlAssertionTrait\(\)/' - - '/Parameter #3 \$subject of function str_replace expects array\|string, string\|false given/' - '/Method Rebing\\GraphQL\\GraphQL::routeNameTransformer\(\) should return string but returns string\|null/' - '/Cannot access property \$parameters on mixed/' - '/Strict comparison using === between null and array will always evaluate to false/' @@ -40,4 +39,7 @@ parameters: - path: tests/* message: '/Cannot access property \$[a-z]+ on Rebing\\GraphQL\\Tests\\Support\\Models\\[A-Za-z]+\|null./' + - + message: '/Comparison operation.*between.*and.*is always false./' + path: tests/Database/SelectFields/InterfaceTests/InterfaceTest.php reportUnmatchedIgnoredErrors: true diff --git a/src/Console/PublishCommand.php b/src/Console/PublishCommand.php index 08c4cdfd..b8734974 100644 --- a/src/Console/PublishCommand.php +++ b/src/Console/PublishCommand.php @@ -85,8 +85,6 @@ protected function createParentDirectory(string $directory): void */ protected function status(string $from, string $to): void { - $from = str_replace(base_path(), '', realpath($from)); - $to = str_replace(base_path(), '', realpath($to)); $this->line("<info>Copied File</info> <comment>[{$from}]</comment> <info>To</info> <comment>[{$to}]</comment>"); } } diff --git a/src/Support/Field.php b/src/Support/Field.php index e904a440..d85f391e 100644 --- a/src/Support/Field.php +++ b/src/Support/Field.php @@ -162,13 +162,15 @@ protected function getResolver(): ?Closure $additionalParams = array_slice($method->getParameters(), 3); $additionalArguments = array_map(function ($param) use ($arguments, $fieldsAndArguments) { - $className = null !== $param->getClass() ? $param->getClass()->getName() : null; + $paramType = $param->getType(); - if (null === $className) { + if ($paramType->isBuiltin()) { throw new InvalidArgumentException("'{$param->name}' could not be injected"); } - if (Closure::class === $param->getType()->getName()) { + $className = $param->getType()->getName(); + + if (Closure::class === $className) { return function (int $depth = null) use ($arguments, $fieldsAndArguments): SelectFields { return $this->instanciateSelectFields($arguments, $fieldsAndArguments, $depth); };