Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

phpstan.neon
rector.yaml
create-rector.yaml.dist
phpunit.xml
ecs.yaml
ecs-after-rector.yaml
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ LICENSE export-ignore
ecs.yml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
create-rector.yaml.dist export-ignore
rector.yaml export-ignore
utils export-ignore
20 changes: 8 additions & 12 deletions BACKERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@ Development of Rector is made possible thanks to these awesome backers! Would yo

Check out all the tiers - higher ones include additional goodies like placing the logo of your company in Rector's README or creating custom set for your needs.

## $20+

- Jan Votruba

## $5+

- Kerrial Newham
- Jan Mikeš
- Jan Kuchař
- Jakob Oberhummer
- Sebastian Schreiber
- Attila Fulop

## $1+

- Jakob Oberhummer
- Jan Kuchař
- Jan Mikes
- Arnaud TIERANT

**Thank you for making this happen.**

<br>

## PayPal Backers

- Musement S.p.a.
- Sebastian Schreiber

<!-- source: https://www.patreon.com/manageRewardsList -->
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"Rector\\Php72\\": "packages/Php72/src",
"Rector\\Php73\\": "packages/Php73/src",
"Rector\\Php74\\": "packages/Php74/src",
"Rector\\Php80\\": "packages/Php80/src",
"Rector\\RemovingStatic\\": "packages/RemovingStatic/src",
"Rector\\Renaming\\": "packages/Renaming/src",
"Rector\\Restoration\\": "packages/Restoration/src",
Expand All @@ -101,8 +102,7 @@
"Rector\\Utils\\RectorGenerator\\": "utils/RectorGenerator/src",
"Rector\\StrictCodeQuality\\": "packages/StrictCodeQuality/src",
"Rector\\DynamicTypeAnalysis\\": "packages/DynamicTypeAnalysis/src",
"Rector\\PhpDeglobalize\\": "packages/PhpDeglobalize/src",
"Rector\\Php80\\": "packages/Php80/src"
"Rector\\PhpDeglobalize\\": "packages/PhpDeglobalize/src"
}
},
"autoload-dev": {
Expand Down Expand Up @@ -143,6 +143,7 @@
"Rector\\Php72\\Tests\\": "packages/Php72/tests",
"Rector\\Php73\\Tests\\": "packages/Php73/tests",
"Rector\\Php74\\Tests\\": "packages/Php74/tests",
"Rector\\Php80\\Tests\\": "packages/Php80/tests",
"Rector\\RemovingStatic\\Tests\\": "packages/RemovingStatic/tests",
"Rector\\Renaming\\Tests\\": "packages/Renaming/tests",
"Rector\\Restoration\\Tests\\": "packages/Restoration/tests",
Expand All @@ -159,8 +160,7 @@
"Rector\\ZendToSymfony\\Tests\\": "packages/ZendToSymfony/tests",
"Rector\\StrictCodeQuality\\Tests\\": "packages/StrictCodeQuality/tests",
"Rector\\DynamicTypeAnalysis\\Tests\\": "packages/DynamicTypeAnalysis/tests",
"Rector\\PhpDeglobalize\\Tests\\": "packages/PhpDeglobalize/tests",
"Rector\\Php80\\Tests\\": "packages/Php80/tests"
"Rector\\PhpDeglobalize\\Tests\\": "packages/PhpDeglobalize/tests"
},
"classmap": [
"packages/Symfony/tests/Rector/FrameworkBundle/AbstractToConstructorInjectionRectorSource",
Expand Down
31 changes: 0 additions & 31 deletions create-rector.yaml.dist

This file was deleted.

4 changes: 4 additions & 0 deletions rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ parameters:

# so Rector code is still PHP 7.1 compatible
php_version_features: '7.1'


rector_recipe:
package: "Utils"
20 changes: 0 additions & 20 deletions src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Rector\Exception\Configuration\InvalidConfigurationException;
use Rector\Utils\DocumentationGenerator\Command\DumpNodesCommand;
use Rector\Utils\DocumentationGenerator\Command\DumpRectorsCommand;
use Rector\Utils\RectorGenerator\Contract\ContributorCommandInterface;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputDefinition;
Expand Down Expand Up @@ -41,7 +40,6 @@ public function __construct(Configuration $configuration, array $commands = [])
{
parent::__construct(self::NAME, PrettyVersions::getVersion('rector/rector')->getPrettyVersion());

$commands = $this->filterCommandsByScope($commands);
$this->addCommands($commands);
$this->configuration = $configuration;
}
Expand Down Expand Up @@ -114,24 +112,6 @@ protected function getDefaultInputDefinition(): InputDefinition
return $defaultInputDefinition;
}

/**
* @param Command[] $commands
* @return Command[]
*/
private function filterCommandsByScope(array $commands): array
{
// nothing to filter
if (file_exists(getcwd() . '/bin/rector')) {
return $commands;
}

$filteredCommands = array_filter($commands, function (Command $command): bool {
return ! $command instanceof ContributorCommandInterface;
});

return array_values($filteredCommands);
}

private function getNewWorkingDir(InputInterface $input): string
{
$workingDir = $input->getParameterOption(['--working-dir', '-d']);
Expand Down
35 changes: 35 additions & 0 deletions utils/RectorGenerator/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,38 @@ services:
exclude:
- '../src/Exception/*'
- '../src/ValueObject/*'

parameters:
rector_recipe:
# run "bin/rector create" to create a new Rector + tests from this config
package: "Celebrity"
name: "SplitToExplodeRector"
node_types:
# put main node first, it is used to create namespace
- "Assign"

description: "Removes unneeded $a = $a assigns"
code_before: >
<?php

class SomeClass
{
public function run()
{
$a = $a;
}
}

code_after: >
<?php

class SomeClass
{
public function run()
{
}
}

source: # e.g. link to RFC or headline in upgrade guide, 1 or more in the list
- ""
set: "" # e.g. symfony30, target config to append this rector to
Loading