rector icon indicating copy to clipboard operation
rector copied to clipboard

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code

Results 119 rector issues
Sort by recently updated
recently updated
newest added

# Feature Request When using `--output-format=github`, I get a nice "Rector report" where I can view the diffs of all the changes Rector would make. Unfortunately this report doesn't show...

feature

```diff $json = '{"key": "value"}'; -if (json_decode($json, true) !== null && json_last_error() === JSON_ERROR_NONE) { +if (json_validate($json)) { echo "Valid JSON"; } ```

feature

```diff $animals = ['dog', 'cat', 'cow', 'duck', 'goose']; -$found = null; -foreach ($animals as $animal) { - if (str_starts_with($animal, 'c')) { - $found = $animal; - break; - } -}...

feature

# Feature Request There's an unhandled PHP 8.1 deprecation scenario with `preg_split` that's currently not handled. Example https://3v4l.org/cVPim I guess we need something similar to [`NullToStrictStringFuncCallArgRector`](https://github.com/rectorphp/rector/blob/main/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php) but for integers. ##...

easy pick
feature

```diff -/** - * @deprecated Use newFunction() instead - */ +#[Deprecated("Use newFunction() instead")] function oldFunction() {} ```

feature

```diff class Product { - private string $name; - - public function getName(): string { - return $this->name; - } - - public function setName(string $name): void { - $this->name...

feature

Ref https://liamhammett.com/php-84s-new-domhtmldocument-in-diffs

feature

While running Rector I get the following error, hence logging this report; ``` [ERROR] Could not process "/var/www/project/src/Command/ProcessEventChangesCommand.php" file, due to: "System error: "assert($startLine > 0)" Run Rector with "--debug"...

# Bug Report | Subject | Details | | :------------- | :--------------------| | Rector version | last dev-main | | Installed as | composer dependency | ## Minimal PHP Code...

bug

# Bug Report | Subject | Details | | :------------- | :------------------------------------------------- | | Rector version | 2.2.13 | Hi, I ran into an issue with the `AddRouteAnnotationRector` rule: my...

bug