squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.66k stars 1.48k forks source link

Inject the Config in the Runner constructor #3882

Open BafS opened 1 year ago

BafS commented 1 year ago

Inject the configuration object in the constructor instead of creating the instance without having the ability to change it.

Currently it's not possible to change the configuration because it's using in a "black box" way. This PR proposes to use dependency injection to have more control over it when using the library in a programmatic way.

Suggested changelog entry

Related issues/external references

Fixes #

Types of changes

PR checklist

jrfnl commented 1 year ago

Marking as "Close candidate" - see the discussion in #3697