Skip to content

Fix PHP file language detection to enable specialized transformer#12

Merged
royisme merged 2 commits intoclaude/review-codebase-rag-011CUoMJjvbkkuZgnAHnRFvnfrom
copilot/sub-pr-10
Nov 5, 2025
Merged

Fix PHP file language detection to enable specialized transformer#12
royisme merged 2 commits intoclaude/review-codebase-rag-011CUoMJjvbkkuZgnAHnRFvnfrom
copilot/sub-pr-10

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 5, 2025

The PHP transformer (_transform_php_code) was never executed because .php files weren't tagged with language metadata during file processing.

Changes

  • Added .php to the file extension list in extract_file_metadata() (services/pipeline/base.py:180)

This enables PHP files to be routed to the specialized transformer instead of falling through to the generic code handler. The language mapping .php"php" already existed in get_language_from_extension().

# Before: PHP files got language="unknown", used generic transformer
if path.suffix in ['.py', '.js', '.ts', '.java', '.cpp', '.c', '.h', '.cs', '.go', '.rs']:
    metadata["language"] = get_language_from_extension(path.suffix)

# After: PHP files get language="php", use _transform_php_code
if path.suffix in ['.py', '.js', '.ts', '.java', '.cpp', '.c', '.h', '.cs', '.go', '.rs', '.php']:
    metadata["language"] = get_language_from_extension(path.suffix)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: royisme <350731+royisme@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on v0.6 implementation summary documentation Fix PHP file language detection to enable specialized transformer Nov 5, 2025
Copilot AI requested a review from royisme November 5, 2025 06:17
@royisme royisme requested a review from Copilot November 5, 2025 06:49
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

This PR fixes a bug where PHP files were not being routed to the specialized PHP transformer (_transform_php_code) because they lacked language metadata during file processing. The fix adds .php to the file extension check in extract_file_metadata(), enabling proper language detection for PHP files.

Key Changes:

  • Added .php extension to the file type check in extract_file_metadata() to enable language metadata assignment for PHP files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@royisme royisme marked this pull request as ready for review November 5, 2025 06:49
@royisme royisme merged commit 67f447a into claude/review-codebase-rag-011CUoMJjvbkkuZgnAHnRFvn Nov 5, 2025
@royisme royisme deleted the copilot/sub-pr-10 branch November 5, 2025 06:52
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.

3 participants