Skip to content

Commit a2a9ae1

Browse files
authored
Merge pull request #60 from dsavina/chore/general-upgrade
Upgrade dependencies to prepare 5.0.0 release
2 parents ae2c741 + a89df76 commit a2a9ae1

18 files changed

+60
-73
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ matrix:
1515
include:
1616
# Test the latest stable release
1717
- php: 7.2
18-
- php: 7.4
18+
- php: 8.0
1919
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
2020

2121
# Test LTS versions.
22-
- php: 7.4
22+
- php: 8.0
2323
env: DEPENDENCIES="symfony/lts:^4"
2424

2525
# Latest commit to master
26-
- php: 7.4
26+
- php: 8.0
2727
env: STABILITY="dev"
2828

2929
allow_failures:
3030
# Minimum supported dependencies with the latest and oldest PHP version
31-
- php: 7.4
31+
- php: 8.0
3232
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
3333
- php: 7.2
3434
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"

GraphqliteBundle.php

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Coverage Status](https://coveralls.io/repos/thecodingmachine/graphqlite-symfony-validator-bridge/badge.svg?branch=master&service=github)](https://coveralls.io/github/thecodingmachine/graphqlite-symfony-validator-bridge?branch=master)
66

77

8-
# Graphqlite - Symfony validator bridge
8+
# GraphQLite - Symfony validator bridge
99

1010
A bridge between GraphQLite and the Symfony Validator component
1111

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
],
1919
"require" : {
2020
"php" : ">=7.2",
21-
"thecodingmachine/graphqlite" : "^4.1",
22-
"symfony/validator": "^4 | ^5",
21+
"thecodingmachine/graphqlite" : "^5.0",
22+
"symfony/validator": "^4.2 | ^5",
2323
"doctrine/annotations": "^1.6"
2424
},
2525
"require-dev": {
@@ -28,7 +28,7 @@
2828
"phpstan/phpstan": "^0.12.14",
2929
"php-coveralls/php-coveralls": "^2.1.0",
3030
"symfony/translation": "^4",
31-
"doctrine/coding-standard": "^7.0"
31+
"doctrine/coding-standard": "^9.0"
3232
},
3333
"scripts": {
3434
"phpstan": "phpstan analyse src/ -c phpstan.neon --level=7 --no-progress",
@@ -38,17 +38,17 @@
3838
},
3939
"autoload" : {
4040
"psr-4" : {
41-
"TheCodingMachine\\Graphqlite\\Validator\\" : "src/"
41+
"TheCodingMachine\\GraphQLite\\Validator\\" : "src/"
4242
}
4343
},
4444
"autoload-dev" : {
4545
"psr-4" : {
46-
"TheCodingMachine\\Graphqlite\\Validator\\" : "tests/"
46+
"TheCodingMachine\\GraphQLite\\Validator\\" : "tests/"
4747
}
4848
},
4949
"extra": {
5050
"branch-alias": {
51-
"dev-master": "4.1.x-dev"
51+
"dev-master": "5.0.x-dev"
5252
}
5353
},
5454
"minimum-stability": "dev",

phpcs.xml.dist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,17 @@
4949
<property name="enableNativeTypeHint" value="false"/>
5050
</properties>
5151
</rule>
52+
53+
<!-- Disable "mixed" type hints only available since PHP 8.0 -->
54+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
55+
<properties>
56+
<property name="enableMixedTypeHint" value="false"/>
57+
</properties>
58+
</rule>
59+
60+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
61+
<properties>
62+
<property name="enableMixedTypeHint" value="false"/>
63+
</properties>
64+
</rule>
5265
</ruleset>

src/Annotations/Assertion.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
declare(strict_types=1);
44

5-
namespace TheCodingMachine\Graphqlite\Validator\Annotations;
5+
namespace TheCodingMachine\GraphQLite\Validator\Annotations;
66

77
use BadMethodCallException;
88
use Symfony\Component\Validator\Constraint;
99
use TheCodingMachine\GraphQLite\Annotations\ParameterAnnotationInterface;
10+
1011
use function is_array;
1112
use function ltrim;
1213

@@ -41,7 +42,7 @@ public function __construct(array $values)
4142
}
4243

4344
$this->for = ltrim($values['for'], '$');
44-
$this->constraint = is_array($values['constraint']) ? $values['constraint'] : [ $values['constraint'] ];
45+
$this->constraint = is_array($values['constraint']) ? $values['constraint'] : [$values['constraint']];
4546
}
4647

4748
public function getTarget(): string

src/ConstraintViolationException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace TheCodingMachine\Graphqlite\Validator;
5+
namespace TheCodingMachine\GraphQLite\Validator;
66

77
use Exception;
88
use Symfony\Component\Validator\ConstraintViolationInterface;
@@ -46,12 +46,12 @@ public function getExtensions(): array
4646
{
4747
$extensions = [];
4848
$code = $this->violation->getCode();
49-
if ($code !== null) {
49+
if (! empty($code)) {
5050
$extensions['code'] = $code;
5151
}
5252

5353
$propertyPath = $this->violation->getPropertyPath();
54-
if ($propertyPath !== null) {
54+
if (! empty($propertyPath)) {
5555
$extensions['field'] = $propertyPath;
5656
}
5757

src/Mappers/Parameters/AssertParameterMiddleware.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace TheCodingMachine\Graphqlite\Validator\Mappers\Parameters;
5+
namespace TheCodingMachine\GraphQLite\Validator\Mappers\Parameters;
66

77
use phpDocumentor\Reflection\DocBlock;
88
use phpDocumentor\Reflection\Type;
@@ -15,7 +15,8 @@
1515
use TheCodingMachine\GraphQLite\Mappers\Parameters\ParameterMiddlewareInterface;
1616
use TheCodingMachine\GraphQLite\Parameters\InputTypeParameterInterface;
1717
use TheCodingMachine\GraphQLite\Parameters\ParameterInterface;
18-
use TheCodingMachine\Graphqlite\Validator\Annotations\Assertion;
18+
use TheCodingMachine\GraphQLite\Validator\Annotations\Assertion;
19+
1920
use function array_map;
2021
use function array_merge;
2122

src/Mappers/Parameters/InvalidAssertionAnnotationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace TheCodingMachine\Graphqlite\Validator\Mappers\Parameters;
5+
namespace TheCodingMachine\GraphQLite\Validator\Mappers\Parameters;
66

77
use Exception;
88
use ReflectionParameter;

src/Mappers/Parameters/ParameterValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace TheCodingMachine\Graphqlite\Validator\Mappers\Parameters;
5+
namespace TheCodingMachine\GraphQLite\Validator\Mappers\Parameters;
66

77
use GraphQL\Type\Definition\InputType;
88
use GraphQL\Type\Definition\ResolveInfo;
@@ -12,7 +12,7 @@
1212
use Symfony\Component\Validator\Validator\ValidatorInterface;
1313
use Symfony\Contracts\Translation\TranslatorInterface;
1414
use TheCodingMachine\GraphQLite\Parameters\InputTypeParameterInterface;
15-
use TheCodingMachine\Graphqlite\Validator\ValidationFailedException;
15+
use TheCodingMachine\GraphQLite\Validator\ValidationFailedException;
1616

1717
class ParameterValidator implements InputTypeParameterInterface
1818
{

0 commit comments

Comments
 (0)