Yuriy Belenko e639dad66a
[php] Add PSR-12 rule set (#12302)
* Upgrade PHPCS-Fixer to 3.5 version

This version requires PHP 7.4 or 8.0 which perfectly meets our supported
PHP right now.

* Rename config file to .php-cs-fixer.dist.php

This way it can be overwritten with local file(same name without "dist"
part). Also it's recommended filename from the package doc.

* Add PSR12 rule set to config

I've changed config file a bit to look like example from the doc.
Ref: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst

* Ignore new cache format

* Remove blank line after class opening

* Set constants in models public

* Refresh samples
2022-05-10 00:34:38 +08:00

30 lines
770 B
PHP

<?php
/**
* @generated
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
*/
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('vendor')
->exclude('test')
->exclude('tests')
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'phpdoc_order' => true,
'array_syntax' => [ 'syntax' => 'short' ],
'strict_comparison' => true,
'strict_param' => true,
'no_trailing_whitespace' => false,
'no_trailing_whitespace_in_comment' => false,
'braces' => false,
'single_blank_line_at_eof' => false,
'blank_line_after_namespace' => false,
'no_leading_import_slash' => false,
])
->setFinder($finder)
;