Skip to content

Commit 1805077

Browse files
authored
Merge pull request #5 from moufmouf/doctrine-coding-standard-7
Upgrading to Doctrine Coding Standard 7
2 parents 631b39d + 8fd9117 commit 1805077

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.travis.yml

Lines changed: 5 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.3
18+
- php: 7.4
1919
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
2020

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

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

2929
allow_failures:
3030
# Minimum supported dependencies with the latest and oldest PHP version
31-
- php: 7.3
31+
- php: 7.4
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"
@@ -48,6 +48,7 @@ install:
4848
script:
4949
- composer validate --strict --no-check-lock
5050
- composer phpstan
51+
- composer cs-check
5152
- ./vendor/bin/phpunit
5253

5354
after_script:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"phpstan/phpstan": "^0.11.16",
2929
"php-coveralls/php-coveralls": "^2.1.0",
3030
"symfony/translation": "^4",
31-
"doctrine/coding-standard": "^6.0"
31+
"doctrine/coding-standard": "^7.0"
3232
},
3333
"scripts": {
3434
"phpstan": "phpstan analyse src/ -c phpstan.neon --level=7 --no-progress",

phpcs.xml.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,11 @@
4242
<property name="spacesCountBeforeColon" value="0"/>
4343
</properties>
4444
</rule>
45+
46+
<!-- Disable PHP 7.4 type hints since we need to support PHP 7.2+ -->
47+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
48+
<properties>
49+
<property name="enableNativeTypeHint" value="false"/>
50+
</properties>
51+
</rule>
4552
</ruleset>

src/Annotations/Assertion.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ public function __construct(array $values)
3535
if (! isset($values['for'])) {
3636
throw new BadMethodCallException('The @Assert annotation must be passed a target. For instance: "@Assert(for="$email", constraint=@Email)"');
3737
}
38+
3839
if (! isset($values['constraint'])) {
3940
throw new BadMethodCallException('The @Assert annotation must be passed one or many constraints. For instance: "@Assert(for="$email", constraint=@Email)"');
4041
}
42+
4143
$this->for = ltrim($values['for'], '$');
4244
$this->constraint = is_array($values['constraint']) ? $values['constraint'] : [ $values['constraint'] ];
4345
}

src/ConstraintViolationException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function getExtensions(): array
4949
if ($code !== null) {
5050
$extensions['code'] = $code;
5151
}
52+
5253
$propertyPath = $this->violation->getPropertyPath();
5354
if ($propertyPath !== null) {
5455
$extensions['field'] = $propertyPath;

0 commit comments

Comments
 (0)