Skip to content

Commit

Permalink
add fixture for use class
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 14, 2024
1 parent 99c28fd commit e0e4083
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddReturnArrayDocblockBasedOnArrayMapRector\Fixture;

use stdClass;

final class SkipAlreadyClass
{
/**
* @return stdClass[]
*/
public function process(array $items)
{
return array_map(function ($item): stdClass {
return $item;
}, $items);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddReturnArrayDocblock

final class SkipFirstClassCallable
{
public function __construct(array $items)
public function run(array $items)
{
return array_map(...);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddReturnArrayDocblock

final class SkipIfElse
{
public function __construct(array $items)
public function go(array $items)
{
if (rand(0, 1)) {
return array_map(function ($item): int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Rector\Rector\AbstractRector;
use Rector\StaticTypeMapper\StaticTypeMapper;
use Rector\TypeDeclaration\NodeAnalyzer\ReturnAnalyzer;
use Rector\TypeDeclaration\PhpDocParser\ReturnPhpDocDecorator;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand Down

0 comments on commit e0e4083

Please sign in to comment.