Skip to content

Commit 79c8f6c

Browse files
authored
Upgrade dependencies (#14)
1 parent 4960651 commit 79c8f6c

22 files changed

+194
-152
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,53 @@ on:
99
name: "Continuous Integration"
1010

1111
jobs:
12-
coding-standards:
13-
name: "Coding Standards"
12+
composer-validate:
13+
name: "Validate composer dependencies"
1414

1515
runs-on: ubuntu-latest
1616

1717
steps:
1818
- name: "Checkout"
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@master
2020

2121
- name: "Install PHP with extensions"
2222
uses: shivammathur/setup-php@v2
2323
with:
2424
coverage: none
25+
extensions: mbstring
2526
php-version: 7.4
2627

2728
- name: "Validate composer.json and composer.lock"
2829
run: composer validate --strict
2930

30-
- name: "Install dependencies with composer"
31-
run: composer install --no-interaction --no-progress
31+
composer-normalize:
32+
name: "Normalize composer.json"
33+
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- name: "Checkout"
38+
uses: actions/checkout@v2
39+
with:
40+
ref: ${{ github.head_ref }}
3241

33-
- name: "Normalize composer.json"
34-
run: composer normalize --dry-run
42+
- name: "Install PHP with extensions"
43+
uses: shivammathur/setup-php@v2
44+
with:
45+
coverage: none
46+
extensions: mbstring
47+
php-version: 7.4
48+
49+
- name: "Install locked dependencies with composer"
50+
run: composer install --no-interaction --no-progress --no-suggest
51+
52+
- name: "Run localheinz/composer-normalize"
53+
run: composer normalize
54+
55+
- name: "Commit fixes"
56+
uses: stefanzweifel/git-auto-commit-action@v4
57+
with:
58+
commit_message: Normalize composer.json
3559

3660
static-code-analysis:
3761
name: "Static Code Analysis"
@@ -62,10 +86,9 @@ jobs:
6286
strategy:
6387
matrix:
6488
php-version:
65-
- "7.2"
66-
- "7.3"
6789
- "7.4"
6890
- "8.0"
91+
- "8.1"
6992

7093
dependencies:
7194
- "prefer-lowest"
@@ -110,4 +133,3 @@ jobs:
110133

111134
- name: "Send code coverage report to codecov.io"
112135
uses: codecov/codecov-action@v2
113-

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/vendor
33
/composer.lock
44
/.phpunit.result.cache
5+
/.php-cs-fixer.cache

.php-cs-fixer.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php declare(strict_types=1);
2+
3+
use function MLL\PhpCsFixerConfig\risky;
4+
5+
$finder = PhpCsFixer\Finder::create()
6+
->notPath('vendor')
7+
->in(__DIR__)
8+
->name('*.php')
9+
->ignoreDotFiles(true)
10+
->ignoreVCS(true);
11+
12+
return risky($finder);

.styleci.yml

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

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## 5.0.0
11+
12+
### Fixed
13+
14+
- Return coerced string value in `Regex::parseValue()`
15+
16+
### Changed
17+
18+
- Require `egulias/email-validator:^3`
19+
20+
### Removed
21+
22+
- Drop support for PHP 7.2 and 7.3
23+
1024
## 4.1.1
1125

1226
### Fixed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: it
2-
it: stan test normalize
2+
it: fix stan test normalize
33

44
.PHONY: help
55
help: ## Displays this list of targets with descriptions
@@ -8,6 +8,10 @@ help: ## Displays this list of targets with descriptions
88
.PHONY: setup
99
setup: vendor ## Set up the project
1010

11+
.PHONY: fix
12+
fix: vendor
13+
vendor/bin/php-cs-fixer fix
14+
1115
.PHONY: stan
1216
stan: ## Run static analysis
1317
vendor/bin/phpstan analyse --memory-limit=2048M

composer.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,24 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^7.2 || ^8.0",
17+
"php": "^7.4 || ^8",
1818
"ext-json": "*",
19-
"egulias/email-validator": "^2.1.17",
20-
"spatie/regex": "^1.4.1",
21-
"thecodingmachine/safe": "^1.0.3",
22-
"webonyx/graphql-php": "^0.13.8 || ^14"
19+
"egulias/email-validator": "^3",
20+
"spatie/regex": "^1.4",
21+
"thecodingmachine/safe": "^1.3",
22+
"webonyx/graphql-php": "^0.13 || ^14"
2323
},
2424
"require-dev": {
25-
"ergebnis/composer-normalize": "^2.13",
26-
"phpstan/phpstan": "~0.12.31",
27-
"phpunit/phpunit": "^8.5",
28-
"thecodingmachine/phpstan-safe-rule": "^1"
25+
"ergebnis/composer-normalize": "^2.16",
26+
"mll-lab/php-cs-fixer-config": "^4.3",
27+
"phpstan/extension-installer": "^1",
28+
"phpstan/phpstan": "^1",
29+
"phpstan/phpstan-deprecation-rules": "^1",
30+
"phpstan/phpstan-phpunit": "^1",
31+
"phpstan/phpstan-strict-rules": "^1",
32+
"phpunit/phpunit": "^9",
33+
"symfony/var-dumper": "^5.4",
34+
"thecodingmachine/phpstan-safe-rule": "^1.1"
2935
},
3036
"autoload": {
3137
"psr-4": {
@@ -34,7 +40,7 @@
3440
},
3541
"autoload-dev": {
3642
"psr-4": {
37-
"Tests\\": "tests/"
43+
"MLL\\GraphQLScalars\\Tests\\": "tests/"
3844
}
3945
}
4046
}

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
includes:
2-
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
31
parameters:
42
level: max
53
paths:

src/Email.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
class Email extends StringScalar
1111
{
12-
public $description = /** @lang Markdown */
13-
'A [RFC 5321](https://tools.ietf.org/html/rfc5321) compliant email.';
12+
public $description /** @lang Markdown */
13+
= 'A [RFC 5321](https://tools.ietf.org/html/rfc5321) compliant email.';
1414

1515
protected function isValid(string $stringValue): bool
1616
{

src/JSON.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
class JSON extends ScalarType
1313
{
14-
public $description = /** @lang Markdown */
15-
'Arbitrary data encoded in JavaScript Object Notation. See https://www.json.org/.';
14+
public $description /** @lang Markdown */
15+
= 'Arbitrary data encoded in JavaScript Object Notation. See https://www.json.org/.';
1616

1717
public function serialize($value): string
1818
{
@@ -26,9 +26,9 @@ public function parseValue($value)
2626

2727
public function parseLiteral($valueNode, ?array $variables = null)
2828
{
29-
if (!property_exists($valueNode, 'value')) {
29+
if (! property_exists($valueNode, 'value')) {
3030
throw new Error(
31-
'Can only parse literals that contain a value, got '.GraphQLUtils::printSafeJson($valueNode)
31+
'Can only parse literals that contain a value, got ' . GraphQLUtils::printSafeJson($valueNode)
3232
);
3333
}
3434

@@ -47,6 +47,7 @@ public function parseLiteral($valueNode, ?array $variables = null)
4747
protected function decodeJSON($value)
4848
{
4949
try {
50+
// @phpstan-ignore-next-line we attempt unsafe values and let it throw
5051
$decoded = \Safe\json_decode($value);
5152
} catch (JsonException $jsonException) {
5253
throw new Error(

0 commit comments

Comments
 (0)