Skip to content

Commit

Permalink
Merge branch 'master' into void
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	src/Console/IdeHelperCommand.php
  • Loading branch information
spawnia committed Dec 6, 2021
2 parents 643b7cc + bebd344 commit 5bcd068
Show file tree
Hide file tree
Showing 288 changed files with 1,892 additions and 1,011 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/.php-cs-fixer.php
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
/docker-compose.yml export-ignore
Expand Down
33 changes: 32 additions & 1 deletion .github/workflows/autoformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ jobs:
with:
ref: ${{ github.head_ref }}

- uses: docker://ergebnis/composer-normalize-action:0.8.0
- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 7.4

- run: composer install --no-interaction --no-progress --no-suggest

- run: composer normalize

- uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand All @@ -30,3 +38,26 @@ jobs:
commit_message: Prettify docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 7.4

- run: composer install --no-interaction --no-progress --no-suggest

- run: vendor/bin/php-cs-fixer fix

- run: git pull

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply php-cs-fixer changes
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# Individual per developer
.env
.idea
.vscode
phpunit.xml

# Generated files
.phpunit.result.cache
.php-cs-fixer.cache
build

# composer
Expand Down
12 changes: 12 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php declare(strict_types=1);

use function MLL\PhpCsFixerConfig\config;

$finder = PhpCsFixer\Finder::create()
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return config($finder);
6 changes: 0 additions & 6 deletions .styleci.yml

This file was deleted.

