Skip to content

Commit f7f3a16

Browse files
authored
Merge pull request #692 from mfn/mfn-merge-5.x
[6.x] Merge 5.x into master/6.x
2 parents 4fd44c6 + 0d428a0 commit f7f3a16

File tree

7 files changed

+24
-8
lines changed

7 files changed

+24
-8
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ jobs:
66
integration:
77
strategy:
88
matrix:
9-
php: [7.2, 7.3, 7.4]
9+
php: [7.2, 7.3, 7.4, 8.0]
1010
laravel: [^6.0, ^7.0, ^8.0]
1111
lazy_types: ['false', 'true']
1212
exclude:
1313
- php: 7.2
1414
laravel: ^8.0
15+
- php: 8.0
16+
laravel: ^6.0
1517
name: P=${{ matrix.php }} L=${{ matrix.laravel }} Lazy types=${{ matrix.lazy_types }}
1618
runs-on: ubuntu-18.04
1719
env:
@@ -30,6 +32,7 @@ jobs:
3032
- run: composer remove --dev matt-allan/laravel-code-style --no-update
3133
- run: composer require illuminate/contracts:${{ matrix.laravel }} --no-update
3234
- run: composer remove --dev nunomaduro/larastan --no-update
35+
- run: composer remove --dev friendsofphp/php-cs-fixer --no-update
3336
- run: composer remove --dev laravel/legacy-factories --no-update
3437
if: (matrix.laravel == '^6.0' || matrix.laravel == '^7.0')
3538

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ CHANGELOG
1515
### Added
1616
- Support for Laravel 8 [\#672 / mfn](https://github.com/rebing/graphql-laravel/pull/672)
1717

18+
2020-11-16, 5.1.5-rc1
19+
---------------------
20+
21+
### Added
22+
- Support for PHP 8 [\#686 / mfn](https://github.com/rebing/graphql-laravel/pull/686)
23+
1824
2020-09-03, 5.1.4
1925
-----------------
2026
Hotfix release to replace 5.1.3

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"require-dev": {
4444
"orchestra/testbench": "4.0.*|5.0.*|^6.0",
45-
"phpunit/phpunit": "~7.0|~8.0",
45+
"phpunit/phpunit": "~7.0|~8.0|^9",
4646
"nunomaduro/larastan": "0.6.4",
4747
"mockery/mockery": "^1.2",
4848
"friendsofphp/php-cs-fixer": "^2.15",

phpstan-baseline.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ parameters:
205205
count: 1
206206
path: src/Support/Field.php
207207

208+
-
209+
message: "#^Cannot call method isBuiltin\\(\\) on ReflectionType\\|null\\.$#"
210+
count: 1
211+
path: src/Support/Field.php
212+
208213
-
209214
message: "#^Cannot call method getName\\(\\) on ReflectionType\\|null\\.$#"
210215
count: 1

phpstan.neon.dist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ parameters:
1010
- %currentWorkingDirectory%/tests/Support/database/
1111
ignoreErrors:
1212
- '/Call to an undefined method Rebing\\GraphQL\\Tests\\TestCaseDatabase::setupSqlAssertionTrait\(\)/'
13-
- '/Parameter #3 \$subject of function str_replace expects array\|string, string\|false given/'
1413
- '/Method Rebing\\GraphQL\\GraphQL::routeNameTransformer\(\) should return string but returns string\|null/'
1514
- '/Cannot access property \$parameters on mixed/'
1615
- '/Strict comparison using === between null and array will always evaluate to false/'
@@ -40,4 +39,7 @@ parameters:
4039
-
4140
path: tests/*
4241
message: '/Cannot access property \$[a-z]+ on Rebing\\GraphQL\\Tests\\Support\\Models\\[A-Za-z]+\|null./'
42+
-
43+
message: '/Comparison operation.*between.*and.*is always false./'
44+
path: tests/Database/SelectFields/InterfaceTests/InterfaceTest.php
4345
reportUnmatchedIgnoredErrors: true

src/Console/PublishCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ protected function createParentDirectory(string $directory): void
8585
*/
8686
protected function status(string $from, string $to): void
8787
{
88-
$from = str_replace(base_path(), '', realpath($from));
89-
$to = str_replace(base_path(), '', realpath($to));
9088
$this->line("<info>Copied File</info> <comment>[{$from}]</comment> <info>To</info> <comment>[{$to}]</comment>");
9189
}
9290
}

src/Support/Field.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,15 @@ protected function getResolver(): ?Closure
162162
$additionalParams = array_slice($method->getParameters(), 3);
163163

164164
$additionalArguments = array_map(function ($param) use ($arguments, $fieldsAndArguments) {
165-
$className = null !== $param->getClass() ? $param->getClass()->getName() : null;
165+
$paramType = $param->getType();
166166

167-
if (null === $className) {
167+
if ($paramType->isBuiltin()) {
168168
throw new InvalidArgumentException("'{$param->name}' could not be injected");
169169
}
170170

171-
if (Closure::class === $param->getType()->getName()) {
171+
$className = $param->getType()->getName();
172+
173+
if (Closure::class === $className) {
172174
return function (int $depth = null) use ($arguments, $fieldsAndArguments): SelectFields {
173175
return $this->instanciateSelectFields($arguments, $fieldsAndArguments, $depth);
174176
};

0 commit comments

Comments
 (0)