Skip to content

Commit

Permalink
[Php54] Rename ArrayToShortArrayRector to LongArrayToShortArrayRector (
Browse files Browse the repository at this point in the history
  • Loading branch information
edsrzf committed Jul 3, 2022
1 parent 3582024 commit a70d0e5
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4541,11 +4541,11 @@ Use ?: instead of ?, where useful

## Php54

### ArrayToShortArrayRector
### LongArrayToShortArrayRector

Array to short array
Long array to short array

- class: [`Rector\Php54\Rector\Array_\ArrayToShortArrayRector`](../rules/Php54/Rector/Array_/ArrayToShortArrayRector.php)
- class: [`Rector\Php54\Rector\Array_\LongArrayToShortArrayRector`](../rules/Php54/Rector/Array_/LongArrayToShortArrayRector.php)

```diff
class SomeClass
Expand Down
4 changes: 2 additions & 2 deletions config/set/php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php54\Rector\Array_\ArrayToShortArrayRector;
use Rector\Php54\Rector\Array_\LongArrayToShortArrayRector;
use Rector\Php54\Rector\Break_\RemoveZeroBreakContinueRector;
use Rector\Php54\Rector\FuncCall\RemoveReferenceFromCallRector;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(ArrayToShortArrayRector::class);
$rectorConfig->rule(LongArrayToShortArrayRector::class);

$rectorConfig
->ruleWithConfiguration(RenameFunctionRector::class, [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Tests\Php54\Rector\Array_\ArrayToShortArrayTest\Fixture;
namespace Rector\Tests\Php54\Rector\Array_\LongArrayToShortArrayTest\Fixture;

function emptyArray()
{
Expand All @@ -21,7 +21,7 @@ function manyElementArray()
-----
<?php

namespace Rector\Tests\Php54\Rector\Array_\ArrayToShortArrayTest\Fixture;
namespace Rector\Tests\Php54\Rector\Array_\LongArrayToShortArrayTest\Fixture;

function emptyArray()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Rector\Tests\Php54\Rector\Array_\LongArrayToShortArrayTest\Fixture;

function emptyArray()
{
return [];
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Rector\Tests\Php54\Rector\Array_\ArrayToShortArrayRector;
namespace Rector\Tests\Php54\Rector\Array_\LongArrayToShortArrayRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

final class ArrayToShortArrayRectorTest extends AbstractRectorTestCase
final class LongArrayToShortArrayRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php54\Rector\Array_\ArrayToShortArrayRector;
use Rector\Php54\Rector\Array_\LongArrayToShortArrayRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(ArrayToShortArrayRector::class);
$rectorConfig->rule(LongArrayToShortArrayRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Rector\Tests\Php54\Rector\Array_\ArrayToShortArrayRector\ArrayToShortArrayRectorTest
* @see \Rector\Tests\Php54\Rector\Array_\LongArrayToShortArrayRector\LongArrayToShortArrayRectorTest
*/
final class ArrayToShortArrayRector extends AbstractRector implements MinPhpVersionInterface
final class LongArrayToShortArrayRector extends AbstractRector implements MinPhpVersionInterface
{
public function provideMinPhpVersion(): int
{
Expand All @@ -26,7 +26,7 @@ public function provideMinPhpVersion(): int
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
'Array to short array',
'Long array to short array',
[
new CodeSample(
<<<'CODE_SAMPLE'
Expand Down

0 comments on commit a70d0e5

Please sign in to comment.