Skip to content

Commit 3969452

Browse files
committed
Merge branch 'master' of github.com:thecodingmachine/graphqlite-laravel into http_code_decider
# Conflicts: # config/graphqlite.php
2 parents fb486e3 + 44a98e4 commit 3969452

File tree

12 files changed

+122
-106
lines changed

12 files changed

+122
-106
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 10
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request: ~
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
11+
continuous-integration:
12+
name: "Continuous Integration"
13+
14+
runs-on: "ubuntu-latest"
15+
16+
strategy:
17+
matrix:
18+
include:
19+
- install-args: "--prefer-lowest"
20+
php-version: "8.1"
21+
- install-args: ""
22+
php-version: "8.1"
23+
- install-args: ""
24+
php-version: "8.2"
25+
fail-fast: false
26+
27+
steps:
28+
# Cancel previous runs of the same branch
29+
- name: cancel
30+
uses: styfle/[email protected]
31+
with:
32+
access_token: ${{ github.token }}
33+
34+
- name: "Checkout"
35+
uses: "actions/checkout@v3"
36+
37+
- name: "Install PHP with extensions"
38+
uses: "shivammathur/setup-php@v2"
39+
with:
40+
coverage: "xdebug"
41+
php-version: "${{ matrix.php-version }}"
42+
tools: composer:v2
43+
44+
- name: composer-cache-dir
45+
id: composercache
46+
run: |
47+
echo "::set-output name=dir::$(composer config cache-files-dir)"
48+
- name: composer-cache
49+
uses: actions/cache@v3
50+
with:
51+
path: ${{ steps.composercache.outputs.dir }}
52+
key: composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
53+
restore-keys: |
54+
composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
55+
composer-${{ hashFiles('**/composer.json') }}-
56+
composer-
57+
- name: "Install dependencies with composer"
58+
run: |
59+
composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist
60+
- name: "Run tests with phpunit/phpunit"
61+
run: "vendor/bin/phpunit"

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/graphqlite-laravel/v/stable)](https://packagist.org/packages/thecodingmachine/graphqlite-laravel)
22
[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/graphqlite-laravel/v/unstable)](https://packagist.org/packages/thecodingmachine/graphqlite-laravel)
33
[![License](https://poser.pugx.org/thecodingmachine/graphqlite-laravel/license)](https://packagist.org/packages/thecodingmachine/graphqlite-laravel)
4-
[![Build Status](https://travis-ci.org/thecodingmachine/graphqlite-laravel.svg?branch=master)](https://travis-ci.org/thecodingmachine/graphqlite-laravel)
4+
[![Build Status](https://github.com/thecodingmachine/graphqlite/workflows/Continuous%20Integration/badge.svg)](https://github.com/thecodingmachine/graphqlite/actions)
55

66

77
Laravel GraphQLite bindings

composer.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,27 @@
1313
{
1414
"name": "David N\u00e9grier",
1515
"email": "[email protected]",
16-
"homepage": "http://mouf-php.com"
16+
"homepage": "https://workadventu.re"
1717
}
1818
],
1919
"scripts": {
2020
"test": "phpunit"
2121
},
2222
"require": {
23-
"php": ">=7.2",
24-
"thecodingmachine/graphqlite": "^5.0",
25-
"illuminate/console": "^5.7|^6.0|^7|^8",
26-
"illuminate/container": "^5.7|^6.0|^7|^8",
27-
"illuminate/support": "^5.7|^6.0|^7|^8",
28-
"illuminate/cache": "^5.7|^6.0|^7|^8",
23+
"php": "^8.1",
24+
"thecodingmachine/graphqlite": "^v6.2.1",
25+
"illuminate/console": "^9 || ^10",
26+
"illuminate/container": "^9 || ^10",
27+
"illuminate/support": "^9 || ^10",
28+
"illuminate/cache": "^9 || ^10",
2929
"symfony/psr-http-message-bridge": "^1.3.0 || ^2",
3030
"laminas/laminas-diactoros": "^2.2.2",
31-
"symfony/cache": "^4.3 || ^5"
31+
"symfony/cache": "^4.3 || ^5 || ^6",
32+
"psr/container": "^2.0.2"
3233
},
3334
"require-dev": {
34-
"orchestra/testbench": "^3.7.7 || ^4 || ^5",
35-
"phpunit/phpunit": "^7.5.4 || ^8.3",
35+
"orchestra/testbench": "^7 || ^8",
36+
"phpunit/phpunit": "^9.6.6 || ^10.0.19",
3637
"ext-sqlite3": "*"
3738
},
3839
"autoload": {
@@ -47,7 +48,7 @@
4748
},
4849
"extra": {
4950
"branch-alias": {
50-
"dev-master": "5.0.x-dev"
51+
"dev-master": "6.1.x-dev"
5152
},
5253
"laravel": {
5354
"providers": [

config/graphqlite.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use GraphQL\Error\Debug;
3+
use GraphQL\Error\DebugFlag;
44
use TheCodingMachine\GraphQLite\Http\HttpCodeDecider;
55

66
return [
@@ -19,7 +19,7 @@
1919
*/
2020
'controllers' => 'App\\Http\\Controllers',
2121
'types' => 'App\\',
22-
'debug' => Debug::RETHROW_UNSAFE_EXCEPTIONS,
22+
'debug' => DebugFlag::RETHROW_UNSAFE_EXCEPTIONS,
2323
'uri' => env('GRAPHQLITE_URI', '/graphql'),
2424
'middleware' => ['web'],
2525

phpunit.xml.dist

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
bootstrap="vendor/autoload.php"
12-
>
13-
<testsuites>
14-
<testsuite name="Test Suite">
15-
<directory>./tests/</directory>
16-
</testsuite>
17-
</testsuites>
18-
19-
<php>
20-
<env name="APP_KEY" value="9E6B382F19C53C5327840752500B0260"/>
21-
<env name="APP_DEBUG" value="true"/>
22-
</php>
23-
24-
<filter>
25-
<whitelist processUncoveredFilesFromWhitelist="true">
26-
<directory suffix=".php">src/</directory>
27-
<exclude>
28-
<directory suffix=".php">src/routes</directory>
29-
</exclude>
30-
</whitelist>
31-
</filter>
32-
<logging>
33-
<log type="coverage-html" target="build/coverage" />
34-
<log type="coverage-clover" target="build/logs/clover.xml"/>
35-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
<exclude>
8+
<directory suffix=".php">src/routes</directory>
9+
</exclude>
10+
<report>
11+
<clover outputFile="build/logs/clover.xml"/>
12+
<html outputDirectory="build/coverage"/>
13+
</report>
14+
</coverage>
15+
<testsuites>
16+
<testsuite name="Test Suite">
17+
<directory>./tests/</directory>
18+
</testsuite>
19+
</testsuites>
20+
<php>
21+
<env name="APP_KEY" value="9E6B382F19C53C5327840752500B0260"/>
22+
<env name="APP_DEBUG" value="true"/>
23+
</php>
24+
<logging/>
3625
</phpunit>

src/Exceptions/ValidateException.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,11 @@ public static function create(string $message, string $argumentName)
1919
return $exception;
2020
}
2121

22-
/**
23-
* @return bool
24-
*/
25-
public function isClientSafe()
22+
public function isClientSafe(): bool
2623
{
2724
return true;
2825
}
2926

30-
/**
31-
* @return string
32-
*/
33-
public function getCategory()
34-
{
35-
return 'Validate';
36-
}
37-
3827

3928
/**
4029
* Returns the "extensions" object attached to the GraphQL error.

src/Mappers/PaginatorTypeMapper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace TheCodingMachine\GraphQLite\Laravel\Mappers;
66

77
use GraphQL\Type\Definition\InputObjectType;
8+
use GraphQL\Type\Definition\NamedType;
89
use GraphQL\Type\Definition\NullableType;
910
use GraphQL\Type\Definition\OutputType;
1011
use GraphQL\Type\Definition\Type;
@@ -196,11 +197,11 @@ public function canMapNameToType(string $typeName): bool
196197
*
197198
* @param string $typeName The name of the GraphQL type
198199
*
199-
* @return Type&((ResolvableMutableInputInterface&InputObjectType)|MutableObjectType|MutableInterfaceType)
200+
* @return Type&NamedType&((ResolvableMutableInputInterface&InputObjectType)|MutableObjectType|MutableInterfaceType)
200201
*
201202
* @throws CannotMapTypeExceptionInterface
202203
*/
203-
public function mapNameToType(string $typeName): Type
204+
public function mapNameToType(string $typeName): Type&NamedType
204205
{
205206
if (strpos($typeName, 'LengthAwarePaginatorResult_') === 0) {
206207
$subTypeName = substr($typeName, 27);

src/Mappers/Parameters/ParameterValidator.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use GraphQL\Type\Definition\InputType;
88
use GraphQL\Type\Definition\ResolveInfo;
9+
use GraphQL\Type\Definition\Type;
910
use Illuminate\Validation\Factory as ValidationFactory;
1011
use TheCodingMachine\GraphQLite\Exceptions\GraphQLAggregateException;
1112
use TheCodingMachine\GraphQLite\Laravel\Exceptions\ValidateException;
@@ -45,11 +46,8 @@ public function __construct(InputTypeParameterInterface $parameter, string $para
4546

4647
/**
4748
* @param array<string, mixed> $args
48-
* @param mixed $context
49-
*
50-
* @return mixed
5149
*/
52-
public function resolve(?object $source, array $args, $context, ResolveInfo $info)
50+
public function resolve(?object $source, array $args, mixed $context, ResolveInfo $info): mixed
5351
{
5452
$value = $this->parameter->resolve($source, $args, $context, $info);
5553

@@ -68,7 +66,7 @@ public function resolve(?object $source, array $args, $context, ResolveInfo $inf
6866
return $value;
6967
}
7068

71-
public function getType(): InputType
69+
public function getType(): InputType&Type
7270
{
7371
return $this->parameter->getType();
7472
}
@@ -78,10 +76,7 @@ public function hasDefaultValue(): bool
7876
return $this->parameter->hasDefaultValue();
7977
}
8078

81-
/**
82-
* @return mixed
83-
*/
84-
public function getDefaultValue()
79+
public function getDefaultValue(): mixed
8580
{
8681
return $this->parameter->getDefaultValue();
8782
}

0 commit comments

Comments
 (0)