Skip to content

Commit 6b271c7

Browse files
committed
[Unambiguous] Skip return different object on FluentSettersToStandaloneCallMethodRector
1 parent 46618df commit 6b271c7

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Rector\Tests\Unambiguous\Rector\Expression\FluentSettersToStandaloneCallMethodRector\Fixture;
4+
5+
use Rector\Tests\Unambiguous\Rector\Expression\FluentSettersToStandaloneCallMethodRector\Source\SetNameCaller;
6+
7+
class SkipReturnDifferentObject
8+
{
9+
public function setup()
10+
{
11+
return (new SetNameCaller())
12+
->setName('John')
13+
->setSurname('Doe');
14+
}
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Rector\Tests\Unambiguous\Rector\Expression\FluentSettersToStandaloneCallMethodRector\Source;
4+
5+
class SetNameCaller
6+
{
7+
public function setName(): SurnameCaller
8+
{
9+
return new SurnameCaller();
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Rector\Tests\Unambiguous\Rector\Expression\FluentSettersToStandaloneCallMethodRector\Source;
4+
5+
class SurnameCaller
6+
{
7+
public function setSurname(): self
8+
{
9+
return $this;
10+
}
11+
}

0 commit comments

Comments
 (0)