Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update phpstan/phpstan requirement from 0.12.42 to 0.12.81 #96

Merged
merged 3 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ trim_trailing_whitespace = true
[*.{php,json,neon}]
indent_style = space
indent_size = 4

[.travis.yml]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"phpstan/phpstan": "0.12.42",
"phpstan/phpstan": "0.12.81",
"friendsofphp/php-cs-fixer": "2.18.3",
"maglnet/composer-require-checker": "^1.1.0 || ^2.0.0",
"phpro/grumphp-shim": "^0.22.0 || ^1.1"
Expand Down
19 changes: 14 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,28 @@ parameters:
- %rootDir%/../../../tests/*
- %rootDir%/../../../vendor/*
ignoreErrors:
# This isn't true, if session module isn't loaded, $_SESSION var won't be set
- '#Variable \$_SESSION in isset\(\) always exists and is not nullable\.#'
# Arrays can be callable
-
message: '#Parameter \#1 \$error_handler of function set_error_handler expects \(callable\(int, string, string, int, array\): bool\)\|null, array\(.Zend_Session…., .handleSessionStartE….\) given\.#'
message: '#Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int, array\): bool\)\|null, array\(.Zend_Session…., .handleSessionStartE….\) given\.#'
path: %currentWorkingDirectory%/src/Zend/Session.php
-
message: '#Parameter \#1 \$error_handler of function set_error_handler expects \(callable\(int, string, string, int, array\): bool\)\|null, array\(.Zend_Session…., .handleSilentWriteCl….\) given\.#'
message: '#Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int, array\): bool\)\|null, array\(.Zend_Session…., .handleSilentWriteCl….\) given\.#'
path: %currentWorkingDirectory%/src/Zend/Session.php
-
message: '#Parameter \#6 \$gc of function session_set_save_handler expects callable\(string\): bool, array\(Zend_Session_SaveHandler_Interface, .gc.\) given\.#'
path: %currentWorkingDirectory%/src/Zend/Session.php
# I think phpstan doesn't like the type of the closure here
-
message: '#Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int, array\): bool\)\|null, Closure\(mixed, mixed, mixed, mixed, mixed\): void given\.#'
path: './src/Zend/Session.php'
# Session extension is required by composer, shouldn't hit false here
-
message: '#Argument of an invalid type array\|false supplied for foreach, only iterables are supported\.#'
path: './src/Zend/Session.php'
path: './src/Zend/Session.php'
# PHPStan is inferring using reflection I think, docs don't show false (phpstan is probably correct but not going to change code for now)
-
message: '#Method Zend_Session::getId\(\) should return string but returns string\|false\.#'
path: './src/Zend/Session.php'
-
message: '#Parameter \#1 \$name of function setcookie expects string, string\|false given\.#'
path: './src/Zend/Session.php'
6 changes: 0 additions & 6 deletions tests/Zend/Session/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,12 +801,6 @@ public function testUnsetAllNamespace()
*/
public function testSetExpirationSeconds()
{
if (getenv('TRAVIS')) {
$this->markTestSkipped(
'Test randomly fail on Travis CI.'
);
}

// Calculate common script execution time
$startTime = time();
exec($this->_script, $result, $returnValue);
Expand Down