Skip to content

Commit

Permalink
bump: update PHPQA to 1.59.2 (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi authored Aug 24, 2021
1 parent 95d26c5 commit d7e3582
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DOCQA_DOCKER_COMMAND=docker run --init --interactive ${TTY} --rm --env HOME=/tmp
endif

ifndef PHPQA_DOCKER_COMMAND
PHPQA_DOCKER_IMAGE=jakzal/phpqa:1.59.0-php${BUILD_ENV}-alpine
PHPQA_DOCKER_IMAGE=jakzal/phpqa:1.59.2-php${BUILD_ENV}-alpine
PHPQA_DOCKER_COMMAND=docker run --init --interactive ${TTY} --rm --env "COMPOSER_CACHE_DIR=/composer/cache" --user "$(shell id -u):$(shell id -g)" --volume "$(shell pwd)/var/tmp/phpqa:/tmp" --volume "$(shell pwd):/project" --volume "${HOME}/.composer:/composer" --workdir /project ${PHPQA_DOCKER_IMAGE}
endif

Expand Down
14 changes: 0 additions & 14 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ includes:
- /tools/.composer/vendor-bin/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon
- /tools/.composer/vendor-bin/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon
- /tools/.composer/vendor-bin/phpstan/vendor/phpstan/phpstan-phpunit/extension.neon
# - /tools/.composer/vendor-bin/phpstan/vendor/pepakriz/phpstan-exception-rules/extension.neon
parameters:
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
Expand All @@ -17,16 +16,3 @@ parameters:
- src/Xezilaires/vendor/
- var/
- vendor/
#exceptionRules:
# uncheckedExceptions:
# - LogicException
# - PHPUnit\Framework\Exception
# - PHPUnit\Framework\MockObject\RuntimeException
ignoreErrors:
- message: '#Access to an undefined property object\:\:\$scalar\.#'
path: %currentWorkingDirectory%/src/Xezilaires/Test/FilterIteratorTest.php
- message: '#Return type \(bool\) of method class@anonymous\/src\/Xezilaires\/Test\/FixtureTrait\.php:28::getRealPath\(\) should be covariant with return type \(string\|false\) of method SplFileInfo::getRealPath\(\)#'
paths:
- %currentWorkingDirectory%/src/Bridge/Spout/Test/SpreadsheetTest.php
- %currentWorkingDirectory%/src/Bridge/Symfony/Test/Functional/XezilairesBundleTest.php
- %currentWorkingDirectory%/src/Xezilaires/Test/Functional/FunctionalTestCase.php
4 changes: 2 additions & 2 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm xmlns="https://getpsalm.org/schema/config"
cacheDirectory="var/psalm"
totallyTyped="true">
cacheDirectory="var/psalm"
errorLevel="1">
<projectFiles>
<directory name="src/"/>
<ignoreFiles allowMissingFiles="true">
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/PhpSpreadsheet/psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm xmlns="https://getpsalm.org/schema/config"
cacheDirectory="var/psalm"
totallyTyped="true">
errorLevel="1">
<projectFiles>
<directory name="."/>
<ignoreFiles>
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Spout/psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm xmlns="https://getpsalm.org/schema/config"
cacheDirectory="var/psalm"
totallyTyped="true">
errorLevel="1">
<projectFiles>
<directory name="."/>
<ignoreFiles>
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Symfony/psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm xmlns="https://getpsalm.org/schema/config"
cacheDirectory="var/psalm"
totallyTyped="true">
errorLevel="1">
<projectFiles>
<directory name="."/>
<ignoreFiles>
Expand Down
3 changes: 3 additions & 0 deletions src/Xezilaires/Exception/MappingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public static function missingHeaderOption(): self
return new self('When using HeaderReference, "header" option is required');
}

/**
* @param array<string> $columns
*/
public static function ambiguousHeader(string $header, array $columns): self
{
return new self(sprintf('Ambiguous header "%1$s" found, used in columns "%2$s"', $header, implode('", "', $columns)));
Expand Down
10 changes: 8 additions & 2 deletions src/Xezilaires/Test/FilterIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public function testCanFilterOutIteratorItems(): void
{
$iterator = new FakeIterator([1, 2, 3, 4, 5]);
$filter = new FilterIterator($iterator, static function (object $item): bool {
/** @var int $scalar */
/**
* @var int $scalar
* @phpstan-ignore-next-line
*/
$scalar = $item->scalar;

return $scalar % 2 === 0;
Expand All @@ -42,7 +45,10 @@ public function testCallbackReturnValueMustBeBool(): void
{
$iterator = new FakeIterator(['ba', 'abba', 'boo', 'bae', 'nba', 'ab', 'ban']);
$filter = new FilterIterator($iterator, static function (object $item): bool {
/** @var string $scalar */
/**
* @var string $scalar
* @phpstan-ignore-next-line
*/
$scalar = $item->scalar;

return false !== mb_strpos($scalar, 'ba');
Expand Down
1 change: 1 addition & 0 deletions src/Xezilaires/Test/FixtureTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private function invalidFixture(string $name): \SplFileObject
return new class(__DIR__.'/resources/fixtures/'.$name) extends \SplFileObject {
/**
* @psalm-suppress ImplementedReturnTypeMismatch Invalid by design
* @phpstan-ignore-next-line
*/
public function getRealPath(): bool
{
Expand Down
6 changes: 0 additions & 6 deletions src/Xezilaires/phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ parameters:
excludes_analyse:
- var/
- vendor/
ignoreErrors:
- message: '#Access to an undefined property object\:\:\$scalar\.#'
path: %currentWorkingDirectory%/Test/FilterIteratorTest.php
- message: '#Return type \(bool\) of method class@anonymous\/Test\/FixtureTrait\.php:28::getRealPath\(\) should be covariant with return type \(string\|false\) of method SplFileInfo::getRealPath\(\)#'
paths:
- %currentWorkingDirectory%/Test/Functional/FunctionalTestCase.php
2 changes: 1 addition & 1 deletion src/Xezilaires/psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm xmlns="https://getpsalm.org/schema/config"
cacheDirectory="var/psalm"
totallyTyped="true">
errorLevel="1">
<projectFiles>
<directory name="."/>
<ignoreFiles>
Expand Down

0 comments on commit d7e3582

Please sign in to comment.