Skip to content

Disallow alternative control structure syntax#64

Merged
piqusy merged 5 commits intorelease/3.1.0from
feat/control-structures
Apr 8, 2026
Merged

Disallow alternative control structure syntax#64
piqusy merged 5 commits intorelease/3.1.0from
feat/control-structures

Conversation

@piqusy
Copy link
Copy Markdown
Contributor

@piqusy piqusy commented Apr 7, 2026

Summary

  • Adds Eightshift.ControlStructures.DisallowAlternativeSyntax sniff that errors on endif, endforeach, endfor, endwhile, and endswitch — enforcing curly braces for all control structures
  • Fixes phpunit.xml.dist to point to AllSniffs.php as the test suite entry point (fixes pre-existing Undefined global variable $PHP_CODESNIFFER_STANDARD_DIRS error affecting all tests)
  • Includes unit test fixture and documentation

Test plan

  • ./vendor/bin/phpunit — all 4 tests pass
  • ./vendor/bin/phpcs --standard=Eightshift on a file using endif/endforeach — errors reported
  • ./vendor/bin/phpcs --standard=Eightshift on a file using curly braces only — clean

@piqusy piqusy added the ai-assisted AI assisted label Apr 7, 2026
@piqusy piqusy marked this pull request as draft April 7, 2026 21:05
@piqusy piqusy changed the base branch from main to release/3.1.0 April 7, 2026 21:09
@piqusy piqusy self-assigned this Apr 7, 2026
@piqusy piqusy added this to the 3.1.0 milestone Apr 7, 2026
@piqusy piqusy changed the title feat(ControlStructures): disallow alternative control structure syntax Disallow alternative control structure syntax Apr 7, 2026
@piqusy piqusy marked this pull request as ready for review April 7, 2026 21:11
@piqusy piqusy requested a review from a team April 7, 2026 21:13
@piqusy piqusy merged commit 7f5aa85 into release/3.1.0 Apr 8, 2026
8 of 21 checks passed
@piqusy piqusy deleted the feat/control-structures branch April 8, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants