"System error: "Node "PhpParser\Node\Expr\ClassConstFetch" with is missing scope required for scope refresh"

Aperta
#9,948 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
tooling

Direzione di ricerca

Start by reproducing the dry-run with the supplied Statistic.php example and Rector configuration, then trace where the ClassConstFetch node reaches scope refresh. The report does not name a test or source file, so locate the relevant processing path and add a regression test for this input. Done means dry-run processes the file without the scope refresh error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When running rector with dry-run, while it's displaying the results, i get this error :

[ERROR] Could not process "C:\wamp64\www\regies-portail\src\Entity\Statistic.php" file, due to:
"System error: "Node "PhpParser\Node\Expr\ClassConstFetch" with is missing scope required for scope refresh"

Here is the mentioned file :

`<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;

/**

  • @ORM\Entity(repositoryClass="App\Repository\StatisticRepository")

  • @ORM\InheritanceType("JOINED")

  • @ORM\DiscriminatorColumn(name="statistic", type="string")

  • @ORM\DiscriminatorMap({"statistic"="App\Entity\Statistic", "page" = "App\Entity\Statistic\Page", "email" = "App\Entity\Statistic\Email"})
    */
    class Statistic
    {
    use ORMBehaviors\Timestampable\Timestampable;

    /**

    • @ORM\Id
    • @ORM\GeneratedValue
    • @ORM\Column(type="integer")
      */
      private $id;

    /**

    • @ORM\ManyToOne(targetEntity="Connection", inversedBy="statistics")
      */
      private $connection = null;

    /**

    • @ORM\ManyToOne(targetEntity="Concession", fetch="EAGER")
      */
      private $concession;

    public function getId()
    {
    return $this->id;
    }

    public function getConnection()
    {
    return $this->connection;
    }

    public function setConnection(Connection $connection = null)
    {
    $this->connection = $connection;

     return $this;
    

    }

    public function getConcession()
    {
    return $this->concession;
    }

    public function setConcession(Concession $concession = null)
    {
    $this->concession = $concession;

     return $this;
    

    }
    }
    `

And here goes the rector setting :

withPaths([ __DIR__ . '/src', __DIR__ . '/config', __DIR__ . '/tests', ]) // PHP 8.2, minimum requis pour Symfony 7.4 ->withPhpSets(php82: true) // Règles de migration Symfony et Doctrine ->withComposerBased( symfony: true, doctrine: true, ) // Annotations vers attributs PHP ->withAttributesSets( symfony: true, doctrine: true, sensiolabs: true, ) // Qualité du code Symfony ->withSets([ \Rector\Symfony\Set\SymfonySetList::SYMFONY_CODE_QUALITY, ]) ->withImportNames(removeUnusedImports: true);
Lingua principale
PHP
Stelle
10.5k
Fork
742
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rectorphp/rector

Tutte le issue di rectorphp/rector

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.