classes that specify visibility on class constants can't be parsed
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- php
- 領域
- documentation, tooling
調査の方向性
nikic/php-parser と phpdocumentor/reflection に関係する Composer の依存関係を調査し、issue にあるクラス定数の例で失敗を再現してください。依存関係の更新によって public および protected のクラス定数をパースできることと、既存の parser の動作が維持されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
For example,
class My_Class {
public const C1 = 'value';
protected const C2 = 'another value';
...
}
Trying the parse the above results in an error like:
Parse Error: Syntax error, unexpected T_CONST, expecting T_FUNCTION on line xyz
and the entire class is not imported.
Visibility for class constants wasn't added to PHP until 7.1. Of course, as of today (2020-08-14) nothing in core specifies visibility on class constants since the minimum PHP is still 5.6. And current WPCS states:
Visibility for class constants can not be used in WordPress Core until the minimum PHP version has been raised to PHP 7.1 (and won’t be enforced until that time).
It is hopeful (likely?) that WP 5.6 will bump the minimum PHP to 7.1. So, the need to parse such classes will be coming sooner rather than later.
As best I can tell, the error is generated by nikic/php-parser, which is a transitive dependency of phpdocumentor/reflection. The latest version of nikic/php-parser fully supports PHP 7.1+, so I think the solution is simply to update the composer dependencies of this plugin, but things will need to be tested thoroughly after those dependencies are updated.
- 主要言語
- PHP
- スター
- 239
- フォーク
- 81
- 平均マージ
- 16時間 29分
- マージ済み PR(30日)
- 8
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WordPress/phpdoc-parser のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
WordPress/phpdoc-parser#269 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
WordPress/phpdoc-parser#268 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
WordPress/phpdoc-parser#254 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
WordPress/phpdoc-parser#246 · コメント 9 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
WordPress/phpdoc-parser#235 · コメント 1 件 ·
WordPress/phpdoc-parser の issue をすべて見る
似ている issue
-
tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
UX
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ProfessionalWiki/NeoWiki#1525 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug customer-reported
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MagnaCapax/PMSS#949 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Automattic/static-site-importer#1829 ·