Skip to content

Implement LongClassName rule to enforce maximum length for class, interface, trait, and enum names#74

Merged
Orrison merged 3 commits intomainfrom
22-longclassname
Sep 28, 2025
Merged

Implement LongClassName rule to enforce maximum length for class, interface, trait, and enum names#74
Orrison merged 3 commits intomainfrom
22-longclassname

Conversation

@Orrison
Copy link
Copy Markdown
Owner

@Orrison Orrison commented Sep 28, 2025

Adds the LongClassName rule to resolve #22

…erface, trait, and enum names

Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
@Orrison Orrison requested a review from Copilot September 28, 2025 14:51
@Orrison Orrison self-assigned this Sep 28, 2025
@Orrison Orrison added the New Rule A new PHPStan Rule label Sep 28, 2025
@Orrison Orrison linked an issue Sep 28, 2025 that may be closed by this pull request
Copy link
Copy Markdown
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

Implements a new LongClassName rule to enforce maximum length limits on class, interface, trait, and enum names, addressing issue #22. The rule provides configurable options for maximum length and allows excluding specific prefixes/suffixes from length calculations.

  • Adds the core LongClassName rule with flexible configuration options
  • Implements comprehensive test coverage for all configuration scenarios
  • Includes proper integration with the extension's configuration system

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Rules/LongClassName/LongClassNameRule.php Main rule implementation that checks name lengths against configured limits
src/Rules/LongClassName/Config.php Configuration class defining maximum length and prefix/suffix exclusions
config/extension.neon Extension configuration with schema definition and service registration
tests/Rules/LongClassName/*.php Comprehensive test suite covering default behavior and all configuration options
docs/LongClassName.md Complete documentation with usage examples and configuration details
README.md Updated to include the new rule in the available rules list
composer.json Added autoload-dev section for test namespace

Orrison and others added 2 commits September 28, 2025 10:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
@Orrison Orrison merged commit 0962ffa into main Sep 28, 2025
5 checks passed
@Orrison Orrison deleted the 22-longclassname branch September 28, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Rule A new PHPStan Rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LongClassName

2 participants