-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix annotation to attribute rector with doctrine table and nested uni…
…queConstraints option (#1850)
- Loading branch information
Showing
6 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
...onToAttributeRector/Fixture/Doctrine/table_and_nested_index_and_uniqueconstraints.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,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture\Doctrine; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* @ORM\Table(indexes={@ORM\Index(name="search_idx", columns={"name", "c"})}, uniqueConstraints={@ORM\UniqueConstraint(name="name_idx", columns={"name"})}] | ||
*/ | ||
class TableAndNestedIndex | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture\Doctrine; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
#[ORM\Table] | ||
#[ORM\Index(name: 'search_idx', columns: ['name', 'c'])] | ||
#[ORM\UniqueConstraint(name: 'name_idx', columns: ['name'])] | ||
class TableAndNestedIndex | ||
{ | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
...tationToAttributeRector/FixturePhp81/table_and_nested_index_and_uniqueconstraints.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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture\FixturePhp81; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* @ORM\Table(indexes={@ORM\Index(name="search_idx", columns={"name", "c"})}, uniqueConstraints={@ORM\UniqueConstraint(name="name_idx", columns={"name"})}] | ||
*/ | ||
class TableAndNestedIndex | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture\FixturePhp81; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
#[ORM\Table(indexes: [new ORM\Index(name: 'search_idx', columns: ['name', 'c'])], uniqueConstraints: [new ORM\UniqueConstraint(name: 'name_idx', columns: ['name'])])] | ||
class TableAndNestedIndex | ||
{ | ||
} | ||
|
||
?> |
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
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
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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\ORM\Mapping; | ||
|
||
if (class_exists('Doctrine\ORM\Mapping\Index')) { | ||
return; | ||
} | ||
|
||
final class Index | ||
{ | ||
public function __construct($name, $columns = []) | ||
{ | ||
} | ||
} |