-
Notifications
You must be signed in to change notification settings - Fork 3
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 #24 from bearsunday/cleanup
Cleanup for the release
- Loading branch information
Showing
13 changed files
with
148 additions
and
82 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
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,25 +1,57 @@ | ||
language: php | ||
sudo: false | ||
|
||
php: | ||
- 7 | ||
- 7.1 | ||
- 7.2 | ||
- 7.3 | ||
|
||
cache: | ||
directories: | ||
- vendor | ||
- $HOME/.composer/cache | ||
env: | ||
matrix: | ||
- DEPENDENCIES='' | ||
- DEPENDENCIES='--prefer-lowest --prefer-stable' | ||
before_script: | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
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.1' && DEPENDENCIES = '' ]]; then COVERAGE="--coverage-clover=coverage.clover"; else phpenv config-rm xdebug.ini; fi | ||
- if [[ $TRAVIS_PHP_VERSION = '7.1' && DEPENDENCIES = '' ]]; then composer require --dev phpstan/phpstan-shim friendsofphp/php-cs-fixer; fi | ||
|
||
install: | ||
- composer update | ||
|
||
script: | ||
- ./vendor/bin/phpunit $COVERAGE; | ||
- if [[ $TRAVIS_PHP_VERSION = '7.1' && DEPENDENCIES = '' ]]; then IFS=$'\n'; COMMIT_SCA_FILES=($(git diff --name-only --diff-filter=ACMRTUXB "${TRAVIS_COMMIT_RANGE}")); unset IFS && ./vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --stop-on-violation --using-cache=no --path-mode=intersection -- "${COMMIT_SCA_FILES[@]}";fi | ||
- if [[ $TRAVIS_PHP_VERSION = '7.1' && DEPENDENCIES = '' ]]; then ./vendor/bin/phpstan analyse -l max -c phpstan.neon src tests --no-progress --no-interaction; fi | ||
after_script: | ||
- if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; 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-shim ^0.11; | ||
script: | ||
- ./vendor/bin/phpstan analyse -l max -c phpstan.neon src tests --no-progress --no-interaction; | ||
|
||
- 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
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,20 +1,19 @@ | ||
<?xml version="1.0"?> | ||
<ruleset> | ||
<!-- 2. General --> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="PHP_CodeSniffer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> | ||
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/> | ||
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> | ||
<rule ref="Generic.Strings.UnnecessaryStringConcat"/> | ||
<!-- Include the whole PSR-2 standard --> | ||
<rule ref="PSR2"> | ||
<exclude name="Generic.Files.LineLength"/> | ||
</rule> | ||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/> | ||
<rule ref="PEAR.Commenting.FunctionComment"> | ||
<exclude name="PEAR.Commenting.FunctionComment.MissingReturn"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamComment"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeTags"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamTag"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.Missing"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.ParamNameNoMatch"/> | ||
</rule> | ||
</ruleset> |
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,40 +1,39 @@ | ||
<ruleset xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="PHPMD rule set" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | ||
<!--codesize--> | ||
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" /> | ||
<rule ref="rulesets/codesize.xml/NPathComplexity" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveClassLength" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" /> | ||
<rule ref="rulesets/codesize.xml/ExcessivePublicCount" /> | ||
<rule ref="rulesets/codesize.xml/TooManyFields" /> | ||
<rule ref="rulesets/codesize.xml/TooManyMethods" /> | ||
<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/> | ||
<rule ref="rulesets/codesize.xml/NPathComplexity"/> | ||
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity"/> | ||
<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/> | ||
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/> | ||
<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/> | ||
<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/> | ||
<rule ref="rulesets/codesize.xml/TooManyFields"/> | ||
<rule ref="rulesets/codesize.xml/TooManyMethods"/> | ||
<!--design--> | ||
<rule ref="rulesets/design.xml/EvalExpression" /> | ||
<rule ref="rulesets/design.xml/ExitExpression" /> | ||
<rule ref="rulesets/design.xml/EvalExpression"/> | ||
<rule ref="rulesets/design.xml/ExitExpression"/> | ||
<rule ref="rulesets/design.xml/GotoStatement" /> | ||
<rule ref="rulesets/design.xml/NumberOfChildren" /> | ||
<rule ref="rulesets/design.xml/DepthOfInheritance" /> | ||
<rule ref="rulesets/design.xml/CouplingBetweenObjects" /> | ||
<rule ref="rulesets/design.xml/NumberOfChildren"/> | ||
<rule ref="rulesets/design.xml/DepthOfInheritance"/> | ||
<!-- <rule ref="rulesets/design.xml/CouplingBetweenObjects" /> --> | ||
<!--naming--> | ||
<rule ref="rulesets/naming.xml/ConstantNamingConventions" /> | ||
<rule ref="rulesets/naming.xml/BooleanGetMethodName" /> | ||
<rule ref="rulesets/naming.xml/ConstantNamingConventions"/> | ||
<rule ref="rulesets/naming.xml/BooleanGetMethodName"/> | ||
<!--unusedcode--> | ||
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/> | ||
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/> | ||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/> | ||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/> | ||
<!--controversial--> | ||
<rule ref="rulesets/controversial.xml/Superglobals" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseClassName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCasePropertyName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseMethodName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseParameterName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseVariableName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/> | ||
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/> | ||
<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/> | ||
<!--cleancode--> | ||
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" /> | ||
<rule ref="rulesets/cleancode.xml/ElseExpression" /> | ||
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/> | ||
<rule ref="rulesets/cleancode.xml/ElseExpression" /> | ||
</ruleset> |
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,12 +1,18 @@ | ||
<phpunit bootstrap="vendor/autoload.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>./tests</directory> | ||
<testsuite name="all"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
</php> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src</directory> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
</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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
declare(strict_types=1); | ||
|
||
|
||
namespace BEAR\AppMeta; | ||
|
||
use BEAR\AppMeta\Exception\AppNameException; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
declare(strict_types=1); | ||
|
||
|
||
namespace BEAR\AppMeta; | ||
|
||
final class ResMeta | ||
|
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
Oops, something went wrong.