Skip to content

Commit

Permalink
Merge pull request #692 from mfn/mfn-merge-5.x
Browse files Browse the repository at this point in the history
[6.x] Merge 5.x into master/6.x
  • Loading branch information
mfn authored Nov 16, 2020
2 parents 4fd44c6 + 0d428a0 commit f7f3a16
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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')

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down Expand Up @@ -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
2 changes: 0 additions & 2 deletions src/Console/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>");
}
}
8 changes: 5 additions & 3 deletions src/Support/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit f7f3a16

Please sign in to comment.