-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix RenamePropertyToMatchTypeRector to skip Laravel collections and a…
…void accident rename (#4811)
- Loading branch information
1 parent
5363a67
commit 00f736f
Showing
4 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...or/Class_/RenamePropertyToMatchTypeRector/Fixture/skip_laravel_collection_of_type.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,20 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Class_\RenamePropertyToMatchTypeRector\Fixture; | ||
|
||
use Illuminate\Support\Collection; | ||
|
||
final class SkipCollectionOfType | ||
{ | ||
private Collection $items; | ||
|
||
public function __construct(Collection $items) | ||
{ | ||
$this->items = $items; | ||
} | ||
|
||
public function getItems(): Collection | ||
{ | ||
return $this->items; | ||
} | ||
} |
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,37 @@ | ||
<?php | ||
|
||
namespace Illuminate\Support; | ||
|
||
use Traversable; | ||
|
||
if (class_exists('Illuminate\Support\Collection')) { | ||
return; | ||
} | ||
|
||
class Collection implements \ArrayAccess, \IteratorAggregate | ||
{ | ||
public function offsetGet(mixed $offset): mixed | ||
{ | ||
// TODO: Implement offsetGet() method. | ||
} | ||
|
||
public function getIterator(): Traversable | ||
{ | ||
// TODO: Implement getIterator() method. | ||
} | ||
|
||
public function offsetExists(mixed $offset): bool | ||
{ | ||
// TODO: Implement offsetExists() method. | ||
} | ||
|
||
public function offsetSet(mixed $offset, mixed $value): void | ||
{ | ||
// TODO: Implement offsetSet() method. | ||
} | ||
|
||
public function offsetUnset(mixed $offset): void | ||
{ | ||
// TODO: Implement offsetUnset() method. | ||
} | ||
} |