PHPCSStandards / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
881 stars 54 forks source link

Squiz/ForLoopDeclaration: bug fix - prevent sniff erroring out #430

Closed jrfnl closed 5 months ago

jrfnl commented 5 months ago

Description

Squiz/ForLoopDeclaration: rename test case file

... in anticipation of adding addition test case files.

Squiz/ForLoopDeclaration: move parse error test to its own file

Squiz/ForLoopDeclaration: bug fix - prevent sniff erroring out

... on an _"Undefined array key "parenthesiscloser" " notice during live coding.

Includes unit test.

Suggested changelog entry

Squiz.ControlStructures.ForLoopDeclaration: prevent a potential "undefined array key" notice during live coding

jrfnl commented 5 months ago

Rebased without changes. Merging once the build passes.

jrfnl commented 5 months ago

The build failure is unrelated to this PR. PR #436 should fix this. I will rebase again once that one has been merged.