Skip to content

Create CamelCaseVariableNameRule rule and set up AI instructions#4

Merged
Orrison merged 4 commits intomainfrom
CamelCaseVariableName
Jul 12, 2025
Merged

Create CamelCaseVariableNameRule rule and set up AI instructions#4
Orrison merged 4 commits intomainfrom
CamelCaseVariableName

Conversation

@Orrison
Copy link
Owner

@Orrison Orrison commented Jul 12, 2025

This creates the CamelCaseVariableNameRule rule and sets up an AI instructions file because peer pressure and dammit it kind of works sometimes.

Orrison added 2 commits July 12, 2025 13:26
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
@Orrison Orrison requested a review from Copilot July 12, 2025 17:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new PHPStan rule to enforce camelCase variable names with configurable options, along with corresponding tests and configuration updates.

  • Implemented CamelCaseVariableNameRule and its Config class
  • Added NEON configuration files and PHPUnit tests covering default and option-enabled scenarios
  • Updated extension.neon to register new parameters and service; added AI instructions

Reviewed Changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Rules/CamelCaseVariableName/config/configured_rule.neon Base include for the new rule
tests/Rules/CamelCaseVariableName/config/allow_underscore_prefix.neon Config to allow underscore prefixes
tests/Rules/CamelCaseVariableName/config/allow_consecutive_uppercase.neon Config to allow consecutive uppercase letters
tests/Rules/CamelCaseVariableName/config/all_options_true.neon Combined config enabling both options
tests/Rules/CamelCaseVariableName/Fixture/ExampleClass.php Fixture with various variable naming patterns
tests/Rules/CamelCaseVariableName/DefaultOptionsTest.php Tests default rule behavior
tests/Rules/CamelCaseVariableName/AllowUnderscorePrefixTest.php Tests underscore-prefix setting
tests/Rules/CamelCaseVariableName/AllowConsecutiveUppercaseTest.php Tests consecutive-uppercase setting
tests/Rules/CamelCaseVariableName/AllOptionsTrueTest.php Tests when both options are enabled
src/Rules/CamelCaseVariableName/Config.php New config class for the rule’s options
src/Rules/CamelCaseVariableName/CamelCaseVariableNameRule.php Rule implementation enforcing camelCase variables
config/extension.neon Added parameter schema, defaults, and service
.github/copilot-instructions.md AI coding instructions for contributors
Comments suppressed due to low confidence (1)

tests/Rules/CamelCaseVariableName/DefaultOptionsTest.php:18

  • [nitpick] Add a test scenario with valid camelCase variable names to verify that no errors are reported for correctly named variables.
        $this->analyse([

Orrison and others added 2 commits July 12, 2025 13:38
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Orrison Orrison merged commit a0c567e into main Jul 12, 2025
5 checks passed
@Orrison Orrison deleted the CamelCaseVariableName branch July 12, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants