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

Đang mở
#9,948 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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);
Ngôn ngữ chính
PHP
Star
10.5k
Fork
742
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rectorphp/rector

Tất cả issue của rectorphp/rector

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.