Skip to content

Commit d1f3cf3

Browse files
committed
cs
1 parent 653e448 commit d1f3cf3

4 files changed

Lines changed: 16 additions & 35 deletions

File tree

preload-split-package.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22

33
declare(strict_types=1);
44

5+
use PhpParser\Node;
6+
use PHPStan\Testing\PHPStanTestCase;
7+
58
if (defined('__PHPSTAN_RUNNING__')) {
69
return;
710
}
811

912
// edge case during Rector tests case, happens when
1013
// 1. phpstan autoload test case is triggered first,
1114
// 2. all php-parser classes are loaded,
12-
if (defined('PHPUNIT_COMPOSER_INSTALL') && class_exists(\PHPStan\Testing\PHPStanTestCase::class, false) && interface_exists(\PhpParser\Node::class, false)) {
15+
if (defined('PHPUNIT_COMPOSER_INSTALL') && class_exists(
16+
PHPStanTestCase::class,
17+
false
18+
) && interface_exists(Node::class, false)) {
1319
return;
1420
}
21+
1522
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node.php';
1623
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
1724
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';

preload.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22

33
declare(strict_types=1);
44

5+
use PhpParser\Node;
6+
use PHPStan\Testing\PHPStanTestCase;
7+
58
if (defined('__PHPSTAN_RUNNING__')) {
69
return;
710
}
811

912
// edge case during Rector tests case, happens when
1013
// 1. phpstan autoload test case is triggered first,
1114
// 2. all php-parser classes are loaded,
12-
if (defined('PHPUNIT_COMPOSER_INSTALL') && class_exists(\PHPStan\Testing\PHPStanTestCase::class, false) && interface_exists(\PhpParser\Node::class, false)) {
15+
if (defined('PHPUNIT_COMPOSER_INSTALL') && class_exists(
16+
PHPStanTestCase::class,
17+
false
18+
) && interface_exists(Node::class, false)) {
1319
return;
1420
}
21+
1522
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node.php';
1623
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
1724
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';

rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddParamArrayDocblockBasedOnArrayMapRector.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
use PhpParser\Node\Stmt\Function_;
1212
use PHPStan\Type\ArrayType;
1313
use PHPStan\Type\MixedType;
14-
<<<<<<< HEAD
15-
=======
16-
use PHPStan\Type\Type;
17-
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
18-
>>>>>>> a264677ce8 ([autoload] Add workaround for phpstan + rector tests co-run to avoid duplicated php-parser loading error)
1914
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
2015
use Rector\Rector\AbstractRector;
2116
use Rector\StaticTypeMapper\StaticTypeMapper;
@@ -152,31 +147,4 @@ private function isArrayParam(Param $param): bool
152147

153148
return $this->isName($param->type, 'array');
154149
}
155-
<<<<<<< HEAD
156-
=======
157-
158-
private function isMixedArrayType(Type $type): bool
159-
{
160-
if (! $type instanceof ArrayType) {
161-
return false;
162-
}
163-
164-
if (! $type->getItemType() instanceof MixedType) {
165-
return false;
166-
}
167-
168-
return $type->getKeyType() instanceof MixedType;
169-
}
170-
171-
private function isAlreadyNonMixedParamType(PhpDocInfo $functionPhpDocInfo, string $paramName): bool
172-
{
173-
$currentParamType = $functionPhpDocInfo->getParamType($paramName);
174-
if ($currentParamType instanceof MixedType) {
175-
return false;
176-
}
177-
178-
// has useful param type already?
179-
return ! $this->isMixedArrayType($currentParamType);
180-
}
181-
>>>>>>> a264677ce8 ([autoload] Add workaround for phpstan + rector tests co-run to avoid duplicated php-parser loading error)
182150
}

src/BetterPhpDocParser/PhpDocManipulator/PhpDocTypeChanger.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use PhpParser\Node\FunctionLike;
88
use PhpParser\Node\Param;
99
use PhpParser\Node\Stmt;
10-
use PhpParser\Node\Stmt\ClassMethod;
1110
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode;
1211
use PHPStan\PhpDocParser\Ast\Node;
1312
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;

0 commit comments

Comments
 (0)