Skip to content

Commit

Permalink
Remove ImplodeFunctionRule changes
Browse files Browse the repository at this point in the history
  • Loading branch information
olsavmic committed Oct 8, 2021
1 parent 10354ec commit 441a3cf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 54 deletions.
20 changes: 0 additions & 20 deletions src/Rules/Functions/ImplodeFunctionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use PHPStan\Rules\RuleLevelHelper;
use PHPStan\Type\ErrorType;
use PHPStan\Type\Type;
use PHPStan\Type\UnionType;
use PHPStan\Type\VerbosityLevel;

/**
Expand Down Expand Up @@ -68,8 +67,6 @@ static function (Type $type): bool {
}
);

$type = $typeResult->getType();

if ($typeResult->getType() instanceof ErrorType
|| !$typeResult->getType()->getIterableValueType()->toString() instanceof ErrorType) {
return [];
Expand All @@ -82,21 +79,4 @@ static function (Type $type): bool {
];
}

private function checkContainsErrorTypeAfterConversion(Type $type): bool
{
if ($type->getIterableValueType()->toString() instanceof ErrorType) {
return true;
}

if ($type instanceof UnionType) {
foreach ($type->getTypes() as $concreteType) {
if ($this->checkContainsErrorTypeAfterConversion($concreteType)) {
return true;
}
}
}

return false;
}

}
14 changes: 0 additions & 14 deletions tests/PHPStan/Rules/Functions/ImplodeFunctionRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,4 @@ public function testFile(): void
]);
}

public function testRuleWithNullsafeVariant(): void
{
if (PHP_VERSION_ID < 80000) {
$this->markTestSkipped('Test requires PHP 8.0.');
}

$this->analyse([__DIR__ . '/data/implode-nullsafe.php'], [
[
'Parameter #1 $array of function implode expects array<string>, array<int, array<string>>|null given.',
17,
],
]);
}

}
20 changes: 0 additions & 20 deletions tests/PHPStan/Rules/Functions/data/implode-nullsafe.php

This file was deleted.

0 comments on commit 441a3cf

Please sign in to comment.