Skip to content

Commit e3c402b

Browse files
move classes and interfaces to source
1 parent bebeca3 commit e3c402b

13 files changed

+104
-70
lines changed

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/narrow_from_abstract_class.php.inc

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
44

5-
abstract class AbstractTalk
6-
{
7-
}
8-
9-
final class ConcreteConferenceTalk extends AbstractTalk
10-
{
11-
}
5+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\AbstractTalk;
6+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConcreteConferenceTalk;
127

138
final class TalkFactory
149
{
@@ -24,17 +19,12 @@ final class TalkFactory
2419

2520
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
2621

27-
abstract class AbstractTalk
28-
{
29-
}
30-
31-
final class ConcreteConferenceTalk extends AbstractTalk
32-
{
33-
}
22+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\AbstractTalk;
23+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConcreteConferenceTalk;
3424

3525
final class TalkFactory
3626
{
37-
public function create(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture\ConcreteConferenceTalk
27+
public function create(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConcreteConferenceTalk
3828
{
3929
return new ConcreteConferenceTalk();
4030
}

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/narrow_from_interface.php.inc

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
44

5-
interface TalkInterface
6-
{
7-
}
8-
9-
final class ConferenceTalkImplementation implements TalkInterface
10-
{
11-
}
5+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\TalkInterface;
6+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConferenceTalkImplementation;
127

138
final class TalkFactory
149
{
@@ -24,17 +19,12 @@ final class TalkFactory
2419

2520
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
2621

27-
interface TalkInterface
28-
{
29-
}
30-
31-
final class ConferenceTalkImplementation implements TalkInterface
32-
{
33-
}
22+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\TalkInterface;
23+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConferenceTalkImplementation;
3424

3525
final class TalkFactory
3626
{
37-
public function create(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture\ConferenceTalkImplementation
27+
public function create(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConferenceTalkImplementation
3828
{
3929
return new ConferenceTalkImplementation();
4030
}

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/narrow_interface_inheritance.php.inc

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,9 @@
22

33
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
44

5-
interface ProductInterface
6-
{
7-
}
8-
9-
final class ConcreteProduct implements ProductInterface
10-
{
11-
}
12-
13-
abstract class AbstractProductFactory
14-
{
15-
abstract public function build(): ProductInterface;
16-
}
5+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\AbstractProductFactory;
6+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ProductInterface;
7+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConcreteProduct;
178

189
final class ConcreteProductFactory extends AbstractProductFactory
1910
{
@@ -34,22 +25,13 @@ final class ConcreteProductFactory extends AbstractProductFactory
3425

3526
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
3627

37-
interface ProductInterface
38-
{
39-
}
40-
41-
final class ConcreteProduct implements ProductInterface
42-
{
43-
}
44-
45-
abstract class AbstractProductFactory
46-
{
47-
abstract public function build(): ProductInterface;
48-
}
28+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\AbstractProductFactory;
29+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ProductInterface;
30+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConcreteProduct;
4931

5032
final class ConcreteProductFactory extends AbstractProductFactory
5133
{
52-
public function build(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture\ConcreteProduct
34+
public function build(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConcreteProduct
5335
{
5436
return $this->createProduct();
5537
}

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/narrow_interface_via_method_call.php.inc

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
44

5-
interface PaymentInterface
6-
{
7-
}
8-
9-
final class StripePayment implements PaymentInterface
10-
{
11-
}
5+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\PaymentInterface;
6+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\StripePayment;
127

138
final class PaymentFactory
149
{
@@ -29,17 +24,12 @@ final class PaymentFactory
2924

3025
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
3126

32-
interface PaymentInterface
33-
{
34-
}
35-
36-
final class StripePayment implements PaymentInterface
37-
{
38-
}
27+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\PaymentInterface;
28+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\StripePayment;
3929

4030
final class PaymentFactory
4131
{
42-
public function create(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture\StripePayment
32+
public function create(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\StripePayment
4333
{
4434
return $this->createStripePayment();
4535
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source;
6+
7+
abstract class AbstractProductFactory
8+
{
9+
abstract public function build(): ProductInterface;
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source;
6+
7+
abstract class AbstractTalk
8+
{
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source;
6+
7+
final class ConcreteConferenceTalk extends AbstractTalk
8+
{
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source;
6+
7+
final class ConcreteProduct implements ProductInterface
8+
{
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source;
6+
7+
final class ConferenceTalkImplementation implements TalkInterface
8+
{
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source;
6+
7+
interface PaymentInterface
8+
{
9+
}

0 commit comments

Comments
 (0)