Skip to content

Commit 2da2085

Browse files
committed
[Rector] Apply Option::PARALLEL to speed up analyze
1 parent 80411a6 commit 2da2085

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

rector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
4444
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
4545
use Rector\PHPUnit\Set\PHPUnitSetList;
46+
use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector;
4647
use Rector\Set\ValueObject\LevelSetList;
4748
use Rector\Set\ValueObject\SetList;
4849
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
@@ -59,6 +60,7 @@
5960

6061
$parameters = $containerConfigurator->parameters();
6162

63+
$parameters->set(Option::PARALLEL, true);
6264
// paths to refactor; solid alternative to CLI arguments
6365
$parameters->set(Option::PATHS, [__DIR__ . '/app', __DIR__ . '/system', __DIR__ . '/tests', __DIR__ . '/utils/Rector']);
6466

@@ -145,4 +147,5 @@
145147
$services->set(FuncGetArgsToVariadicParamRector::class);
146148
$services->set(MakeInheritedMethodVisibilitySameAsParentRector::class);
147149
$services->set(SimplifyEmptyArrayCheckRector::class);
150+
$services->set(NormalizeNamespaceByPSR4ComposerAutoloadRector::class);
148151
};

tests/system/Commands/BaseCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ public function testMagicIssetTrue()
3535
{
3636
$command = new AppInfo($this->logger, service('commands'));
3737

38-
$this->assertTrue(isset($command->group));
38+
$this->assertObjectHasAttribute('group', $command);
3939
}
4040

4141
public function testMagicIssetFalse()
4242
{
4343
$command = new AppInfo($this->logger, service('commands'));
4444

45-
$this->assertFalse(isset($command->foobar));
45+
$this->assertObjectNotHasAttribute('foobar', $command);
4646
}
4747

4848
public function testMagicGet()

tests/system/Files/FileCollectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12+
namespace CodeIgniter\Files;
13+
1214
use CodeIgniter\Files\Exceptions\FileException;
13-
use CodeIgniter\Files\File;
14-
use CodeIgniter\Files\FileCollection;
1515
use CodeIgniter\Test\CIUnitTestCase;
1616

1717
/**

tests/system/Publisher/PublisherInputTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12-
use CodeIgniter\Publisher\Publisher;
12+
namespace CodeIgniter\Publisher;
13+
1314
use CodeIgniter\Test\CIUnitTestCase;
1415

1516
/**

tests/system/Publisher/PublisherOutputTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12-
use CodeIgniter\Publisher\Publisher;
12+
namespace CodeIgniter\Publisher;
13+
1314
use CodeIgniter\Test\CIUnitTestCase;
1415
use org\bovigo\vfs\vfsStream;
1516
use org\bovigo\vfs\vfsStreamDirectory;

tests/system/Publisher/PublisherRestrictionsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12+
namespace CodeIgniter\Publisher;
13+
1214
use CodeIgniter\Publisher\Exceptions\PublisherException;
13-
use CodeIgniter\Publisher\Publisher;
1415
use CodeIgniter\Test\CIUnitTestCase;
1516

1617
/**

tests/system/Publisher/PublisherSupportTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12+
namespace CodeIgniter\Publisher;
13+
1214
use CodeIgniter\Publisher\Exceptions\PublisherException;
13-
use CodeIgniter\Publisher\Publisher;
1415
use CodeIgniter\Test\CIUnitTestCase;
1516
use Tests\Support\Publishers\TestPublisher;
1617

0 commit comments

Comments
 (0)