Skip to content

Commit 7b1ee6e

Browse files
committed
fix CI
1 parent bce6566 commit 7b1ee6e

8 files changed

+20
-36
lines changed

.travis.yml

+3-14
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,13 @@ env:
1313
matrix:
1414
fast_finish: true
1515
include:
16-
# Test the latest stable release
17-
- php: 7.2
18-
- php: 8.0
19-
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
20-
2116
# Test LTS versions.
22-
- php: 8.0
23-
env: DEPENDENCIES="symfony/lts:^4"
24-
25-
# Latest commit to master
26-
- php: 8.0
27-
env: STABILITY="dev"
17+
- php: 8.1
18+
env: DEPENDENCIES="symfony/^6"
2819

2920
allow_failures:
3021
# Minimum supported dependencies with the latest and oldest PHP version
31-
- php: 8.0
32-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
33-
- php: 7.2
22+
- php: 8.1
3423
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
3524
# Dev-master is allowed to fail.
3625
- env: STABILITY="dev"

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"doctrine/annotations": "^1.13"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "^8.4.1",
26+
"phpunit/phpunit": "^9.6.5",
2727
"mouf/picotainer": "^1.1",
28-
"phpstan/phpstan": "^0.12.14",
28+
"phpstan/phpstan": "^1.8",
2929
"php-coveralls/php-coveralls": "^2.1.0",
3030
"symfony/translation": "^6",
3131
"doctrine/coding-standard": "^11.1"

phpstan.neon

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
parameters:
22
ignoreErrors:
33

4+
excludePaths:
5+
- vendor
6+
- cache
7+
- .phpstan-cache
8+
49
#includes:
510
# - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon

src/Annotations/Assertion.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ class Assertion implements ParameterAnnotationInterface
2828
/** @var Constraint[] */
2929
private $constraint;
3030

31-
/**
32-
* @param array<string, mixed> $values
33-
*/
31+
/** @param array<string, mixed> $values */
3432
public function __construct(array $values)
3533
{
3634
if (! isset($values['for'])) {
@@ -50,9 +48,7 @@ public function getTarget(): string
5048
return $this->for;
5149
}
5250

53-
/**
54-
* @return Constraint[]
55-
*/
51+
/** @return Constraint[] */
5652
public function getConstraint(): array
5753
{
5854
return $this->constraint;

src/ConstraintViolationException.php

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class ConstraintViolationException extends Exception implements GraphQLException
1616
public function __construct(ConstraintViolationInterface $violation)
1717
{
1818
parent::__construct((string) $violation->getMessage(), 400);
19+
1920
$this->violation = $violation;
2021
}
2122

src/Mappers/Parameters/AssertParameterMiddleware.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(ConstraintValidatorFactoryInterface $constraintValid
3939
$this->translator = $translator;
4040
}
4141

42-
public function mapParameter(ReflectionParameter $refParameter, DocBlock $docBlock, ?Type $paramTagType, ParameterAnnotations $parameterAnnotations, ParameterHandlerInterface $next): ParameterInterface
42+
public function mapParameter(ReflectionParameter $refParameter, DocBlock $docBlock, Type|null $paramTagType, ParameterAnnotations $parameterAnnotations, ParameterHandlerInterface $next): ParameterInterface
4343
{
4444
/** @var Assertion[] $assertionAnnotations */
4545
$assertionAnnotations = $parameterAnnotations->getAnnotationsByType(Assertion::class);

src/Mappers/Parameters/ParameterValidator.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ class ParameterValidator implements InputTypeParameterInterface
2929
/** @var TranslatorInterface */
3030
private $translator;
3131

32-
/**
33-
* @param Constraint[] $constraints
34-
*/
32+
/** @param Constraint[] $constraints */
3533
public function __construct(InputTypeParameterInterface $parameter, string $parameterName, array $constraints, ConstraintValidatorFactoryInterface $constraintValidatorFactory, ValidatorInterface $validator, TranslatorInterface $translator)
3634
{
3735
$this->parameter = $parameter;
@@ -48,7 +46,7 @@ public function __construct(InputTypeParameterInterface $parameter, string $para
4846
*
4947
* @return mixed
5048
*/
51-
public function resolve(?object $source, array $args, $context, ResolveInfo $info)
49+
public function resolve(object|null $source, array $args, $context, ResolveInfo $info)
5250
{
5351
$value = $this->parameter->resolve($source, $args, $context, $info);
5452

@@ -79,9 +77,7 @@ public function hasDefaultValue(): bool
7977
return $this->parameter->hasDefaultValue();
8078
}
8179

82-
/**
83-
* @return mixed
84-
*/
80+
/** @return mixed */
8581
public function getDefaultValue()
8682
{
8783
return $this->parameter->getDefaultValue();

src/ValidationFailedException.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ class ValidationFailedException extends InvalidArgumentException implements Grap
1616
/** @var ConstraintViolationException[] */
1717
private $exceptions = [];
1818

19-
/**
20-
* @param ConstraintViolationListInterface<ConstraintViolationInterface> $constraintViolationList
21-
*/
19+
/** @param ConstraintViolationListInterface<ConstraintViolationInterface> $constraintViolationList */
2220
public function __construct(ConstraintViolationListInterface $constraintViolationList)
2321
{
2422
parent::__construct('Validation failed:', 400);
23+
2524
foreach ($constraintViolationList as $constraintViolation) {
2625
$this->add($constraintViolation);
2726
}
@@ -33,9 +32,7 @@ private function add(ConstraintViolationInterface $violation): void
3332
$this->message .= "\n" . $violation->getMessage();
3433
}
3534

36-
/**
37-
* @return (ClientAware&Throwable)[]
38-
*/
35+
/** @return (ClientAware&Throwable)[] */
3936
public function getExceptions(): array
4037
{
4138
return $this->exceptions;

0 commit comments

Comments
 (0)