Skip to content

Commit cba4f44

Browse files
committed
fixup! [typed-collections] Add ArrayOffsetSetToSetCollectionCallRector
1 parent b81c574 commit cba4f44

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Doctrine\Tests\TypedCollections\Rector\Assign\ArrayOffsetSetToSetCollectionCallRector\Fixture;
6+
7+
final class SkipNonCollection
8+
{
9+
/**
10+
* @var array<int, string>
11+
*/
12+
public $items;
13+
14+
public function setItems()
15+
{
16+
$items = $this->getItems();
17+
$items[5] = 10;
18+
}
19+
20+
private function getItems()
21+
{
22+
return $this->items;
23+
}
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Doctrine\Tests\TypedCollections\Rector\Assign\ArrayOffsetSetToSetCollectionCallRector\Fixture;
6+
7+
use Doctrine\Common\Collections\Collection;
8+
9+
final class SkipWithoutDim
10+
{
11+
/**
12+
* @var Collection<int, string>
13+
*/
14+
public $items;
15+
16+
public function setItems()
17+
{
18+
$items = $this->getItems();
19+
$items[] = 10;
20+
}
21+
22+
private function getItems(): Collection
23+
{
24+
return $this->items;
25+
}
26+
}

0 commit comments

Comments
 (0)