-
-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8de750
commit 4fbca58
Showing
4 changed files
with
75 additions
and
0 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
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
57 changes: 57 additions & 0 deletions
57
...laration/tests/Rector/ClassMethod/AddArrayReturnDocTypeRector/Fixture/return_uuid.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,57 @@ | ||
<?php | ||
|
||
namespace Rector\TypeDeclaration\Tests\Rector\ClassMethod\AddArrayReturnDocTypeRector\Fixture; | ||
|
||
use Rector\TypeDeclaration\Tests\Rector\ClassMethod\AddArrayReturnDocTypeRector\Source\EntityReturningUuid; | ||
|
||
final class FullyQualifiedName | ||
{ | ||
/** | ||
* @var EntityReturningUuid[] | ||
*/ | ||
private $amenityBuildings = []; | ||
|
||
/** | ||
* @return int[] | ||
*/ | ||
public function getBuildingIds(): array | ||
{ | ||
$buildingIds = []; | ||
foreach ($this->amenityBuildings as $amenityBuilding) { | ||
$buildingIds[] = $amenityBuilding->getId(); | ||
} | ||
|
||
return $buildingIds; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\TypeDeclaration\Tests\Rector\ClassMethod\AddArrayReturnDocTypeRector\Fixture; | ||
|
||
use Rector\TypeDeclaration\Tests\Rector\ClassMethod\AddArrayReturnDocTypeRector\Source\EntityReturningUuid; | ||
|
||
final class FullyQualifiedName | ||
{ | ||
/** | ||
* @var EntityReturningUuid[] | ||
*/ | ||
private $amenityBuildings = []; | ||
|
||
/** | ||
* @return \Ramsey\Uuid\UuidInterface[] | ||
*/ | ||
public function getBuildingIds(): array | ||
{ | ||
$buildingIds = []; | ||
foreach ($this->amenityBuildings as $amenityBuilding) { | ||
$buildingIds[] = $amenityBuilding->getId(); | ||
} | ||
|
||
return $buildingIds; | ||
} | ||
} | ||
|
||
?> |
14 changes: 14 additions & 0 deletions
14
...ation/tests/Rector/ClassMethod/AddArrayReturnDocTypeRector/Source/EntityReturningUuid.php
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,14 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Rector\TypeDeclaration\Tests\Rector\ClassMethod\AddArrayReturnDocTypeRector\Source; | ||
|
||
use Ramsey\Uuid\Uuid; | ||
use Ramsey\Uuid\UuidInterface; | ||
|
||
final class EntityReturningUuid | ||
{ | ||
public function getId(): UuidInterface | ||
{ | ||
return Uuid::uuid4(); | ||
} | ||
} |