-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from bearsunday/refactor
Update QA tools and refactor
- Loading branch information
Showing
12 changed files
with
155 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ tests/stdout.log | |
tmp | ||
|
||
.php_cs.cache | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,54 @@ | ||
language: php | ||
|
||
php: | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
|
||
cache: | ||
directories: | ||
- vendor | ||
- $HOME/.composer/cache | ||
env: | ||
matrix: | ||
- DEPENDENCIES="" | ||
- DEPENDENCIES="--prefer-lowest --prefer-stable" | ||
before_script: | ||
|
||
before_install: | ||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" | ||
- composer self-update | ||
- composer update $DEPENDENCIES | ||
- if [[ $TRAVIS_PHP_VERSION = '7.2' ]]; then COVERAGE="--coverage-clover=coverage.clover"; else phpenv config-rm xdebug.ini; fi | ||
- if [[ $TRAVIS_PHP_VERSION = '7.2' ]]; then composer require --dev phpstan/phpstan-shim ^0.9 friendsofphp/php-cs-fixer; fi | ||
|
||
install: | ||
- composer update | ||
|
||
script: | ||
- ./vendor/bin/phpunit $COVERAGE; | ||
- if [[ $TRAVIS_PHP_VERSION = '7.2' ]]; then vendor/bin/php-cs-fixer fix --verbose --diff --dry-run --config=.php_cs; fi | ||
- if [[ $TRAVIS_PHP_VERSION = '7.2' ]]; then vendor/bin/phpstan analyse -l max -c phpstan.neon src tests --no-progress --no-interaction; fi | ||
after_script: | ||
- if [[ $TRAVIS_PHP_VERSION = '7.2' ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi | ||
- ./vendor/bin/phpunit; | ||
|
||
jobs: | ||
include: | ||
- stage: Test | ||
name: Lowest dependencies | ||
php: 7.2 | ||
install: composer update --prefer-dist --prefer-lowest | ||
|
||
- stage: Test | ||
name: Code coverage | ||
php: 7.2 | ||
before_script: | ||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,} | ||
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi | ||
script: | ||
- ./vendor/bin/phpunit -v --coverage-clover ./build/logs/clover.xml | ||
after_script: | ||
- wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; | ||
|
||
- stage: Code Quality | ||
name: Static analysis | ||
php: 7.2 | ||
install: composer require --dev phpstan/phpstan ^0.11 vimeo/psalm ^3.8; | ||
script: | ||
- ./vendor/bin/phpstan analyse -c phpstan.neon --no-progress --no-interaction; | ||
- ./vendor/bin/psalm --shepherd --stats; | ||
|
||
- stage: Code Quality | ||
name: Coding standards | ||
php: 7.2 | ||
install: composer require --dev friendsofphp/php-cs-fixer ^2.0; | ||
script: | ||
- ./vendor/bin/php-cs-fixer --dry-run -v fix; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
parameters: | ||
ignoreErrors: | ||
- '#Undefined variable#' | ||
- '#Method BEAR\\Package\\Provide\\Router\\AuraRouter::match\(\) should return BEAR\\Sunday\\Extension\\Router\\RouterMatch but returns false.#' | ||
- '#expects bool, BEAR\\Sunday\\Extension\\Router\\RouterMatch#' | ||
- '#Parameter \#1 \$condition of method PHPUnit\\Framework\\Assert::assertFalse\(\)#' | ||
level: max | ||
paths: | ||
- src | ||
- tests | ||
ignoreErrors: | ||
- '#Undefined variable#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
<phpunit bootstrap="tests/bootstrap.php"> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php"> | ||
<testsuites> | ||
<testsuite> | ||
<directory suffix="Test.php">tests</directory> | ||
<testsuite name="all"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
</php> | ||
<filter> | ||
<whitelist> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
<php> | ||
<ini name="error_log" value="./tests/tmp/error.log"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
totallyTyped="false" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
|
||
<issueHandlers> | ||
<LessSpecificReturnType errorLevel="info" /> | ||
|
||
<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives --> | ||
|
||
<DeprecatedMethod errorLevel="info" /> | ||
<DeprecatedProperty errorLevel="info" /> | ||
<DeprecatedClass errorLevel="info" /> | ||
<DeprecatedConstant errorLevel="info" /> | ||
<DeprecatedFunction errorLevel="info" /> | ||
<DeprecatedInterface errorLevel="info" /> | ||
<DeprecatedTrait errorLevel="info" /> | ||
|
||
<InternalMethod errorLevel="info" /> | ||
<InternalProperty errorLevel="info" /> | ||
<InternalClass errorLevel="info" /> | ||
|
||
<MissingClosureReturnType errorLevel="info" /> | ||
<MissingReturnType errorLevel="info" /> | ||
<MissingPropertyType errorLevel="info" /> | ||
<InvalidDocblock errorLevel="info" /> | ||
<MisplacedRequiredParam errorLevel="info" /> | ||
|
||
<PropertyNotSetInConstructor errorLevel="info" /> | ||
<MissingConstructor errorLevel="info" /> | ||
<MissingClosureParamType errorLevel="info" /> | ||
<MissingParamType errorLevel="info" /> | ||
|
||
<RedundantCondition errorLevel="info" /> | ||
|
||
<DocblockTypeContradiction errorLevel="info" /> | ||
<RedundantConditionGivenDocblockType errorLevel="info" /> | ||
|
||
<UnresolvableInclude errorLevel="info" /> | ||
|
||
<RawObjectIteration errorLevel="info" /> | ||
|
||
<InvalidStringClass errorLevel="info" /> | ||
</issueHandlers> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.