mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-12-02 09:27:56 +01:00
Merge branch 'master' into suppress-redundant-casts
This commit is contained in:
commit
3029751dd4
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -3,6 +3,6 @@
|
|||||||
/.gitignore export-ignore
|
/.gitignore export-ignore
|
||||||
/phpcs.xml.dist export-ignore
|
/phpcs.xml.dist export-ignore
|
||||||
/psalm.xml.dist export-ignore
|
/psalm.xml.dist export-ignore
|
||||||
/.travis.yml export-ignore
|
|
||||||
/README.md export-ignore
|
/README.md export-ignore
|
||||||
/codeception.yml export-ignore
|
/codeception.yml export-ignore
|
||||||
|
/.github export-ignore
|
||||||
|
51
.travis.yml
51
.travis.yml
@ -1,51 +0,0 @@
|
|||||||
language: php
|
|
||||||
php:
|
|
||||||
- 7.3
|
|
||||||
- 7.4
|
|
||||||
- nightly
|
|
||||||
before_install:
|
|
||||||
- phpenv config-rm xdebug.ini || true
|
|
||||||
|
|
||||||
install:
|
|
||||||
- composer config --global discard-changes true
|
|
||||||
- travis_retry composer install
|
|
||||||
- if [[ "$DEPS" = 'high' || "$DEPS" = 'dev' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS update; fi
|
|
||||||
- if [[ "$DEPS" = 'high' ]]; then composer require $DEFAULT_COMPOSER_FLAGS --prefer-stable --update-with-dependencies vimeo/psalm; fi
|
|
||||||
- if [[ "$DEPS" = 'low' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-lowest --prefer-stable update; fi
|
|
||||||
- if [[ "$DEPS" = 'stable' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-stable update; fi
|
|
||||||
- ./vendor/bin/psalm --version
|
|
||||||
|
|
||||||
script: composer check
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-suggest"
|
|
||||||
jobs:
|
|
||||||
- DEPS="low"
|
|
||||||
- DEPS="high"
|
|
||||||
- DEPS="stable"
|
|
||||||
- DEPS="dev"
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/.composer/cache/files
|
|
||||||
- $HOME/.composer/cache/vcs
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
allow_failures:
|
|
||||||
- php: 7.1
|
|
||||||
env: DEPS="dev"
|
|
||||||
- php: 7.2
|
|
||||||
env: DEPS="dev"
|
|
||||||
- php: 7.3
|
|
||||||
env: DEPS="dev"
|
|
||||||
- php: 7.4
|
|
||||||
env: DEPS="dev"
|
|
||||||
- php: nightly
|
|
||||||
env: DEPS="low"
|
|
||||||
- php: nightly
|
|
||||||
env: DEPS="high"
|
|
||||||
- php: nightly
|
|
||||||
env: DEPS="stable"
|
|
||||||
- php: nightly
|
|
||||||
env: DEPS="dev"
|
|
@ -18,12 +18,15 @@
|
|||||||
"ext-simplexml": "*",
|
"ext-simplexml": "*",
|
||||||
"composer/semver": "^1.4 || ^2.0 || ^3.0",
|
"composer/semver": "^1.4 || ^2.0 || ^3.0",
|
||||||
"composer/package-versions-deprecated": "^1.10",
|
"composer/package-versions-deprecated": "^1.10",
|
||||||
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
|
|
||||||
"vimeo/psalm": "dev-master || dev-4.x || ^4.0"
|
"vimeo/psalm": "dev-master || dev-4.x || ^4.0"
|
||||||
},
|
},
|
||||||
|
"conflict": {
|
||||||
|
"phpunit/phpunit": "<7.5"
|
||||||
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"php": "^7.3 || ^8.0",
|
"php": "^7.3 || ^8.0",
|
||||||
"codeception/codeception": "^4.0.3",
|
"codeception/codeception": "^4.0.3",
|
||||||
|
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
|
||||||
"squizlabs/php_codesniffer": "^3.3.1",
|
"squizlabs/php_codesniffer": "^3.3.1",
|
||||||
"weirdan/codeception-psalm-module": "^0.11.0",
|
"weirdan/codeception-psalm-module": "^0.11.0",
|
||||||
"weirdan/prophecy-shim": "^1.0 || ^2.0"
|
"weirdan/prophecy-shim": "^1.0 || ^2.0"
|
||||||
|
@ -427,12 +427,18 @@ class TestCaseHandler implements
|
|||||||
return $union->getAtomicTypes();
|
return $union->getAtomicTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @psalm-suppress DeprecatedMethod annotated for newer versions that deprecated the method */
|
if (method_exists($union, 'getTypes')) {
|
||||||
|
/**
|
||||||
|
* @psalm-suppress DeprecatedMethod annotated for newer versions that deprecated the method
|
||||||
|
* @var non-empty-array<string, Type\Atomic> annotated for versions missing the method
|
||||||
|
*/
|
||||||
$types = $union->getTypes();
|
$types = $union->getTypes();
|
||||||
assert(!empty($types));
|
|
||||||
return $types;
|
return $types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException('Unexpected: union has no way to get it constituent types');
|
||||||
|
}
|
||||||
|
|
||||||
private static function unionizeIterables(Codebase $codebase, Type\Union $iterables): Type\Atomic\TIterable
|
private static function unionizeIterables(Codebase $codebase, Type\Union $iterables): Type\Atomic\TIterable
|
||||||
{
|
{
|
||||||
/** @var Type\Union[] $key_types */
|
/** @var Type\Union[] $key_types */
|
||||||
@ -584,8 +590,7 @@ class TestCaseHandler implements
|
|||||||
{
|
{
|
||||||
if (method_exists($docblock, 'getStartLine')) {
|
if (method_exists($docblock, 'getStartLine')) {
|
||||||
//typecasting is done on purpose, compatability with psalm old versions
|
//typecasting is done on purpose, compatability with psalm old versions
|
||||||
/** @psalm-suppress RedundantCondition */
|
return $docblock->getStartLine();
|
||||||
return (int) $docblock->getStartLine();
|
|
||||||
}
|
}
|
||||||
/** @psalm-suppress DeprecatedMethod */
|
/** @psalm-suppress DeprecatedMethod */
|
||||||
return $docblock->getLine();
|
return $docblock->getLine();
|
||||||
|
@ -14,6 +14,8 @@ abstract class VersionUtils
|
|||||||
* @psalm-suppress RedundantCondition
|
* @psalm-suppress RedundantCondition
|
||||||
* @psalm-suppress DeprecatedClass
|
* @psalm-suppress DeprecatedClass
|
||||||
* @psalm-suppress ArgumentTypeCoercion
|
* @psalm-suppress ArgumentTypeCoercion
|
||||||
|
* @psalm-suppress RedundantCast
|
||||||
|
* @psalm-suppress RedundantCondition
|
||||||
*/
|
*/
|
||||||
$currentVersion = (string) explode('@', Versions::getVersion($package))[0];
|
$currentVersion = (string) explode('@', Versions::getVersion($package))[0];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user