3.3.44. Rector

3.3.44.1. Rector

Suggest configuration for Rector refactoring tool.

The Rector report is a helper report for Tomas Votruba’s Rector tool.

Some issues spotted by Exakat may be fixed automagically by Rector. Rector offers more than 550 (and counting) rules, that may save countless hours of work.

For example, CombinedAssignRector, simplifies $value = $value + 5 into +$value += 5;. On Exakat, the rule Structures/CouldUseShortAssignation spot those too.

Not all exakat rules are covered by Rector, and vice-versa. CompactToVariablesRector aims at skipping usage of compact(), while Structures/CouldUseCompact suggest the contrary.

Rector and Exakat both use different approaches to code review. It is recommended to review the changes before committing them.

Check RectorPHP website, its rector github repository, and Tomas Votruba account.

# Add this to your rector.yaml file
# At the root of the source to be analyzed
# Generated on 2021-10-14 04:15:14, by Exakat (2.2.3- build 1255)

services:
    Rector\CodeQuality\Rector\If_\ShortenElseIfR
    Rector\CodeQuality\Rector\Concat\JoinStringConcatRector

3.3.44.2. Specs

Short name

Rector

Rulesets

Rector.

Type

Text

Target

This report is written in ‘rector.exakat.yaml’.

Available in

Entreprise Edition