20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ You can find and compare releases at the [GitHub release page](https://github.co

## Unreleased

## v5.28.0

### Added

- Add directive `@void` to unify the definition of fields with no return value
Expand All @@ -20,6 +18,24 @@ You can find and compare releases at the [GitHub release page](https://github.co

- Add missing types to `programmatic-types.graphql` in artisan command `lighthouse:ide-helper`

## v5.28.0

### Added

- Allow clients to order a list of models by an aggregated value of their relations with `@orderBy` https://github.com/nuwave/lighthouse/pull/1848

## v5.27.3

### Fixed

- Prevent possible `Undefined array key 0` error when there's an interface implemented by two renamed models https://github.com/nuwave/lighthouse/pull/1997

## v5.27.2

### Fixed

- Prevent `Undefined array key` error when using cache version 2 and not having all version 1 configuration present https://github.com/nuwave/lighthouse/pull/1994

## v5.27.1

### Changed
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ function bar(){

## Code style

We use [StyleCI](https://styleci.io/) to ensure clean formatting, oriented
at the Laravel coding style.
We format the code automatically with [php-cs-fixer](https://github.com/friendsofphp/php-cs-fixer)

make fix

Prefer explicit naming and short, focused functions over excessive comments.

Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.PHONY: it
it: vendor stan test ## Run useful checks before commits
it: vendor fix stan test ## Run useful checks before commits

.PHONY: help
help: ## Displays this list of targets with descriptions
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: setup
setup: build vendor ## Setup the local environment
Expand All @@ -16,6 +16,10 @@ build: ## Build the local Docker containers
up: ## Bring up the docker-compose stack
docker-compose up -d

.PHONY: fix
fix: up
docker-compose exec php vendor/bin/php-cs-fixer fix

.PHONY: stan
stan: up ## Runs static analysis
docker-compose exec php vendor/bin/phpstan
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
[![Continuous Integration](https://github.com/nuwave/lighthouse/workflows/Continuous%20Integration/badge.svg)](https://github.com/nuwave/lighthouse/actions)
[![Code Coverage](https://codecov.io/gh/nuwave/lighthouse/branch/master/graph/badge.svg)](https://codecov.io/gh/nuwave/lighthouse)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)
[![StyleCI](https://github.styleci.io/repos/59965104/shield?branch=master&style=flat)](https://github.styleci.io/repos/59965104)

[![Packagist](https://img.shields.io/packagist/dt/nuwave/lighthouse.svg)](https://packagist.org/packages/nuwave/lighthouse)
[![Latest Stable Version](https://poser.pugx.org/nuwave/lighthouse/v/stable)](https://packagist.org/packages/nuwave/lighthouse)
Expand Down
25 changes: 16 additions & 9 deletions _ide_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class TestResponse
/**
* Asserts that the response contains an error from a given category.
*
* @param string $category The name of the expected error category.
* @param string $category the name of the expected error category
*
* @return $this
*/
public function assertGraphQLErrorCategory(string $category): self
Expand All @@ -17,7 +18,8 @@ public function assertGraphQLErrorCategory(string $category): self
/**
* Assert that the returned result contains exactly the given validation keys.
*
* @param array $keys The validation keys the result should have.
* @param array $keys the validation keys the result should have
*
* @return $this
*/
public function assertGraphQLValidationKeys(array $keys): self
Expand All @@ -28,8 +30,9 @@ public function assertGraphQLValidationKeys(array $keys): self
/**
* Assert that a given validation error is present in the response.
*
* @param string $key The validation key that should be present.
* @param string $message The expected validation message.
* @param string $key the validation key that should be present
* @param string $message the expected validation message
*
* @return $this
*/
public function assertGraphQLValidationError(string $key, string $message): self
Expand All @@ -55,7 +58,8 @@ class TestResponse
/**
* Assert the response contains an error with the given message.
*
* @param string $message The expected error message.
* @param string $message the expected error message
*
* @return $this
*/
public function assertGraphQLErrorMessage(string $message): self
Expand All @@ -76,7 +80,8 @@ public function assertGraphQLErrorFree(): self
/**
* Assert the response contains an error from the given category.
*
* @param string $category The name of the expected error category.
* @param string $category the name of the expected error category
*
* @return $this
*/
public function assertGraphQLErrorCategory(string $category): self
Expand All @@ -87,7 +92,8 @@ public function assertGraphQLErrorCategory(string $category): self
/**
* Assert the returned result contains exactly the given validation keys.
*
* @param array $keys The validation keys the result should have.
* @param array $keys the validation keys the result should have
*
* @return $this
*/
public function assertGraphQLValidationKeys(array $keys): self
Expand All @@ -98,8 +104,9 @@ public function assertGraphQLValidationKeys(array $keys): self
/**
* Assert a given validation error is present in the response.
*
* @param string $key The validation key that should be present.
* @param string $message The expected validation message.
* @param string $key the validation key that should be present
* @param string $message the expected validation message
*
* @return $this
*/
public function assertGraphQLValidationError(string $key, string $message): self
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/HugeResponseBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function resolve(): array
'children' => [],
];

for ($i = 0; $i < 100; $i++) {
for ($i = 0; $i < 100; ++$i) {
$parent['children'][] = [
'name' => "child {$i}",
'parent' => $parent,
Expand Down
39 changes: 20 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "nuwave/lighthouse",
"type": "library",
"description": "A framework for serving GraphQL from Laravel",
"license": "MIT",
"type": "library",
"keywords": [
"graphql",
"laravel",
"laravel-graphql"
],
"homepage": "https://lighthouse-php.com",
"license": "MIT",
"authors": [
{
"name": "Christopher Moore",
Expand All @@ -21,6 +20,11 @@
"homepage": "https://franke.tech"
}
],
"homepage": "https://lighthouse-php.com",
"support": {
"issues": "https://github.com/nuwave/lighthouse/issues",
"source": "https://github.com/nuwave/lighthouse"
},
"require": {
"php": ">= 7.2",
"ext-json": "*",
Expand All @@ -45,7 +49,8 @@
"laravel/legacy-factories": "^1",
"laravel/lumen-framework": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8",
"laravel/scout": "^7 || ^8",
"mll-lab/graphql-php-scalars": "^4",
"mll-lab/graphql-php-scalars": "^4 || ^5",
"mll-lab/php-cs-fixer-config": "^4.4.1",
"mockery/mockery": "^1",
"nunomaduro/larastan": "^0.6 || ^0.7 || ^1",
"orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4 || ^5 || ^6",
Expand All @@ -67,6 +72,17 @@
"mll-lab/laravel-graphql-playground": "GraphQL IDE for better development workflow - integrated with Laravel",
"pusher/pusher-php-server": "Required when using the Pusher Subscriptions driver"
},
"autoload": {
"psr-4": {
"Nuwave\\Lighthouse\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/",
"Benchmarks\\": "benchmarks"
}
},
"config": {
"sort-packages": true
},
Expand All @@ -87,26 +103,11 @@
]
}
},
"autoload": {
"psr-4": {
"Nuwave\\Lighthouse\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/",
"Benchmarks\\": "benchmarks"
}
},
"scripts": {
"rector": "rector process -v src/ tests/",
"stan": "phpstan analyse --memory-limit 2048M",
"test": "phpunit --colors=always",
"test:integration": "phpunit --colors=always --testsuite Integration",
"test:unit": "phpunit --colors=always --testsuite Unit"
},
"support": {
"issues": "https://github.com/nuwave/lighthouse/issues",
"source": "https://github.com/nuwave/lighthouse"
}
}
Loading

0 comments on commit 5bcd068

Please sign in to comment.