mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-16 21:08:19 +01:00
Updated Rector to commit 8bc80b4641429cfcea9a413ff9eb1bd9afaae9ee
8bc80b4641
Add readonly by default on new promoted property (#6650)
This commit is contained in:
parent
40b5c4746e
commit
4405ec5ff8
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '2e82ab4969246050e9fe47df0cf549cc96fdbfd5';
|
||||
public const PACKAGE_VERSION = '8bc80b4641429cfcea9a413ff9eb1bd9afaae9ee';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2025-01-06 00:05:08';
|
||||
public const RELEASE_DATE = '2025-01-05 18:37:06';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -44,10 +44,12 @@ use Rector\Exception\NotImplementedYetException;
|
||||
use Rector\Exception\ShouldNotHappenException;
|
||||
use Rector\NodeDecorator\PropertyTypeDecorator;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\Php\PhpVersionProvider;
|
||||
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use Rector\PostRector\ValueObject\PropertyMetadata;
|
||||
use Rector\StaticTypeMapper\StaticTypeMapper;
|
||||
use Rector\ValueObject\PhpVersionFeature;
|
||||
/**
|
||||
* @see \Rector\Tests\PhpParser\Node\NodeFactoryTest
|
||||
*/
|
||||
@ -73,17 +75,22 @@ final class NodeFactory
|
||||
* @readonly
|
||||
*/
|
||||
private SimpleCallableNodeTraverser $simpleCallableNodeTraverser;
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
private PhpVersionProvider $phpVersionProvider;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const THIS = 'this';
|
||||
public function __construct(BuilderFactory $builderFactory, PhpDocInfoFactory $phpDocInfoFactory, StaticTypeMapper $staticTypeMapper, PropertyTypeDecorator $propertyTypeDecorator, SimpleCallableNodeTraverser $simpleCallableNodeTraverser)
|
||||
public function __construct(BuilderFactory $builderFactory, PhpDocInfoFactory $phpDocInfoFactory, StaticTypeMapper $staticTypeMapper, PropertyTypeDecorator $propertyTypeDecorator, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->builderFactory = $builderFactory;
|
||||
$this->phpDocInfoFactory = $phpDocInfoFactory;
|
||||
$this->staticTypeMapper = $staticTypeMapper;
|
||||
$this->propertyTypeDecorator = $propertyTypeDecorator;
|
||||
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
/**
|
||||
* @param string|ObjectReference::* $className
|
||||
@ -275,6 +282,10 @@ final class NodeFactory
|
||||
$param = $paramBuilder->getNode();
|
||||
$propertyFlags = $propertyMetadata->getFlags();
|
||||
$param->flags = $propertyFlags !== 0 ? $propertyFlags : Modifiers::PRIVATE;
|
||||
// make readonly by default
|
||||
if ($this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::READONLY_PROPERTY)) {
|
||||
$param->flags |= Modifiers::READONLY;
|
||||
}
|
||||
return $param;
|
||||
}
|
||||
public function createFalse() : ConstFetch
|
||||
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -1866,12 +1866,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
|
||||
"reference": "29a1abf5d8e8d6150dabe6e79e001a34236e9499"
|
||||
"reference": "f7e0a140e1f6d30252f950b05da1fc89776468eb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/29a1abf5d8e8d6150dabe6e79e001a34236e9499",
|
||||
"reference": "29a1abf5d8e8d6150dabe6e79e001a34236e9499",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/f7e0a140e1f6d30252f950b05da1fc89776468eb",
|
||||
"reference": "f7e0a140e1f6d30252f950b05da1fc89776468eb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1896,7 +1896,7 @@
|
||||
"tomasvotruba\/class-leak": "^1.0",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2024-12-08T17:51:24+00:00",
|
||||
"time": "2025-01-05T17:17:55+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
||||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main f740789'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main f9cc5a0'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 6b0e4f0'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 29a1abf'));
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main f740789'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main f9cc5a0'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 6b0e4f0'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main f7e0a14'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user