Skip to content

Commit

Permalink
testing against php 7.4 final, fixing/ignoring phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydiablo committed Jan 8, 2020
1 parent c8895ee commit 51028f1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ script:
jobs:
fast_finish: true
allow_failures:
- php: 7.4snapshot
- php: nightly
include:
- php: 7.1
Expand All @@ -49,15 +48,14 @@ jobs:
- 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: 7.4
env: COMPOSER_ARGS="--prefer-lowest"
- php: 7.4
- php: nightly
env: COMPOSER_ARGS="--ignore-platform-reqs --prefer-lowest"
- php: nightly
env: COMPOSER_ARGS="--ignore-platform-reqs"

- stage: style check
php: 7.2
env: TMPDIR=/tmp USE_XDEBUG=false
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
},
"require-dev": {
"phpunit/phpunit": "^7.0",
"phpstan/phpstan": "0.11.19",
"phpstan/phpstan": "0.12.3",
"friendsofphp/php-cs-fixer": "2.16.1",
"maglnet/composer-require-checker": "^1.1.0 || ^2.0.0",
"phpro/grumphp": "^0.14.0 || ^0.15.0 || ^0.16.0"
"phpro/grumphp": "^0.16.0"
},
"archive": {
"exclude": ["/tests"]
Expand Down
15 changes: 11 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
parameters:
level: 7
level: 8
inferPrivatePropertyTypeFromConstructor: true
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
paths:
- ./
excludes_analyse:
Expand All @@ -9,8 +11,6 @@ parameters:
ignoreErrors:
# ZF seems to believe that the getName method on ReflectionFunction may return "null", doesn't seem to unless given parameters
- '#Strict comparison using === between null and string will always evaluate to false\.#'
# This seems intentional, they're close but not quite the same
- '#Zend_Server_Reflection_Method::__construct\(\) does not call parent constructor from Zend_Server_Reflection_Function_Abstract\.#'
# This might be a bug, I didn't look at all of the code above it, but $_reflection could be ReflectionFunction or ReflectionMethod
# only ReflectionMethod has this method on it
- '#Call to an undefined method ReflectionFunction\|ReflectionMethod::getDeclaringClass\(\)\.#'
Expand All @@ -28,4 +28,11 @@ parameters:
path: %currentWorkingDirectory%/src/Zend/Server/Reflection/Parameter.php
# Defensive coding, can't be enforced by PHP typehints
- '#Result of && is always false\.#'
- '#Strict comparison using !== between null and null will always evaluate to false\.#'
- '#Strict comparison using !== between null and null will always evaluate to false\.#'
- '#Parameter \#1 \$argument of class ReflectionClass constructor expects class-string<T of object>\|T of object, .+ given\.#'
-
message: '#Parameter \#1 \$args of method ReflectionClass<mixed>::newInstanceArgs\(\) expects array<int, mixed>, array given\.#'
path: './src/Zend/Server/Abstract.php'
-
message: '#Parameter \#3 \$argv of class Zend_Server_Reflection_Function constructor expects array, array\|false\|null given\.#'
path: './src/Zend/Server/Reflection.php'
3 changes: 3 additions & 0 deletions src/Zend/Server/Reflection/Class.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public function __construct(ReflectionClass $reflection, $namespace = null, $arg
$this->setMethods();
}

/**
* @return void
*/
private function setMethods()
{
foreach ($this->_reflection->getMethods() as $method) {
Expand Down
20 changes: 19 additions & 1 deletion src/Zend/Server/Reflection/Function/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,33 @@ abstract class Zend_Server_Reflection_Function_Abstract
* @var string|array
*/
private $_return;

/**
* @var string
*/
private $_returnDesc;

/**
* @var array
*/
private $_paramDesc;

/**
* @var array
*/
private $_sigParams;

/**
* @var int
*/
private $_sigParamsDepth;

/**
* Constructor
*
* @param ReflectionFunction|ReflectionMethod $r
* @param string $namespace
* @param array $argv
*/
public function __construct(Reflector $r, $namespace = null, $argv = array())
{
Expand Down Expand Up @@ -190,7 +208,7 @@ protected function _buildTree()
* @param string $returnDesc Return value description
* @param array $paramTypes Array of arguments (each an array of types)
* @param array $paramDesc Array of parameter descriptions
* @return array
* @return void
*/
protected function _buildSignatures($return, $returnDesc, $paramTypes, $paramDesc)
{
Expand Down

0 comments on commit 51028f1

Please sign in to comment.