mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit e68c8d23cbbdb9dbfef66133af6bb4f1857015ad
e68c8d23cb
Fix CallableTypeParameterNode and IdentifierTypeParameterNode crash (#3353)
This commit is contained in:
parent
05df336f8e
commit
1e09b81ddb
|
@ -5,8 +5,10 @@ namespace Rector\PHPStanStaticTypeMapper\TypeMapper;
|
|||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PHPStan\PhpDocParser\Ast\Type\CallableTypeParameterNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Reflection\ParameterReflection;
|
||||
use PHPStan\Type\ClosureType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\BetterPhpDocParser\ValueObject\Type\SpacingAwareCallableTypeNode;
|
||||
|
@ -14,6 +16,7 @@ use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
|||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper;
|
||||
use RectorPrefix202302\Symfony\Contracts\Service\Attribute\Required;
|
||||
use RectorPrefix202302\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @implements TypeMapperInterface<ClosureType>
|
||||
*/
|
||||
|
@ -37,11 +40,10 @@ final class ClosureTypeMapper implements TypeMapperInterface
|
|||
{
|
||||
$identifierTypeNode = new IdentifierTypeNode($type->getClassName());
|
||||
$returnDocTypeNode = $this->phpStanStaticTypeMapper->mapToPHPStanPhpDocTypeNode($type->getReturnType(), $typeKind);
|
||||
$parameterDocTypeNodes = [];
|
||||
foreach ($type->getParameters() as $parameterReflection) {
|
||||
$parameterDocTypeNodes[] = $this->phpStanStaticTypeMapper->mapToPHPStanPhpDocTypeNode($parameterReflection->getType(), $typeKind);
|
||||
}
|
||||
return new SpacingAwareCallableTypeNode($identifierTypeNode, $parameterDocTypeNodes, $returnDocTypeNode);
|
||||
$callableTypeParameterNodes = $this->createCallableTypeParameterNodes($type, $typeKind);
|
||||
// callable parameters must be of specific type
|
||||
Assert::allIsInstanceOf($callableTypeParameterNodes, CallableTypeParameterNode::class);
|
||||
return new SpacingAwareCallableTypeNode($identifierTypeNode, $callableTypeParameterNodes, $returnDocTypeNode);
|
||||
}
|
||||
/**
|
||||
* @param TypeKind::* $typeKind
|
||||
|
@ -61,4 +63,18 @@ final class ClosureTypeMapper implements TypeMapperInterface
|
|||
{
|
||||
$this->phpStanStaticTypeMapper = $phpStanStaticTypeMapper;
|
||||
}
|
||||
/**
|
||||
* @param TypeKind::* $typeKind
|
||||
* @return CallableTypeParameterNode[]
|
||||
*/
|
||||
private function createCallableTypeParameterNodes(ClosureType $closureType, string $typeKind) : array
|
||||
{
|
||||
$callableTypeParameterNodes = [];
|
||||
foreach ($closureType->getParameters() as $parameterReflection) {
|
||||
/** @var ParameterReflection $parameterReflection */
|
||||
$typeNode = $this->phpStanStaticTypeMapper->mapToPHPStanPhpDocTypeNode($parameterReflection->getType(), $typeKind);
|
||||
$callableTypeParameterNodes[] = new CallableTypeParameterNode($typeNode, $parameterReflection->passedByReference()->yes(), $parameterReflection->isVariadic(), $parameterReflection->getName() !== '' && $parameterReflection->getName() !== '0' ? '$' . $parameterReflection->getName() : '', $parameterReflection->isOptional());
|
||||
}
|
||||
return $callableTypeParameterNodes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
|
|||
use Rector\BetterPhpDocParser\ValueObject\Type\SpacingAwareArrayTypeNode;
|
||||
use Rector\Core\Rector\AbstractScopeAwareRector;
|
||||
use Rector\Core\Util\StringUtils;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\PhpDocParser\TypeAnalyzer\ClassMethodReturnTypeResolver;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
|
@ -85,7 +84,7 @@ CODE_SAMPLE
|
|||
*/
|
||||
public function refactorWithScope(Node $node, Scope $scope) : ?Node
|
||||
{
|
||||
if ($this->isInTestCase($node)) {
|
||||
if ($this->isInTestCase($scope)) {
|
||||
return null;
|
||||
}
|
||||
/** @var Return_[] $returns */
|
||||
|
@ -153,12 +152,8 @@ CODE_SAMPLE
|
|||
* Skip test case, as return methods there are usually with test data only.
|
||||
* Those arrays are hand made and return types are getting complex and messy, so this rule should skip it.
|
||||
*/
|
||||
private function isInTestCase(ClassMethod $classMethod) : bool
|
||||
private function isInTestCase(Scope $scope) : bool
|
||||
{
|
||||
$scope = $classMethod->getAttribute(AttributeKey::SCOPE);
|
||||
if (!$scope instanceof Scope) {
|
||||
return \false;
|
||||
}
|
||||
$classReflection = $scope->getClassReflection();
|
||||
if (!$classReflection instanceof ClassReflection) {
|
||||
return \false;
|
||||
|
|
|
@ -9,9 +9,7 @@ use PhpParser\Node\Stmt\Function_;
|
|||
use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\TypeDeclaration\Guard\PhpDocNestedAnnotationGuard;
|
||||
use Rector\TypeDeclaration\Helper\PhpDocNullableTypeHelper;
|
||||
use Rector\VendorLocker\NodeVendorLocker\ClassMethodReturnTypeOverrideGuard;
|
||||
|
@ -42,18 +40,12 @@ final class ReturnAnnotationIncorrectNullableRector extends AbstractRector
|
|||
* @var \Rector\TypeDeclaration\Guard\PhpDocNestedAnnotationGuard
|
||||
*/
|
||||
private $phpDocNestedAnnotationGuard;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(PhpDocTypeChanger $phpDocTypeChanger, PhpDocNullableTypeHelper $phpDocNullableTypeHelper, ClassMethodReturnTypeOverrideGuard $classMethodReturnTypeOverrideGuard, PhpDocNestedAnnotationGuard $phpDocNestedAnnotationGuard, PhpVersionProvider $phpVersionProvider)
|
||||
public function __construct(PhpDocTypeChanger $phpDocTypeChanger, PhpDocNullableTypeHelper $phpDocNullableTypeHelper, ClassMethodReturnTypeOverrideGuard $classMethodReturnTypeOverrideGuard, PhpDocNestedAnnotationGuard $phpDocNestedAnnotationGuard)
|
||||
{
|
||||
$this->phpDocTypeChanger = $phpDocTypeChanger;
|
||||
$this->phpDocNullableTypeHelper = $phpDocNullableTypeHelper;
|
||||
$this->classMethodReturnTypeOverrideGuard = $classMethodReturnTypeOverrideGuard;
|
||||
$this->phpDocNestedAnnotationGuard = $phpDocNestedAnnotationGuard;
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
|
@ -102,9 +94,6 @@ CODE_SAMPLE
|
|||
if ($returnType === null) {
|
||||
return null;
|
||||
}
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::TYPED_PROPERTIES)) {
|
||||
return null;
|
||||
}
|
||||
if (!$this->phpDocNestedAnnotationGuard->isPhpDocCommentCorrectlyParsed($node)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '0.15.13';
|
||||
public const PACKAGE_VERSION = 'e68c8d23cbbdb9dbfef66133af6bb4f1857015ad';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-02-07 00:37:45';
|
||||
public const RELEASE_DATE = '2023-02-07 12:21:54';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit55ec482caaceab1f447e198177c13e96::getLoader();
|
||||
return ComposerAutoloaderInit5b0ca69862d434be44bbaf85cee23928::getLoader();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit55ec482caaceab1f447e198177c13e96
|
||||
class ComposerAutoloaderInit5b0ca69862d434be44bbaf85cee23928
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInit55ec482caaceab1f447e198177c13e96
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit55ec482caaceab1f447e198177c13e96', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit5b0ca69862d434be44bbaf85cee23928', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit55ec482caaceab1f447e198177c13e96', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit5b0ca69862d434be44bbaf85cee23928', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit55ec482caaceab1f447e198177c13e96::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit5b0ca69862d434be44bbaf85cee23928::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit55ec482caaceab1f447e198177c13e96::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit5b0ca69862d434be44bbaf85cee23928::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit55ec482caaceab1f447e198177c13e96
|
||||
class ComposerStaticInit5b0ca69862d434be44bbaf85cee23928
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -3089,9 +3089,9 @@ class ComposerStaticInit55ec482caaceab1f447e198177c13e96
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit55ec482caaceab1f447e198177c13e96::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit55ec482caaceab1f447e198177c13e96::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit55ec482caaceab1f447e198177c13e96::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit5b0ca69862d434be44bbaf85cee23928::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit5b0ca69862d434be44bbaf85cee23928::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit5b0ca69862d434be44bbaf85cee23928::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
|
@ -798,17 +798,17 @@
|
|||
},
|
||||
{
|
||||
"name": "phpstan\/phpstan",
|
||||
"version": "1.9.14",
|
||||
"version_normalized": "1.9.14.0",
|
||||
"version": "1.9.16",
|
||||
"version_normalized": "1.9.16.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
|
||||
"reference": "e5fcc96289cf737304286a9b505fbed091f02e58"
|
||||
"reference": "922e2689bb180575d0f57de0443c431a5a698e8f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/e5fcc96289cf737304286a9b505fbed091f02e58",
|
||||
"reference": "e5fcc96289cf737304286a9b505fbed091f02e58",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/922e2689bb180575d0f57de0443c431a5a698e8f",
|
||||
"reference": "922e2689bb180575d0f57de0443c431a5a698e8f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -817,7 +817,7 @@
|
|||
"conflict": {
|
||||
"phpstan\/phpstan-shim": "*"
|
||||
},
|
||||
"time": "2023-01-19T10:47:09+00:00",
|
||||
"time": "2023-02-07T10:42:21+00:00",
|
||||
"bin": [
|
||||
"phpstan",
|
||||
"phpstan.phar"
|
||||
|
@ -840,7 +840,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/phpstan\/phpstan\/issues",
|
||||
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.9.14"
|
||||
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.9.16"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3111,41 +3111,35 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/rule-doc-generator-contracts",
|
||||
"version": "11.1.25",
|
||||
"version_normalized": "11.1.25.0",
|
||||
"version": "11.1.26",
|
||||
"version_normalized": "11.1.26.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts.git",
|
||||
"reference": "05b78c1e832bd2427af080368f2b0d886af360f8"
|
||||
"reference": "3e66b3fec678b74a076395ec629d535fb95293b5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/rule-doc-generator-contracts\/zipball\/05b78c1e832bd2427af080368f2b0d886af360f8",
|
||||
"reference": "05b78c1e832bd2427af080368f2b0d886af360f8",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/rule-doc-generator-contracts\/zipball\/3e66b3fec678b74a076395ec629d535fb95293b5",
|
||||
"reference": "3e66b3fec678b74a076395ec629d535fb95293b5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"nette\/utils": "^3.2",
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/autowire-array-parameter": "<11.1.25",
|
||||
"symplify\/coding-standard": "<11.1.24",
|
||||
"symplify\/config-transformer": "<11.1.24",
|
||||
"symplify\/easy-ci": "<11.1.24",
|
||||
"symplify\/easy-parallel": "<11.1.25",
|
||||
"symplify\/easy-testing": "<11.1.25",
|
||||
"symplify\/monorepo-builder": "<11.1.24",
|
||||
"symplify\/package-builder": "<11.1.25",
|
||||
"symplify\/php-config-printer": "<11.1.25",
|
||||
"symplify\/phpstan-extensions": "<11.1.25",
|
||||
"symplify\/phpstan-rules": "<11.1.24",
|
||||
"symplify\/rule-doc-generator": "<11.1.25",
|
||||
"symplify\/smart-file-system": "<11.1.25",
|
||||
"symplify\/symfony-static-dumper": "<11.1.25",
|
||||
"symplify\/symplify-kernel": "<11.1.25"
|
||||
"require-dev": {
|
||||
"php-parallel-lint\/php-parallel-lint": "^1.3",
|
||||
"phpstan\/extension-installer": "^1.2",
|
||||
"rector\/rector": "^0.15.10",
|
||||
"symplify\/easy-ci": "^11.1",
|
||||
"symplify\/easy-coding-standard": "^11.1",
|
||||
"symplify\/easy-testing": "^11.1",
|
||||
"symplify\/phpstan-extensions": "^11.1",
|
||||
"symplify\/phpstan-rules": "11.2.3.72",
|
||||
"tomasvotruba\/unused-public": "^0.0.34"
|
||||
},
|
||||
"time": "2023-01-28T10:13:31+00:00",
|
||||
"time": "2023-02-07T07:16:13+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -3164,7 +3158,7 @@
|
|||
],
|
||||
"description": "Contracts for production code of RuleDocGenerator",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts\/tree\/11.1.25"
|
||||
"source": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts\/tree\/11.1.26"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1,16 +1,16 @@
|
|||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmPJH5YACgkQzxoQjQ56
|
||||
5yAn3A/8DhHW+4QOy8MYvSNRKjuKw408q9mXbHooeDpplIEO3DvUatDIiWdjbLVC
|
||||
gY7hs89CxJUMkdxjT2q6/gFsRP4bOuGfckXuX0MFhVj89c3aw/5an5sw9xwJ0YL/
|
||||
k19CR4ZVjUJ1o0/gxmTXBh7MTEsIRFuGDJS7PKC7tf8MB5ujlO3pBXuykXh5oaNd
|
||||
UEtLLztCr/zDAc7s7mW2iujiDvmY/l/3oYJiS5IkmkG4FePUaJ3oUzZU5k2F+js0
|
||||
NeSbSwUZ4l+xXuktk2Kr+blFxNZu5nFMKLuj94d/A2dpHWR9ErTwhMBNSbHVC5qn
|
||||
c4pO5XED+ygZ48kud4ImreOvfPwiiWjol+8TQgAb9sExakvjb9+HSaH/eInraBHQ
|
||||
FR/PzDxF42El+fdn8eopGfaz+iHXIZPDrmTRnf9AlTKMshkvZC8ZCAxDFxDhJaoZ
|
||||
NxeGDP6dawDCnCu8YldpQbwxkK089eeSSUu1HCmJJJ4Xgp8xm36l5JVEOT4zFw4d
|
||||
gU7t/v9e6u4bccZC9W8UO/TmWNRW2n1qFX6VurgsuYq8jRVMsVj1uEaKCJtOH5Lm
|
||||
Z8ca7D28Wckv31kUOR/XX2FypzJebG0I+K1cQJJjIjAlABj6RVSxuZWUakOoPnHy
|
||||
YZGpIQhyHUSTwppqkYMnpbOoOCmzX3p08qdXbKfgCU6WJQtiz7U=
|
||||
=70O7
|
||||
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmPiKvUACgkQzxoQjQ56
|
||||
5yCMJRAAi1z4OEeZTgkcoElOBQ4bY4rgf0fmETn0PIrOW/cSwLdFIgNMN+TBadqa
|
||||
AAmnH5f+n59AORpWgvbzouDXp76WN8G4yh7tyhW7aI3H7EWf5bIqYD9H8DjK5gI/
|
||||
a/BLPa+GrXbkSFgmgao/54b4axKmyj9hBRoG7hPnce3Z0nVswUYeauNcaO0b1KV9
|
||||
hin9huA0S+Ed/oXeAPUbs1FU0NGCVfynFplhY4d5KyAm6yLij/8pyiqEHlpW4/LI
|
||||
7z5ZJZXEUpvLywSD7o99RqXhHPs2ODItR1uzhg1EEyW2bqUf6bdrb1ikXG67pNtd
|
||||
vtkOPuJ9VUbRKjKvlKeWC194c5KzM7a3nEDtNsDvKwo1rPWR6hIf3VukSEsv08Wd
|
||||
us65DDFQrWVbLDPN9yROqS70KAEe7leO65NJzbtnzjtNWHF+FbHnz3sl63X9mAqz
|
||||
guNtjjJJjZG5EGPCOotG0E90Fmgs9aD5i2dZoQTH4Yno3Rq5qJpjlGenjEjW8cu6
|
||||
xFRxP+fGbqeDaw3wLe7niBXHrZQ3eKUpXZaxaFVVSoIzO9RxqpVyjnq3oUX2d+ti
|
||||
MRA1Smr6Fu8TWxoBJGLWDBIOtwARcAmz5NBUolzAXb6gb3XDR8W9w4aV8hELEAwb
|
||||
bPtDupKyAqCO+hiPTaOp0Z5TVCOo6YZUGSaHr88JFeFTGvAdeP0=
|
||||
=NZJU
|
||||
-----END PGP SIGNATURE-----
|
||||
|
|
|
@ -6,6 +6,17 @@
|
|||
"php": ">=8.1",
|
||||
"nette\/utils": "^3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"php-parallel-lint\/php-parallel-lint": "^1.3",
|
||||
"phpstan\/extension-installer": "^1.2",
|
||||
"rector\/rector": "^0.15.10",
|
||||
"symplify\/easy-ci": "^11.1",
|
||||
"symplify\/easy-coding-standard": "^11.1",
|
||||
"symplify\/easy-testing": "^11.1",
|
||||
"symplify\/phpstan-extensions": "^11.1",
|
||||
"symplify\/phpstan-rules": "11.2.3.72",
|
||||
"tomasvotruba\/unused-public": "^0.0.34"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symplify\\RuleDocGenerator\\": "src"
|
||||
|
@ -16,23 +27,20 @@
|
|||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/phpstan-rules": "<11.1.24",
|
||||
"symplify\/easy-testing": "<11.1.25",
|
||||
"symplify\/php-config-printer": "<11.1.25",
|
||||
"symplify\/autowire-array-parameter": "<11.1.25",
|
||||
"symplify\/package-builder": "<11.1.25",
|
||||
"symplify\/phpstan-extensions": "<11.1.25",
|
||||
"symplify\/rule-doc-generator": "<11.1.25",
|
||||
"symplify\/smart-file-system": "<11.1.25",
|
||||
"symplify\/symfony-static-dumper": "<11.1.25",
|
||||
"symplify\/symplify-kernel": "<11.1.25",
|
||||
"symplify\/config-transformer": "<11.1.24",
|
||||
"symplify\/coding-standard": "<11.1.24",
|
||||
"symplify\/easy-parallel": "<11.1.25",
|
||||
"symplify\/easy-ci": "<11.1.24",
|
||||
"symplify\/monorepo-builder": "<11.1.24"
|
||||
"scripts": {
|
||||
"check-cs": "vendor\/bin\/ecs check --ansi",
|
||||
"fix-cs": "vendor\/bin\/ecs check --fix --ansi",
|
||||
"phpstan": "vendor\/bin\/phpstan analyse --ansi --error-format symplify",
|
||||
"rector": "vendor\/bin\/rector process --dry-run --ansi"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"sort-packages": true,
|
||||
"platform-check": false,
|
||||
"allow-plugins": {
|
||||
"cweagans\/composer-patches": true,
|
||||
"phpstan\/extension-installer": true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,10 +9,12 @@ abstract class AbstractCodeSample implements CodeSampleInterface
|
|||
{
|
||||
/**
|
||||
* @var non-empty-string
|
||||
* @readonly
|
||||
*/
|
||||
private $goodCode;
|
||||
/**
|
||||
* @var non-empty-string
|
||||
* @readonly
|
||||
*/
|
||||
private $badCode;
|
||||
public function __construct(string $badCode, string $goodCode)
|
||||
|
|
|
@ -7,6 +7,7 @@ use Symplify\RuleDocGenerator\ValueObject\AbstractCodeSample;
|
|||
final class ComposerJsonAwareCodeSample extends AbstractCodeSample
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $composerJson;
|
||||
|
|
|
@ -7,6 +7,7 @@ use Symplify\RuleDocGenerator\ValueObject\AbstractCodeSample;
|
|||
final class ExtraFileCodeSample extends AbstractCodeSample
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $extraFile;
|
||||
|
|
|
@ -23,6 +23,7 @@ final class RuleDefinition
|
|||
*/
|
||||
private $codeSamples = [];
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $description;
|
||||
|
|
Loading…
Reference in New Issue