Skip to content

Commit

Permalink
bumping travis php versions, composer deps, fixing phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydiablo committed Feb 20, 2019
1 parent 4aa6b50 commit d391737
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 23 deletions.
40 changes: 26 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +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

before_install:
- travis_retry composer self-update

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 @@ -36,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=c964e41d1172f4b5f6acacc03cf11021373e2f94e290843590586ad45e3c77ac
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
}
],
"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",
"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"
},
"archive": {
Expand All @@ -53,7 +53,7 @@
"scripts": {
"test": "phpunit ./tests",
"test-with-coverage": "phpunit --coverage-clover=clover.xml",
"phpstan": "phpstan analyze -l7 -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: 7
configuration: phpstan.neon
phpunit:
metadata:
Expand Down
24 changes: 22 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
parameters:
level: 7
paths:
- ./
excludes_analyse:
- %rootDir%/../../../tests/*
- %rootDir%/../../../vendor/*
bootstrap: %rootDir%/../../../phpstan-bootstrap.php
ignoreErrors:
- '#Casting to string something that.s already string\.#'
- '#Strict comparison using !== between null and array\|Zend_Config will always evaluate to true\.#'
# These seem like they need to be updated in phpstan (function signature stuff)
- '#Parameter \#3 \$severe of function monitor_custom_event expects severe, int given\.#'
- '#Parameter \#4 \$user_data of function monitor_custom_event expects user_data, array given\.#'
# Zend_Config has an __isset overload defined so that these array-like calls will work
- '#Cannot assign offset .+ to .?array.?\|Zend_Config\.#'
# call_user_func does accept an array as the callable
- '#Parameter \#1 \$function of function call_user_func expects callable\(\): mixed, array\(string, .factory.\) given\.#'
-
message: '#Parameter \#2 \$priority of method Zend_Log::log\(\) expects int, int\|string\|false given\.#'
path: %currentWorkingDirectory%/src/Zend/Log.php
-
message: '#Cannot assign offset int to array\|bool\.#'
path: %currentWorkingDirectory%/src/Zend/Log.php
-
message: '#Property Zend_Log_Writer_Stream::\$_stream \(resource\|null\) does not accept resource\|false\.#'
path: %currentWorkingDirectory%/src/Zend/Log/Writer/Stream.php
-
message: '#Parameter \#1 \$fp of function fwrite expects resource, resource\|null given\.#'
path: %currentWorkingDirectory%/src/Zend/Log/Writer/Stream.php
2 changes: 1 addition & 1 deletion src/Zend/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Zend_Log

/**
*
* @var callable
* @var callable|null
*/
protected $_origErrorHandler = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Zend/Log/Filter/Priority.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ public static function factory($config)
*/
public function accept($event)
{
return version_compare($event['priority'], $this->_priority, $this->_operator);
return version_compare($event['priority'], (string) $this->_priority, $this->_operator);
}
}

0 comments on commit d391737

Please sign in to comment.