prettier / prettier/plugin-php

[PSR-12] Property visibility

Open
#1,179 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion psr compat
Dominant language
PHP
Stars
1.9k
Forks
139
PR merge metrics
No merged PRs in 30d

Description

Disclaimer: I am aware that it's not make-or-break for Prettier to adhere to PSR-12.

However, now that it is officially accepted as a standard, we should discuss (and, if necessary, reject) each current violation of PSR-12 — if only to have point to refer to in future discussions or issues.

PSR-12 Violations
  1. Visibility MUST be declared on all properties.
    Section 4.3

  2. Visibility MUST be declared on all constants if your project PHP minimum version supports constant visibilities (PHP 7.1 or later).
    Section 4.3

    Solving this would need an --engine flag.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PSR-12 Section 4.3 and the linked --engine discussion in issue #939. Determine the intended behavior for property and constant visibility across supported PHP versions; the issue is complete only after that scope and implementation approach are agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.