Skip to content

Commit

Permalink
Updated Rector to commit 3f1ccb3ea131997a435fc2211620e968c6732220
Browse files Browse the repository at this point in the history
rectorphp/rector-src@3f1ccb3  Support @immutable phpdoc in RestoreDefaultNullToNullableTypePropertyRector (#5795)
  • Loading branch information
TomasVotruba committed Apr 3, 2024
1 parent d4fd813 commit 77aab2e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getNodeTypes() : array
*/
public function refactor(Node $node) : ?Node
{
if ($node->isReadonly()) {
if ($this->isReadonlyClass($node)) {
return null;
}
$hasChanged = \false;
Expand Down Expand Up @@ -95,7 +95,7 @@ private function shouldSkip(Property $property, Class_ $class) : bool
if ($onlyProperty->default instanceof Expr) {
return \true;
}
if ($this->isReadonly($property)) {
if ($this->isReadonlyProperty($property)) {
return \true;
}
if (!$this->nodeTypeResolver->isNullableType($property)) {
Expand All @@ -105,7 +105,7 @@ private function shouldSkip(Property $property, Class_ $class) : bool
$propertyName = $this->getName($property);
return $this->constructorAssignDetector->isPropertyAssigned($class, $propertyName);
}
private function isReadonly(Property $property) : bool
private function isReadonlyProperty(Property $property) : bool
{
// native readonly
if ($property->isReadonly()) {
Expand All @@ -116,4 +116,15 @@ private function isReadonly(Property $property) : bool
$tags = $phpDocInfo->getTagsByName('@readonly');
return $tags !== [];
}
private function isReadonlyClass(Class_ $class) : bool
{
// native readonly
if ($class->isReadonly()) {
return \true;
}
// @immutable annotation
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
$tags = $phpDocInfo->getTagsByName('@immutable');
return $tags !== [];
}
}
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'f889e416d94cbfcf3734bb2fd4daf678aa11f8a9';
public const PACKAGE_VERSION = '3f1ccb3ea131997a435fc2211620e968c6732220';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-04-03 07:03:17';
public const RELEASE_DATE = '2024-04-03 18:19:17';
/**
* @var int
*/
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2450,17 +2450,17 @@
},
{
"name": "symfony\/service-contracts",
"version": "v3.4.1",
"version_normalized": "3.4.1.0",
"version": "v3.4.2",
"version_normalized": "3.4.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/service-contracts.git",
"reference": "fe07cbc8d837f60caf7018068e350cc5163681a0"
"reference": "11bbf19a0fb7b36345861e85c5768844c552906e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/service-contracts\/zipball\/fe07cbc8d837f60caf7018068e350cc5163681a0",
"reference": "fe07cbc8d837f60caf7018068e350cc5163681a0",
"url": "https:\/\/api.github.com\/repos\/symfony\/service-contracts\/zipball\/11bbf19a0fb7b36345861e85c5768844c552906e",
"reference": "11bbf19a0fb7b36345861e85c5768844c552906e",
"shasum": ""
},
"require": {
Expand All @@ -2470,7 +2470,7 @@
"conflict": {
"ext-psr": "<1.1|>=2"
},
"time": "2023-12-26T14:02:43+00:00",
"time": "2023-12-19T21:51:00+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down Expand Up @@ -2515,7 +2515,7 @@
"standards"
],
"support": {
"source": "https:\/\/github.com\/symfony\/service-contracts\/tree\/v3.4.1"
"source": "https:\/\/github.com\/symfony\/service-contracts\/tree\/v3.4.2"
},
"funding": [
{
Expand Down
Loading

0 comments on commit 77aab2e

Please sign in to comment.