Skip to content

CamelCaseParameterNameRule#3

Merged
Orrison merged 7 commits intomainfrom
camel-case-parameter-name
Jul 10, 2025
Merged

CamelCaseParameterNameRule#3
Orrison merged 7 commits intomainfrom
camel-case-parameter-name

Conversation

@Orrison
Copy link
Owner

@Orrison Orrison commented Jul 10, 2025

Add a new rule CamelCaseParameterNameRule to ensure that function, method, and closure parameters MUST be in camelCase.

Orrison added 6 commits July 10, 2025 00:19
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
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 10, 2025 13:22
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 CamelCaseParameterNameRule that enforces camelCase naming convention for function, method, and closure parameters. The implementation includes configurable options to allow underscore prefixes and consecutive uppercase letters, providing flexibility for different coding standards.

Key changes:

  • Implementation of the core rule logic with regex-based parameter name validation
  • Configuration system supporting two boolean options for naming flexibility
  • Comprehensive test suite covering default behavior and all configuration combinations

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Rules/CamelCaseParameterName/CamelCaseParameterNameRule.php Main rule implementation with regex pattern matching for camelCase validation
src/Rules/CamelCaseParameterName/Config.php Configuration class for rule options
config/extension.neon Service configuration and parameter schema definition
tests/Rules/CamelCaseParameterName/Fixture/ExampleClass.php Test fixture with various parameter naming patterns
Multiple test files Test cases for different configuration scenarios

Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
@Orrison Orrison merged commit 2291007 into main Jul 10, 2025
5 checks passed
@Orrison Orrison deleted the camel-case-parameter-name branch July 10, 2025 13:33
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