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

Destructuring syntax (list() and [])

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

@samdark がすでに取り組んでいます。

2026年8月27日 から。

  • #158 @samdark による — オープン

評価

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

調査の方向性

Start by checking how PSR-12 and PHP_CodeSniffer handle spacing in list() and [] destructuring; the issue provides reproducible input in my-file.php and the expected formatting. Run phpcs --standard=PSR12 against both shown examples, then confirm that missing spaces after the comma are reported and the corrected forms pass.

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

説明

I want to report a case that does not seem to be explicitly covered by PSR-12.
It concerns variable destructuring using the list() and [] syntaxes.

I have this code:

[$val1,$val2] = explode(',', $string);
list($val1,$val2) = explode(',', $string);

And I do not get any error when running the command:

phpcs --standard=PSR12 my-file.php

In my opinion, there should be a space required after the comma following $val1, as in function calls or arrays.

Correction:

[$val1, $val2] = explode(',', $string);
list($val1, $val2) = explode(',', $string);
主要言語
言語のデータがありません
スター
284
フォーク
27
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

php-fig/per-coding-style のほかの issue

php-fig/per-coding-style の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

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

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