-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php81] Skip ReadOnlyPropertyRector on Entity id (#1379)
* [Php81] Skip ReadOnlyPropertyRector on Entity id * update fixture * Fixed 🎉 * clean up
- Loading branch information
1 parent
df1391d
commit 8547bdb
Showing
3 changed files
with
156 additions
and
1 deletion.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
rules-tests/Php81/Rector/Property/ReadOnlyPropertyRector/Fixture/skip_entity.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
use Ramsey\Uuid\UuidInterface; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* News | ||
* | ||
* @ORM\Table(name="news") | ||
* @ORM\Entity(repositoryClass="DoctrineFixtureDemo\Repository\NewsRepository") | ||
*/ | ||
class News | ||
{ | ||
/** | ||
* @var integer | ||
* | ||
* @ORM\Id() | ||
* @ORM\Column(type="uuid", unique=true) | ||
* @ORM\GeneratedValue(strategy="CUSTOM") | ||
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") | ||
*/ | ||
private UuidInterface $id; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="title", type="string", length=50, nullable=false) | ||
*/ | ||
private $title; | ||
|
||
/** | ||
* Get id. | ||
* | ||
* @return string | ||
*/ | ||
public function getId() | ||
{ | ||
return (string) $this->id; | ||
} | ||
|
||
/** | ||
* Set title. | ||
* | ||
* @param string $title | ||
* | ||
* @return self | ||
*/ | ||
public function setTitle($title) | ||
{ | ||
$this->title = $title; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get title. | ||
* | ||
* @return string | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
rules-tests/Php81/Rector/Property/ReadOnlyPropertyRector/Fixture/skip_entity2.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
use Ramsey\Uuid\UuidInterface; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* News | ||
*/ | ||
#[ORM\Table(name: 'news')] | ||
#[ORM\Entity(repositoryClass: 'DoctrineFixtureDemo\Repository\NewsRepository')] | ||
class News2 | ||
{ | ||
/** | ||
* @var UuidInterface | ||
*/ | ||
#[ORM\Id] | ||
#[ORM\Column(type: 'uuid', unique: true)] | ||
#[ORM\GeneratedValue(strategy: 'CUSTOM')] | ||
#[ORM\CustomIdGenerator(class: 'Ramsey\Uuid\Doctrine\UuidGenerator')] | ||
private UuidInterface $id; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
#[ORM\Column(name: 'title', type: 'string', length: 50, nullable: false)] | ||
private $title; | ||
|
||
/** | ||
* Get id. | ||
* | ||
* @return string | ||
*/ | ||
public function getId() | ||
{ | ||
return (string) $this->id; | ||
} | ||
|
||
/** | ||
* Set title. | ||
* | ||
* @param string $title | ||
* | ||
* @return self | ||
*/ | ||
public function setTitle($title) | ||
{ | ||
$this->title = $title; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get title. | ||
* | ||
* @return string | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters