Does PER 3.0 has an issue with "very complex" example in section 2.5?

Open
#131 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
documentation

Research direction

Compare the “very complex” example in section 2.5 with the multiline argument formatting described in section 4.5. Confirm the intended formatting with the surrounding examples and discussion; done means section 2.5 uses the agreed consistent example.

Written by the indexing model from the issue text.

Description

Hey, everyone!

Just noticed the way how "very complex" example is being put in 2.5:

Image

I would think it is a little bit illogical, because it violates of how we're formatting multiline arguments for functions, see 4.5:

Image

Another example is the same 2.5 section:

function somethingWithReflection(
    \ReflectionObject
    |\ReflectionClass
    |\ReflectionMethod
    |\ReflectionParameter
    |\ReflectionProperty $reflect
): object|null {
        // ...
}

That's why I suspect it is just a typo, and correct example for "veryComplex" would be:

function veryComplex(
    array
    |(ArrayAccess&Traversable)
    |(Traversable&Countable) $input
): ArrayAccess&Traversable {
    // ...
}

WDYT about it?

Feel free to ask me to create PR if my assumptions are correct 🙌

Best regards

Dominant language
No language data
Stars
284
Forks
28
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from php-fig/per-coding-style

All issues in php-fig/per-coding-style

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.