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: 1 addition & 0 deletions config/set/dead-code/dead-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ services:
Rector\DeadCode\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector: null
Rector\PHPUnit\Rector\ClassMethod\RemoveEmptyTestMethodRector: null
Rector\DeadCode\Rector\TryCatch\RemoveDeadTryCatchRector: null
Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector: null

35 changes: 28 additions & 7 deletions docs/AllRectorsOverview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# All 460 Rectors Overview
# All 461 Rectors Overview

- [Projects](#projects)
- [General](#general)
Expand Down Expand Up @@ -351,12 +351,13 @@ Changes method calls based on matching the first parameter value.
```yaml
services:
Rector\CakePHP\Rector\MethodCall\RenameMethodCallBasedOnParameterRector:
getParam:
match_parameter: paging
replace_with: getAttribute
withParam:
match_parameter: paging
replace_with: withAttribute
$methodNamesByTypes:
getParam:
match_parameter: paging
replace_with: getAttribute
withParam:
match_parameter: paging
replace_with: withAttribute
```

Expand Down Expand Up @@ -2936,6 +2937,26 @@ Remove unreachable statements

<br>

### `RemoveUnusedClassConstantRector`

- class: [`Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector`](/../master/rules/dead-code/src/Rector/ClassConst/RemoveUnusedClassConstantRector.php)
- [test fixtures](/../master/rules/dead-code/tests/Rector/ClassConst/RemoveUnusedClassConstantRector/Fixture)

Remove unused class constants

```diff
class SomeClass
{
- private const SOME_CONST = 'dead';
-
public function run()
{
}
}
```

<br>

### `RemoveUnusedClassesRector`

- class: [`Rector\DeadCode\Rector\Class_\RemoveUnusedClassesRector`](/../master/rules/dead-code/src/Rector/Class_/RemoveUnusedClassesRector.php)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\Blameable;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class BlameableTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Blameable::class;

/**
* @var string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\Locale;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class LocaleTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = Locale::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\Loggable;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class LoggableTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Loggable::class;

/**
* @var string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\Slug;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class SlugTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Slug::class;

/**
* @var mixed[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\SoftDeleteable;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class SoftDeleteableTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = SoftDeleteable::class;

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\Translatable;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class TranslatableTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = Translatable::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\TreeLeft;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class TreeLeftTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = TreeLeft::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\TreeLevel;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class TreeLevelTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = TreeLevel::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\TreeParent;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class TreeParentTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = TreeParent::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\TreeRight;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class TreeRightTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = TreeRight::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\TreeRoot;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class TreeRootTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = TreeRoot::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\Tree;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class TreeTagValueNode extends AbstractTagValueNode
{
/**
* @var string
*/
public const CLASS_NAME = Tree::class;

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\Gedmo;

use Gedmo\Mapping\Annotation\Versioned;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class VersionedTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Versioned::class;

public function __toString(): string
{
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\JMS;

use JMS\DiExtraBundle\Annotation\InjectParams;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class JMSInjectParamsTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = InjectParams::class;

public function __construct(string $originalContent)
{
$this->originalContent = $originalContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\JMS;

use JMS\DiExtraBundle\Annotation\Inject;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class JMSInjectTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Inject::class;

/**
* @var string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\JMS;

use JMS\DiExtraBundle\Annotation\Service;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class JMSServiceValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Service::class;

public function __construct(string $originalContent)
{
$this->originalContent = $originalContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\JMS;

use JMS\Serializer\Annotation\Type;
use Nette\Utils\Strings;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\TypeAwareTagValueNodeInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class SerializerTypeTagValueNode extends AbstractTagValueNode implements TypeAwareTagValueNodeInterface, ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Type::class;

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocNode\PHPDI;

use DI\Annotation\Inject;
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;

final class PHPDIInjectTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Inject::class;

/**
* @var string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@

use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

final class SensioMethodTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
{
/**
* @var string
*/
public const CLASS_NAME = Method::class;

/**
* @var string[]
*/
Expand Down
Loading