Skip to content

[Php73] Rector\Php\Rector\FuncCall\StringifyStrNeedlesRector: does the job twice #1632

@gnutix

Description

@gnutix

Here's a strange result from rector using level "php73.yaml". I've run rector once, it found this fix (adding (string) before $search->getQ() in the strpos call), I applied it, and now when running Rector again it wants to do it all over again.

1) src/FileLogFinder.php

    ---------- begin diff ----------
--- Original
+++ New
@@ -48,7 +48,7 @@
         if (!empty($search->getQ())) {
             $logs = array_filter($logs, function (FileLog $log) use ($search) {
                 $res = false;
-                if (false !== strpos($log->getText(), (string) $search->getQ())) {
+                if (false !== strpos($log->getText(), (string) (string) $search->getQ())) {
                     $res = true;
                 }
    ----------- end diff -----------

Applied rectors:

 * Rector\Php\Rector\FuncCall\StringifyStrNeedlesRector

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions