Skip to content

Commit a3c471c

Browse files
committed
add browser-kit
1 parent 6cc3e6f commit a3c471c

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

config/sets/symfony/symfony6/symfony60/symfony60-browser-kit.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,17 @@
22

33
declare(strict_types=1);
44

5-
use PHPStan\Type\ArrayType;
6-
use PHPStan\Type\BooleanType;
7-
use PHPStan\Type\FloatType;
8-
use PHPStan\Type\IntegerType;
9-
use PHPStan\Type\MixedType;
10-
use PHPStan\Type\NullType;
115
use PHPStan\Type\ObjectType;
126
use PHPStan\Type\ObjectWithoutClassType;
13-
use PHPStan\Type\StringType;
14-
use PHPStan\Type\UnionType;
157
use Rector\Config\RectorConfig;
168
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
179
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
18-
use Rector\Util\Reflection\PrivatesAccessor;
1910

2011
// https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.0.md
2112
// @see https://github.com/symfony/symfony/blob/6.1/.github/expected-missing-return-types.diff
2213

2314
return static function (RectorConfig $rectorConfig): void {
24-
$arrayType = new ArrayType(new MixedType(), new MixedType());
2515
$browserKitResponseType = new ObjectType('Symfony\Component\BrowserKit\Response');
26-
27-
$scalarTypes = [
28-
$arrayType,
29-
new BooleanType(),
30-
new StringType(),
31-
new IntegerType(),
32-
new FloatType(),
33-
new NullType(),
34-
];
35-
36-
$scalarArrayObjectUnionedTypes = [...$scalarTypes, new ObjectType('ArrayObject')];
37-
38-
// cannot be crated with \PHPStan\Type\UnionTypeHelper::sortTypes() as ObjectType requires a class reflection we do not have here
39-
$unionTypeReflectionClass = new ReflectionClass(UnionType::class);
40-
41-
/** @var UnionType $scalarArrayObjectUnionType */
42-
$scalarArrayObjectUnionType = $unionTypeReflectionClass->newInstanceWithoutConstructor();
43-
44-
$privatesAccessor = new PrivatesAccessor();
45-
$privatesAccessor->setPrivateProperty($scalarArrayObjectUnionType, 'types', $scalarArrayObjectUnionedTypes);
4616
$rectorConfig->ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [
4717
new AddReturnTypeDeclaration(
4818
'Symfony\Component\BrowserKit\AbstractBrowser',

0 commit comments

Comments
 (0)