php / php/php-src

Impl. `ReflectionFunctionAbstract::getStartColumn` (and getEndColumn)

オープン
#11,391 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Extension: reflection Feature Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

Currently only line can be obtained by reflection.

AFAK this limitation is comming from AST as only line and no column is stored to save memory.

I cannot tell if storing file column is worth now/in 2023 for every AST node, but I would welcome the column number to be stored for classes and functions to get able to get the column number via reflection and locate the source code more precisely.

In our usecase, we use the reflection data to highlight a Closure in a file and with short closures, more than one Closure can be present on 1 line with actual PSR-12 style, ie. currently a Closure instance cannot be mapped to a code section.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

この issue では ReflectionFunctionAbstract::getStartColumn と getEndColumn が挙げられており、現在 AST ノードは行を保持しているものの、列を保持していないことが指摘されています。まず reflection メタデータと AST の位置表現を追跡してください。対象となるファイルやテストは特定されていません。reflection が同じ行にある複数の closures を正確な開始列と終了列で区別でき、メモリへの影響にも対処できていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
compilers
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。