Skip to content

Commit

Permalink
bumping travis php versions, composer deps, lowering phpstan level (#3)
Browse files Browse the repository at this point in the history
* bumping travis php versions, composer deps, lowering phpstan level

* locking pear tar lib at recent version, tests run in prefer-lowest now
  • Loading branch information
jaydiablo authored Feb 19, 2019
1 parent 5c84038 commit c5dbc59
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 31 deletions.
37 changes: 26 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ language: php

sudo: false

php:
- 7
- 7.1
- 7.2
- nightly

env: TMPDIR=/tmp USE_XDEBUG=false
env:
global:
- COMPOSER_ARGS="" TMPDIR=/tmp USE_XDEBUG=false

branches:
only:
master

install:
- phpenv rehash
- travis_retry composer install --no-interaction --prefer-source
- travis_retry composer update --no-interaction --prefer-source $COMPOSER_ARGS

stages:
- test
Expand All @@ -33,20 +29,39 @@ script:
jobs:
fast_finish: true
allow_failures:
- php: 7.4snapshot
- php: nightly
include:
- php: 7.1
env: COMPOSER_ARGS="--prefer-lowest"
- php: 7.1
- php: 7.2
env: COMPOSER_ARGS="--prefer-lowest"
- php: 7.2
- php: 7.3
env: COMPOSER_ARGS="--prefer-lowest"
- php: 7.3
- php: 7.4snapshot
env: COMPOSER_ARGS="--ignore-platform-reqs --prefer-lowest"
- php: 7.4snapshot
env: COMPOSER_ARGS="--ignore-platform-reqs"
- php: nightly
env: COMPOSER_ARGS="--ignore-platform-reqs --prefer-lowest"
- php: nightly
env: COMPOSER_ARGS="--ignore-platform-reqs"

- stage: style check
php: 7.1
php: 7.2
env: TMPDIR=/tmp USE_XDEBUG=false
script:
- composer style-check
- stage: phpstan analysis
php: 7.1
php: 7.2
env: TMPDIR=/tmp USE_XDEBUG=false
script:
- composer phpstan
- stage: test with coverage
php: 7.1
php: 7.2
env: TMPDIR=/tmp USE_XDEBUG=true CC_TEST_REPORTER_ID=8f28da13e0ea0172cf806fdf90c46437edc8b2bda156e9849e9b2d2215df8cd1
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
}
],
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpstan/phpstan": "^0.9.2",
"phpunit/phpunit": "^7.0",
"phpstan/phpstan": "^0.11.2",
"jetbrains/phpstorm-stubs": "dev-phpstan",
"pear/archive_tar": "^1.4",
"pear/archive_tar": "^1.4.6",
"friendsofphp/php-cs-fixer": "^2.11",
"maglnet/composer-require-checker": "^0.1.6 | ^0.2.1",
"maglnet/composer-require-checker": "^1.1.0",
"phpro/grumphp": "^0.14.0"
},
"include-path": [
Expand All @@ -57,7 +57,7 @@
"scripts": {
"test": "phpunit",
"test-with-coverage": "phpunit --coverage-clover=clover.xml",
"phpstan": "phpstan analyze -l6 -c phpstan.neon --no-progress ./ --ansi",
"phpstan": "phpstan analyze -c phpstan.neon --no-progress --ansi",
"style-check": "php-cs-fixer fix --dry-run -vv"
},
"suggest": {
Expand Down
1 change: 0 additions & 1 deletion grumphp.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ parameters:
allow_risky: true
config: .php_cs
phpstan:
level: 6
configuration: phpstan.neon
phpunit:
metadata:
Expand Down
10 changes: 4 additions & 6 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
parameters:
level: 2
paths:
- ./
excludes_analyse:
- %rootDir%/../../../tests/*
- %rootDir%/../../../vendor/*
bootstrap: %rootDir%/../../../phpstan-bootstrap.php
ignoreErrors:
- '#Casting to .+ something that.s already .+\.#'
# Unusual argument definition where param can either be Zend_Config|array or ...$args (if first param isn't Zend_Config|array)
- '#PHPDoc tag @param references unknown parameter \$charSet#'
- '#PHPDoc tag @param references unknown parameter: \$charSet#'
# No stub for these yet
- '#Function lzf_compress not found\.#'
- '#Function lzf_decompress not found\.#'
- '#Zend_Filter_.+::__construct\(\) does not call parent constructor from Zend_Filter_.+\.#'
- '#Variable \$file might not be defined\.#'
- '#Parameter \#1 \$p_filelist of method Archive_Tar::create\(\) expects array, array\|string given\.#'
- '#Parameter \#3 \$locale of static method Zend_Locale::getTranslation\(\) expects string\|Zend_Locale\|null, array given\.#'
4 changes: 2 additions & 2 deletions src/Zend/Filter/Compress/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ public function compress($content)
if (is_dir($content)) {
// collect all file infos
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($content, RecursiveDirectoryIterator::KEY_AS_PATHNAME),
RecursiveIteratorIterator::SELF_FIRST
new RecursiveDirectoryIterator($content, RecursiveDirectoryIterator::KEY_AS_PATHNAME),
RecursiveIteratorIterator::SELF_FIRST
) as $directory => $info
) {
if ($info->isFile()) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Filter/AlnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function setUp()
$this->_locale = new Zend_Locale('auto');
self::$_meansEnglishAlphabet = in_array(
$this->_locale->getLanguage(),
array('ja')
array('ja')
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Filter/AlphaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function setUp()
$this->_locale = new Zend_Locale('auto');
self::$_meansEnglishAlphabet = in_array(
$this->_locale->getLanguage(),
array('ja')
array('ja')
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Zend/Filter/LocalizedToNormalizedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testDateNormalizationWithoutParameters()
'date_format' => 'dd.MM.y',
'locale' => 'de',
'day' => '20',
'month' => '04',
'month' => '4',
'year' => '2009')
);

Expand All @@ -112,7 +112,7 @@ public function testDateNormalizationWithParameters()
'date_format' => 'yyyy.dd.MM',
'locale' => 'de',
'day' => '20',
'month' => '04',
'month' => '4',
'year' => '2009'),
'2009.20.04' => array(
'date_format' => 'yyyy.dd.MM',
Expand All @@ -130,7 +130,7 @@ public function testDateNormalizationWithParameters()
'date_format' => 'yyyy.dd.MM',
'locale' => 'de',
'day' => '20',
'month' => '04',
'month' => '4',
'year' => '2009')
);

Expand Down Expand Up @@ -169,7 +169,7 @@ public function testNormalizationToFloat()
$valuesExpected = array(
'1.234,5678' => '1234.56',
'1,234' => '1.23',
'1.234' => '1234.00'
'1.234' => '1234'
);

foreach ($valuesExpected as $input => $output) {
Expand Down

0 comments on commit c5dbc59

Please sign in to comment.