Add Rector for automated code modernisation and refactoring
まだ誰も着手していません。
評価
調査の方向性
Start by reading composer.json and the constructor in src/Client.php, then check Rector’s PHP 8.1 rules against the SDK’s PHP 8.0 support. Decide which rule sets are safe and whether CI should run Rector; done means the dependency, configuration, and dry-run and fix scripts are defined with that compatibility decision documented.
索引モデルが issue の本文から書いたものです。
説明
Motivation
As PHP evolves and the SDK targets PHP 8.0+, there are patterns that could be automatically modernised: constructor promotion, match expressions, named arguments, and more.
Example
Current code in src/Client.php:
public function __construct(?string $token = null, ...)
{
$this->token = $token ?? getenv('OPEN_API_TOKEN');
...
}
With Rector + constructor promotion this could become:
public function __construct(
private ?string $token = null,
...
) {
$this->token ??= getenv('OPEN_API_TOKEN');
}
Proposal
- Add
rector/rectortorequire-dev - Configure a
rector.phpwith theLevelSetList::UP_TO_PHP_81preset - Add a
composer run rectorscript for dry-run andcomposer run rector-fixto apply
Open questions
- Should Rector run in CI as a check-only step, or only locally?
- Which rule sets are safe to apply without risking breaking changes for consumers on PHP 8.0?
- 主要言語
- PHP
- スター
- 20
- フォーク
- 3
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openapi/openapi-php-sdk のほかの issue
-
Improve PHPDoc Consistency Across the Codebase再び着手できるかも @Seraphim200001 が 140 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
openapi/openapi-php-sdk#36 · コメント 3 件 ·
-
enhancement help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
openapi/openapi-php-sdk#34 ·
-
good first issue question
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
openapi/openapi-php-sdk#33 · コメント 2 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
openapi/openapi-php-sdk#32 ·
-
help wanted question
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
openapi/openapi-php-sdk#31 ·
openapi/openapi-php-sdk の issue をすべて見る
似ている issue
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 4 日以内に返信
-
feature request
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Automattic/blocks-engine#2803 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hestiacp/hestiacp#5798 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug Component: HTTP Component: Telemetry
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100