idiosyncratic/editorconfig
PHP implementation of EditorConfig. Load .editorconfig rules via Composer and query settings for a given file path. Returns matching declarations as an array or prints the resolved config, making it easy to enforce consistent coding style across projects.
Install via Composer: composer require idiosyncratic/editorconfig. Instantiate Idiosyncratic\EditorConfig\EditorConfig, then call getConfigForPath($filePath) to retrieve an associative array of resolved EditorConfig rules (e.g., ['indent_style' => 'space', 'trim_trailing_whitespace' => true]). For quick inspection or CLI debugging, use printConfigForPath($filePath) to output a human-readable config string. Start with a simple use case—like reading indentation rules for a PHP file—to verify baseline functionality.
EditorConfig in a command or service that asserts required rules (e.g., ensureIndentStyle('space')) before allowing builds to pass.getConfigForPath() and apply settings programmatically (e.g., adjust php-cs-fixer options per-file using resolved max_line_length or charset).root = true, conflicting encodings across subfolders)..editorconfig files before deploying to production.indent_size might be '4' as a string)—add your own type coercion/validation if semantic correctness matters..editorconfig files manually; the class re-reads and re-parses on every getConfigForPath() call, even for identical project roots.php_cs_fixer.rules). While not spec-compliant, they work in practice—post-process results if you need to support vendor-specific overrides.# comments and {} wildcards ({src,tests}/*.php) work in 0.1.1+, but complex patterns (e.g., nested braces) may still misbehave—test with your actual .editorconfig.How can I help you explore Laravel packages today?