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
856 stars 53 forks source link

fix: Add missing '.fixed' file for src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest #476

Closed DannyvdSluijs closed 3 months ago

DannyvdSluijs commented 4 months ago

Description

As mentioned in #299 there was a missing .fixed file for the unit test in src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest. This PR adds the missing file.

Suggested changelog entry

Add missing .fixed file

Related issues/external references

Fixes #299

Types of changes

PR checklist

jrfnl commented 3 months ago

@DannyvdSluijs Thanks for the PR. Could you please elaborate on how you created the file and how you validated the fixes ? (as per #299)

DannyvdSluijs commented 3 months ago

@DannyvdSluijs Thanks for the PR. Could you please elaborate on how you created the file and how you validated the fixes ? (as per #299)

To start I've copied the file and verified it was causing failing test (following red-green principle here) after which I've checked the newly created file seeking the erroneous lines where commented with // error here and manually corrected them.

Since the PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeIndentSniff is extending from the Generic standard but has a overriding setting for nonIndentingScopes I've verified that cases for a missing indent and a correct indent in the scope of a switch statement was included.