Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v1
coverage: none

# Due to version incompatibility with older Laravels we test, we remove it
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
integration:
strategy:
matrix:
php: [7.1, 7.2, 7.3, 7.4]
php: [7.1, 7.2, 7.3, 7.4, 8.0]
laravel: [5.5.*, ^6.0, ^7.0, ^8.0]
exclude:
- php: 7.1
Expand All @@ -19,6 +19,10 @@ jobs:
laravel: ^8.0
- php: 7.4
laravel: 5.5.*
- php: 8.0
laravel: 5.5.*
- php: 8.0
laravel: ^6.0
name: PHP ${{ matrix.php }} Laravel ${{ matrix.laravel }}
runs-on: ubuntu-18.04
env:
Expand All @@ -37,6 +41,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 require --dev laravel/legacy-factories --no-update
if: matrix.laravel == '^8.0'

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ CHANGELOG
[Next release](https://github.com/rebing/graphql-laravel/compare/5.1.4...master)
--------------

### 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 @@ -41,7 +41,7 @@
},
"require-dev": {
"orchestra/testbench": "3.5.*|3.6.*|3.7.*|3.8.*|3.9.*|4.0.*|5.0.*|^6.0",
"phpunit/phpunit": "^5.5|~6.0|~7.0|~8.0",
"phpunit/phpunit": "^5.5|~6.0|~7.0|~8.0|^9",
"mockery/mockery": "^1.2",
"friendsofphp/php-cs-fixer": "^2.15",
"matt-allan/laravel-code-style": "0.5.0"
Expand Down
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