Home Projects Portfolio Dashboard Export PDF Log in
TypeScript PHP

Expanding Codebase Visibility: Supporting PHP in Dyad

Scaling Our Analysis Engine

At Dyad, our primary goal is providing deep insights into codebase quality and structure. As our tool evolved, we identified a significant gap: while we supported several modern languages, we lacked visibility into legacy and enterprise-standard PHP repositories.

We recently took steps to close this gap by updating our core scanning engine to treat PHP files as first-class citizens in our processing pipeline.

The Challenge

Our analysis engine relies on an ALLOWED_EXTENSIONS configuration to determine which files enter the parsing stream. Previously, this whitelist omitted PHP, causing the scanner to ignore critical files. The goal was to include these files without sacrificing the performance or accuracy of our existing TypeScript-based analysis layer.

Implementation

Updating the configuration was a straightforward but necessary change to ensure global project compatibility. By modifying our inclusion logic, we can now hook into the PHP lifecycle during the scanning phase.

const ALLOWED_EXTENSIONS = [
  '.ts',
  '.js',
  '.php', // Newly supported extension
  '.json'
];

function isFileSupported(fileName: string): boolean {
  return ALLOWED_EXTENSIONS.some(ext => fileName.endsWith(ext));
}

The code above demonstrates how we manage supported file types. By adding .php to the ALLOWED_EXTENSIONS array, our isFileSupported utility now correctly flags PHP files for processing during the scan phase, ensuring they are not ignored by our indexing service.

Future Considerations

With PHP support enabled, we are now planning to expand our diagnostic rules to better handle the nuances of PHP-specific syntax. This move is part of a broader effort to make Dyad a language-agnostic tool for team productivity.

Verdict

Expanding support for older or widely used languages like PHP is a critical step in making developer tooling more versatile. Simple configuration updates can bridge the gap between limited and comprehensive codebase visibility.


Generated with Gitvlg.com

Expanding Codebase Visibility: Supporting PHP in Dyad
JoseDanteArroyo

JoseDanteArroyo

Author

Share: