Skip to content

Commit

Permalink
Merge 600ea5d into 516caff
Browse files Browse the repository at this point in the history
  • Loading branch information
mimmi20 committed Jan 15, 2019
2 parents 516caff + 600ea5d commit 3582e06
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 36 deletions.
8 changes: 7 additions & 1 deletion .php_cs
@@ -1,12 +1,16 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src');
->in(__DIR__ . '/src')
->append([__FILE__]);

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
Expand Down Expand Up @@ -46,6 +50,8 @@ return PhpCsFixer\Config::create()
'strict_param' => true,
'yoda_style' => false,
'native_function_invocation' => false,
'declare_strict_types' => false,
'blank_line_after_opening_tag' => false,
])
->setRiskyAllowed(true)
->setFinder($finder);
60 changes: 43 additions & 17 deletions .travis.yml
Expand Up @@ -10,29 +10,55 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3
- nightly

matrix:
fast_finish: true
allow_failures:
- php: nightly
include:
- php: 7.0
env: dependencies=lowest
env:
- COMPOSER_FLAGS="--prefer-lowest"
- COMPOSER_FLAGS=""

stages:
- static code analysis
- test
- test with coverage

cache:
directories:
- $HOME/.composer/cache

before_script:
- if [[ $(phpenv version-name) == '7.1' ]]; then composer require satooshi/php-coveralls '~1.0' -n ; fi
- if [[ $(phpenv version-name) != '7.1' ]]; then composer install -n ; fi
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-stable -n; fi;
before_install:
- phpenv config-rm xdebug.ini || echo "xdebug not available"
- composer self-update

install: travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest $COMPOSER_FLAGS -vv

script: vendor/bin/phpunit --colors --columns 117 --no-coverage

jobs:
allow_failures:
- php: 7.3
- php: nightly
include:
- php: nightly
env: COMPOSER_FLAGS="--ignore-platform-reqs"

- stage: test with coverage
os: linux
php: 7.1
env: COMPOSER_FLAGS=""
before_install: composer self-update
script: vendor/bin/phpunit --colors --coverage-clover=clover.xml --coverage-text
after_success:
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar && php -n php-coveralls.phar --verbose --coverage_clover=clover.xml

script:
- if [[ $(phpenv version-name) == '7.1' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi
- if [[ $(phpenv version-name) != '7.1' ]]; then vendor/bin/phpunit ; fi
- if [[ $(phpenv version-name) != '7.1' ]]; then vendor/bin/phpstan analyse -l 6 -c phpstan.neon src ; fi
- stage: static code analysis
os: linux
php: 7.0
env: COMPOSER_FLAGS=""
script: vendor/bin/php-cs-fixer fix --dry-run -vv

after_script:
- if [[ $(phpenv version-name) == '7.1' ]]; then php vendor/bin/coveralls -v ; fi
- stage: static code analysis
os: linux
php: 7.0
env: COMPOSER_FLAGS=""
script: vendor/bin/phpstan analyse -l 6 -c phpstan.neon --no-progress src
9 changes: 6 additions & 3 deletions composer.json
Expand Up @@ -33,12 +33,15 @@
"nikic/php-parser": "^2.0|^3.0|^4.0"
},
"require-dev": {
"phpunit/phpunit": "~6.4",
"sebastian/diff": "^2.0|^3.0",
"phpunit/phpunit-mock-objects": "~4.0|~5.0|~6.0",
"phpunit/phpunit": "~6.4|~7.0",
"mnapoli/phpunit-easymock": "~1.0",
"doctrine/annotations": "~1.2",
"ocramius/proxy-manager": "~2.0.2",
"ocramius/package-versions": "^1.2.0",
"ocramius/proxy-manager": "~2.0.4|~2.1.0|~2.2.0",
"friendsofphp/php-cs-fixer": "^2.4",
"phpstan/phpstan": "^0.9.2"
"phpstan/phpstan": "^0.9.2|^0.10.0"
},
"provide": {
"psr/container-implementation": "^1.0"
Expand Down
10 changes: 5 additions & 5 deletions phpstan.neon
@@ -1,6 +1,6 @@
parameters:
excludes_analyse:
- %rootDir%/../../../src/Compiler/Template.php
ignoreErrors:
- '#Access to undefined constant DI\\CompiledContainer::METHOD_MAPPING.#'
- '#Function apcu_.* not found.#'
excludes_analyse:
- %rootDir%/../../../src/Compiler/Template.php
ignoreErrors:
- '#Access to undefined constant DI\\CompiledContainer::METHOD_MAPPING.#'
- '#Function apcu_.* not found.#'
35 changes: 25 additions & 10 deletions phpunit.xml.dist
Expand Up @@ -2,15 +2,30 @@
<!--
phpunit -c phpunit.xml
-->
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
syntaxCheck="true"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="./vendor/autoload.php">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="false"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
failOnWarning="true"
verbose="false"
bootstrap="vendor/autoload.php"
enforceTimeLimit="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<php>
<ini name="error_reporting" value="-1"/>
<ini name="memory_limit" value="-1"/>
<ini name="date.timezone" value="UTC"/>
</php>

<testsuites>
<testsuite name="unit">
Expand All @@ -22,7 +37,7 @@
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<file>src/Compiler/Template.php</file>
Expand Down

0 comments on commit 3582e06

Please sign in to comment.