Skip to content

Conversation

@butschster
Copy link
Collaborator

@butschster butschster commented Mar 11, 2025

This PR introduces a new feature called php-content-filter that provides fine-grained control over PHP class elements included in the context generation.

What it does

  • Allows selective inclusion or exclusion of class elements (methods, properties, constants)
  • Supports filtering by visibility (public, protected, private)
  • Supports keeping or removing method bodies
  • Supports keeping or removing doc comments and PHP 8+ attributes
  • Supports filtering elements using regular expression patterns

Key benefits

  • Create more focused context files with only relevant code parts
  • Reduce noise from implementation details when only signatures are needed
  • Maintain complete control over which class elements appear in the context
  • Simplify context for LLMs by removing irrelevant details

How to use it

Simply add the php-content-filter modifier to your file source with the appropriate configuration options:

"modifiers": [
  {
    "name": "php-content-filter",
    "options": {
      "method_visibility": ["public"],
      "exclude_methods": ["__construct"],
      "keep_method_bodies": false
    }
  }
]

This modifier complements the existing php-signature modifier but provides much more granular control.

@butschster butschster changed the title Feature/php class modificator Add PHP Content Filter Mar 11, 2025
@butschster butschster merged commit c1e2e2c into main Mar 11, 2025
5 of 8 checks passed
@butschster butschster deleted the feature/php-class-modificator branch March 11, 2025 18:19
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