Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add Rector for automated code modernisation and refactoring

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
php
領域
tooling

調査の方向性

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 の本文から書いたものです。

説明

enhancement

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/rector to require-dev
  • Configure a rector.php with the LevelSetList::UP_TO_PHP_81 preset
  • Add a composer run rector script for dry-run and composer run rector-fix to 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 はありません

環境構築

はじめの一歩

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

openapi/openapi-php-sdk のほかの issue

openapi/openapi-php-sdk の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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