Skip to content

Commit 082bce2

Browse files
committed
add fixture with getter, ctor and readonly non promoted
1 parent 951f467 commit 082bce2

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php84\Rector\Class_\PropertyHookRector\Fixture;
4+
5+
final class AllowGetterAndReadonly
6+
{
7+
private readonly string $name;
8+
9+
public function __construct(string $name)
10+
{
11+
$this->name = $name;
12+
}
13+
14+
public function getName(): string
15+
{
16+
return $this->name;
17+
}
18+
}
19+
20+
?>
21+
-----
22+
<?php
23+
24+
namespace Rector\Tests\Php84\Rector\Class_\PropertyHookRector\Fixture;
25+
26+
final class AllowGetterAndReadonly
27+
{
28+
private readonly string $name {
29+
get => $this->name;
30+
}
31+
32+
public function __construct(string $name)
33+
{
34+
$this->name = $name;
35+
}
36+
}
37+
38+
?>

rules-tests/Php84/Rector/Class_/PropertyHookRector/Fixture/skip_readonly.php.inc renamed to rules-tests/Php84/Rector/Class_/PropertyHookRector/Fixture/skip_readonly_getter_and_setter.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Rector\Tests\Php84\Rector\Class_\PropertyHookRector\Fixture;
44

5-
final class SkipReadonly
5+
final class SkipReadonlyGetterAndSetter
66
{
77
private readonly string $name;
88

0 commit comments

Comments
 (0)