Skip to content

rector-downgrade-php cause invalid printing on nette/utils 4.1.4 #9759

@samsonasik

Description

@samsonasik

Bug Report

Subject Details
Rector version dev-main

Minimal PHP Code Causing Issue

After some investigation, it seems the issue is on rector itself, which somehow add new line on printing:

➜  rector-src git:(main) ✗ bin/rector process vendor/nette/utils/src/Utils/ArrayHash.php --config build/config/config-downgrade.php --dry-run
 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
1 file with changes
===================

1) vendor/nette/utils/src/Utils/ArrayHash.php:1

    ---------- begin diff ----------
@@ Line 1 @@
+
 <?php declare(strict_types=1);

so it was cause error on downgrade process:

https://github.com/rectorphp/rector-src/actions/runs/25715044232/job/75502988819#step:14:75

Expected Behaviour

new line before <?php declare(strict_types=1); should not be added.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions