Skip to content

Commit 6bf93d1

Browse files
committed
Test PHP 7.4 in travis & upgrade PHPStan
1 parent d699f86 commit 6bf93d1

15 files changed

Lines changed: 143 additions & 1252 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
/ruleset.xml export-ignore
1111
/.editorconfig export-ignore
1212
/phpstan.neon export-ignore
13+
/phpstan_base.neon export-ignore
14+
/phpstan-baseline.neon export-ignore
1315
/psalm.xml export-ignore
1416
/psalm-baseline.xml export-ignore
1517
/vendor-bin export-ignore

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ language: php
66
php:
77
- '7.2'
88
- '7.3'
9+
- '7.4'
910

1011
before_script:
1112
- composer self-update
@@ -15,10 +16,10 @@ before_script:
1516
- ./cc-test-reporter before-build
1617

1718
script:
18-
- vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
19-
- vendor/bin/phpstan analyse src --level=7
20-
- vendor/bin/psalm
21-
- vendor/bin/phpcs --standard=ruleset.xml --extensions=php src tests
19+
- composer phpunit_clover
20+
- composer phpstan
21+
- composer psalm
22+
- composer phpcs
2223
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build -t clover --exit-code $TRAVIS_TEST_RESULT; fi
2324

2425
notifications:

captainhook.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@
2525
"conditions": []
2626
},
2727
{
28-
"action": "vendor/bin/phpunit",
28+
"action": "composer phpunit",
2929
"options": [],
3030
"conditions": []
3131
},
3232
{
33-
"action": "vendor/bin/phpstan analyse src --level=7",
33+
"action": "composer phpstan",
3434
"options": [],
3535
"conditions": []
3636
},
3737
{
38-
"action": "vendor/bin/psalm",
38+
"action": "composer psalm",
3939
"options": [],
4040
"conditions": []
4141
},
4242
{
43-
"action": "vendor/bin/phpcs --standard=ruleset.xml --extensions=php --cache src tests",
43+
"action": "composer phpcs",
4444
"options": [],
4545
"conditions": []
4646
}

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,18 @@
4343
}
4444
},
4545
"scripts": {
46-
"bin": "echo 'bin not installed'",
4746
"post-install-cmd": ["@composer bin all install --ansi"],
4847
"post-update-cmd": ["@composer bin all update --ansi"],
49-
"phpstan": "vendor/bin/phpstan analyse src --level=7",
48+
"phpstan": "vendor/bin/phpstan analyse",
49+
"phpstan_base": "vendor/bin/phpstan analyse --configuration phpstan_base.neon --error-format baselineNeon > phpstan-baseline.neon",
5050
"psalm": "vendor/bin/psalm --show-info=false",
5151
"psalm_base": "vendor/bin/psalm --set-baseline=psalm-baseline.xml",
5252
"phpunit": "vendor/bin/phpunit --colors=always",
53+
"phpunit_clover": "vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml",
5354
"phpcs": "vendor/bin/phpcs --standard=ruleset.xml --extensions=php --cache src tests",
5455
"phpcsfix": "vendor/bin/phpcbf --standard=ruleset.xml --extensions=php --cache src tests",
55-
"codecoverage": "vendor/bin/phpunit --coverage-html tests/_reports"
56+
"codecoverage": "vendor/bin/phpunit --coverage-html tests/_reports",
57+
"binupdate": "@composer bin all update --ansi",
58+
"bininstall": "@composer bin all install --ansi"
5659
}
5760
}

examples/Order.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class Order
1717
* @Assert\NotNull()
1818
* @Assert\Type(type="Squirrel\ValidatorCascade\Examples\Address")
1919
* @Cascade(trigger={"Default", "phoneNumberMandatory"})
20+
*
21+
* @var Address
2022
*/
2123
public $shippingAddress;
2224

@@ -30,6 +32,8 @@ class Order
3032
* @Assert\NotNull()
3133
* @Assert\Type(type="Squirrel\ValidatorCascade\Examples\Address")
3234
* @Cascade(groups="alternateInvoiceAddress")
35+
*
36+
* @var Address
3337
*/
3438
public $invoiceAddress;
3539

@@ -40,6 +44,8 @@ class Order
4044
* @Assert\NotNull()
4145
* @Assert\Type(type="Squirrel\ValidatorCascade\Examples\Address")
4246
* @Cascade(trigger="phoneNumberMandatory")
47+
*
48+
* @var Address
4349
*/
4450
public $phoneNumberOnlyAddress;
4551
}

phpstan-baseline.neon

Whitespace-only changes.

phpstan.neon

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: 8
6+
paths:
7+
- src
8+
- examples
9+
checkMissingIterableValueType: false

phpstan_base.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: 8
3+
paths:
4+
- src
5+
- examples
6+
checkMissingIterableValueType: false

psalm-baseline.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="3.7.2@d9cae720c1af31db9ba27c2bc1fcf9b0dd092fb0">
3+
<file src="examples/Address.php">
4+
<MissingConstructor occurrences="1">
5+
<code>$street</code>
6+
</MissingConstructor>
7+
</file>
8+
<file src="examples/Order.php">
9+
<MissingConstructor occurrences="1">
10+
<code>$shippingAddress</code>
11+
</MissingConstructor>
12+
</file>
13+
</files>

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xmlns="https://getpsalm.org/schema/config"
66
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7+
errorBaseline="psalm-baseline.xml"
78
>
89
<projectFiles>
910
<directory name="src" />
11+
<directory name="examples" />
1012
<ignoreFiles>
1113
<directory name="vendor" />
1214
</ignoreFiles>

0 commit comments

Comments
 (0)