Skip to content

Conversation

ruudk
Copy link

@ruudk ruudk commented Oct 16, 2025

This adds a new error type DEV_SOURCE_IN_PROD that detects when production code imports classes from dev-only autoload paths.

This prevents runtime failures when for example these dev directories are left out of the deployment to production.

The feature detects cases like:

  • Production code in src/ importing from src-dev/
  • Production code importing from tests/ directory

Users can ignore these errors using:

$config->ignoreErrorsOnPackage('src-dev', [ErrorType::DEV_SOURCE_IN_PROD]);

@ruudk ruudk force-pushed the dev-source-in-prod branch from 606adbd to 1be6249 Compare October 16, 2025 09:15
This adds a new error type DEV_SOURCE_IN_PROD that detects when
production code imports classes from dev-only autoload paths.

This prevents runtime failures when for example these dev directories
are left out of the deployment to production.

The feature detects cases like:
- Production code in src/ importing from src-dev/
- Production code importing from tests/ directory

Users can ignore these errors using:
$config->ignoreErrorsOnPackage('src-dev', [ErrorType::DEV_SOURCE_IN_PROD]);
@ruudk ruudk force-pushed the dev-source-in-prod branch from 1be6249 to c8180ef Compare October 16, 2025 09:16
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.

1 participant