Skip to content
Open
Show file tree
Hide file tree
Changes from all 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: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
php: ['7.3', '7.4', '8.0']
php: ['8.0','8.1']

steps:
- name: "Checkout"
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:

strategy:
matrix:
php: ['7.3', '7.4', '8.0']
php: ['8.0','8.1']

steps:
- name: "Checkout"
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ test:
$(MAKE) fmt-check

phpstan:
docker run -it --rm -v ${PWD}:/app -w /app php:7.3-cli-alpine php -d error_reporting=-1 -d memory_limit=-1 bin/phpstan --ansi analyse
docker run -it --rm -v ${PWD}:/app -w /app php:8.3-cli-alpine php -d error_reporting=-1 -d memory_limit=-1 bin/phpstan --ansi analyse

phpstan-clear-cache:
docker run -it --rm -v ${PWD}:/app -w /app php:7.3-cli-alpine php -d error_reporting=-1 -d memory_limit=-1 bin/phpstan --ansi clear-result-cache
docker run -it --rm -v ${PWD}:/app -w /app php:8.3-cli-alpine php -d error_reporting=-1 -d memory_limit=-1 bin/phpstan --ansi clear-result-cache

phpunit:
docker run -it --rm -v ${PWD}:/app -w /app php:7.3-cli-alpine php -d error_reporting=-1 bin/phpunit --colors=always -c phpunit.xml
docker run -it --rm -v ${PWD}:/app -w /app php:8.3-cli-alpine php -d error_reporting=-1 bin/phpunit --colors=always -c phpunit.xml

fmt-check:
docker run -it --rm -v ${PWD}:/app -w /app php:7.3-cli-alpine php bin/phpcs --standard=./ruleset.xml --extensions=php --tab-width=4 -sp ./src ./tests
docker run -it --rm -v ${PWD}:/app -w /app php:8.3-cli-alpine php bin/phpcs --standard=./ruleset.xml --extensions=php --tab-width=4 -sp ./src ./tests

fmt:
docker run -it --rm -v ${PWD}:/app -w /app php:7.3-cli-alpine php bin/phpcbf --standard=./ruleset.xml --extensions=php --tab-width=4 -sp ./src ./tests
docker run -it --rm -v ${PWD}:/app -w /app php:8.3-cli-alpine php bin/phpcbf --standard=./ruleset.xml --extensions=php --tab-width=4 -sp ./src ./tests
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
}
],
"require": {
"php": ">=7.3|^8.0",
"phpstan/phpstan": "^1.0"
"php": ">=7.4|^8.0",
"phpstan/phpstan": "^2.0"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"ergebnis/composer-normalize": "^2.0.2",
"phpunit/phpunit": "^9.4.2",
"slevomat/coding-standard": "^6.4.1",
"squizlabs/php_codesniffer": "^3.5.0",
"bonami/collections": "^0.4.5"
"bonami/collections": "dev-upgrade-to-phpstan2"
},
"config": {
"bin-dir": "bin",
Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ includes:
- extension.neon
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
parameters:
ignoreErrors:
-
identifier: phpstanApi.instanceofType
- '~Method .* should return class-string but returns string.~'
reportUnmatchedIgnoredErrors: true
level: 9
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public function getTypeFromMethodCall(
): Type {
$arg = $methodCall->args[0];
assert($arg instanceof Arg);

$closure = $scope->getType($arg->value);
assert($closure instanceof ClosureType || $closure instanceof CallableType);
assert($closure instanceof ClosureType);

$listType = $scope->getType($methodCall->var);

Expand Down
1 change: 1 addition & 0 deletions tests/Bonami/Collection/Phpstan/MapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class MapTest extends TestCase
public function testFromAssociativeArrayReturnType(): void
{
$genericList = Map::fromAssociativeArray([1 => new Foo()]);
// @phpstan-ignore-next-line
$this->requireMapOfFoo($genericList);
self::assertInstanceOf(Map::class, $genericList);

Expand Down
Loading