Skip to content

Commit 2900317

Browse files
authored
Merge pull request #2 from chimeraphp/upgrade-libs
Upgrade libs
2 parents 37fe7a9 + 330d5a0 commit 2900317

File tree

11 files changed

+34
-52
lines changed

11 files changed

+34
-52
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/.phpcs.cache
55
/composer.lock
66
/infection-log.txt
7+
/.phpunit.result.cache

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
dist: trusty
1+
dist: xenial
22
sudo: false
33
language: php
44

55
php:
66
- 7.2
7+
- 7.3
8+
- 7.4snapshot
79
- nightly
810

911
cache:
@@ -21,9 +23,8 @@ script:
2123

2224
jobs:
2325
allow_failures:
26+
- php: 7.4snapshot
2427
- php: nightly
25-
- env: STATIC_ANALYSIS=1
26-
- env: MUTATION_TESTS=1
2728

2829
include:
2930
- stage: Code Quality
@@ -53,4 +54,4 @@ jobs:
5354
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
5455
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for mutation tests"; exit 1; fi
5556
script:
56-
- ./vendor/bin/infection --test-framework-options='--testsuite unit' --threads=4 --min-msi=100 --min-covered-msi=100
57+
- ./vendor/bin/infection --test-framework-options='--testsuite=unit' --threads=$(nproc) --min-msi=75 --min-covered-msi=77

composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@
1414
"sort-packages": true
1515
},
1616
"require": {
17-
"php": "^7.2",
17+
"php": "^7.2 || ^8.0",
1818
"doctrine/annotations": "^1.6"
1919
},
2020
"require-dev": {
21-
"doctrine/coding-standard": "^4.0",
22-
"infection/infection": "dev-master@dev",
23-
"phpstan/phpdoc-parser": "^0.3@dev",
24-
"phpstan/phpstan": "^0.10@dev",
25-
"phpstan/phpstan-phpunit": "^0.10@dev",
26-
"phpstan/phpstan-strict-rules": "^0.10@dev",
27-
"phpunit/phpunit": "^7.1",
28-
"squizlabs/php_codesniffer": "^3.2"
21+
"infection/infection": "^0.12",
22+
"lcobucci/coding-standard": "^2.0",
23+
"phpstan/phpstan": "^0.11",
24+
"phpstan/phpstan-deprecation-rules": "^0.11",
25+
"phpstan/phpstan-phpunit": "^0.11",
26+
"phpstan/phpstan-strict-rules": "^0.11",
27+
"phpunit/phpunit": "^8.0"
2928
},
3029
"autoload": {
3130
"psr-4": {

phpcs.xml.dist

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,7 @@
1313
<file>src</file>
1414
<file>tests</file>
1515

16-
<rule ref="Doctrine">
17-
<exclude name="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment" />
18-
</rule>
19-
20-
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
21-
<properties>
22-
<property name="newlinesCountBetweenOpenTagAndDeclare" value="1"/>
23-
<property name="spacesCountAroundEqualsSign" value="0"/>
24-
<property name="newlinesCountAfterDeclare" value="2"/>
25-
</properties>
26-
</rule>
27-
28-
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
29-
<properties>
30-
<property name="spacesCountBeforeColon" value="0"/>
31-
</properties>
32-
</rule>
33-
34-
<rule ref="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment" />
16+
<rule ref="Lcobucci" />
3517

3618
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
3719
<exclude-pattern>tests/Functional</exclude-pattern>

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ includes:
22
- vendor/phpstan/phpstan-phpunit/extension.neon
33
- vendor/phpstan/phpstan-phpunit/rules.neon
44
- vendor/phpstan/phpstan-strict-rules/rules.neon
5+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
56

67
parameters:
78
level: 7
89
paths:
910
- src
1011
- tests
12+
13+
ignoreErrors:
14+
- '#Call to deprecated method registerUniqueLoader\(\) of class Doctrine\\Common\\Annotations\\AnnotationRegistry#'

src/Routing/Endpoint.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Chimera\Mapping\Annotation;
77
use Chimera\Mapping\Validator;
88
use Doctrine\Common\Annotations\AnnotationException;
9-
use function get_class;
109

1110
abstract class Endpoint implements Annotation
1211
{
@@ -48,7 +47,7 @@ public function __construct(array $values)
4847
*/
4948
public function validate(string $context): void
5049
{
51-
$validator = new Validator(get_class($this), $context);
50+
$validator = new Validator(static::class, $context);
5251
$validator->requiredScalar('path', 'string', $this->path);
5352
$validator->requiredScalar('name', 'string', $this->name);
5453
$validator->nonRequiredScalar('app', 'string', $this->app);

src/Routing/Middleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(array $values)
4343
*/
4444
public function validate(string $context): void
4545
{
46-
$validator = new Validator(__CLASS__, $context);
46+
$validator = new Validator(self::class, $context);
4747
$validator->requiredScalar('path', 'string', $this->path);
4848
$validator->nonRequiredScalar('app', 'string', $this->app);
4949
$validator->nonRequiredScalar('priority', 'integer', $this->priority);

src/ServiceBus/CommandHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
final class CommandHandler implements AnnotationInterface
1515
{
1616
/**
17-
*
1817
* @var string
1918
*/
2019
public $handles;
@@ -32,7 +31,7 @@ public function __construct(array $values)
3231
*/
3332
public function validate(string $context): void
3433
{
35-
$validator = new Validator(__CLASS__, $context);
34+
$validator = new Validator(self::class, $context);
3635
$validator->requiredScalar('handles', 'string', $this->handles);
3736
}
3837
}

src/ServiceBus/Middleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(array $values)
3737
*/
3838
public function validate(string $context): void
3939
{
40-
$validator = new Validator(__CLASS__, $context);
40+
$validator = new Validator(self::class, $context);
4141
$validator->nonRequiredScalar('bus', 'string', $this->bus);
4242
$validator->requiredScalar('priority', 'integer', $this->priority);
4343
}

src/ServiceBus/QueryHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ final class QueryHandler implements AnnotationInterface
1515
{
1616
/**
1717
* @Required
18-
*
1918
* @var string
2019
*/
2120
public $handles;
@@ -33,7 +32,7 @@ public function __construct(array $values)
3332
*/
3433
public function validate(string $context): void
3534
{
36-
$validator = new Validator(__CLASS__, $context);
35+
$validator = new Validator(self::class, $context);
3736
$validator->requiredScalar('handles', 'string', $this->handles);
3837
}
3938
}

0 commit comments

Comments
 (0)