linitng setup added for PHP #1257
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #1256
This pull request introduces a standardized approach to code style and quality enforcement for the project, focusing on PHP and related files. The main improvements are the addition of configuration files and development dependencies to automate code formatting and linting, as well as new scripts to make these tools easy to use.
Code style and quality enforcement:
.editorconfigto ensure consistent coding styles across all supported file types (PHP, JS, CSS, JSON, YAML, Markdown, Makefile, SQL), including rules for indentation, charset, line endings, and whitespace trimming..php-cs-fixer.phpconfiguration to define and enforce PHP code style rules (PSR-12 and others), specifying which directories to check and which to exclude, plus cache settings for faster runs..phpcs.xmlto configure PHP_CodeSniffer with PSR-12 as the base standard, directory inclusions/exclusions, relaxed rules for legacy CodeIgniter code, and settings for encoding and tab width.Development tooling:
openml_OS/composer.jsonto addsquizlabs/php_codesnifferandfriendsofphp/php-cs-fixeras dev dependencies, and introduced composer scripts for linting and code style checks/fixes, making it easy for developers to run these tools.Available Commands