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 2 times, most recently from 1be6249 to c8180ef Compare October 16, 2025 09:16
@ruudk
Copy link
Author

ruudk commented Oct 22, 2025

@JanTvrdik @janedbal I'm curious to hear what you think about this change.

@ruudk
Copy link
Author

ruudk commented Nov 15, 2025

@janedbal I know you're probably very busy, but do you have advice to move this forward? Thanks. Happy to make any changes.

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 c8180ef to b57f588 Compare November 17, 2025 10:11
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