Files
FOSSBilling/.php-cs-fixer.dist.php
T
Belle Aerni 45db4910a7 PHP 8.4 prep (#2464)
* Update CI for PHP 8.4

* Update composer deps for PHP 8.4

* Updates

* This is the default mode and this constant causes test failutes

* Explicily install the PDO extensions

* Temporarily downgrade the live tests to PHP 8.3

It would seem that there is some kind of problem with PHP 8.4 in regards to these tests. I believe it is outside of our control however as it installs fine for me with PHP 8.4 under DirectAdmin

* Update to address deprecations

* Make that nullable

* Fixed my typo

* Bump PHPunit to v11

* Also take care of two minor things

* Formatting fix
2024-11-21 23:16:29 -08:00

48 lines
2.1 KiB
PHP

<?php
/**
* Copyright 2022-2024 FOSSBilling
* Copyright 2011-2021 BoxBilling, Inc.
* SPDX-License-Identifier: Apache-2.0
*
* @copyright FOSSBilling (https://www.fossbilling.org)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
*/
if (!file_exists(__DIR__ . '/src')) {
exit(0);
}
return (new PhpCsFixer\Config())
->setRules([
'@PHP84Migration' => true,
'@Symfony' => true,
'concat_space' => ['spacing' => 'one'],
'protected_to_private' => false,
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], // Enforce non-Yoda style.
'blank_line_before_statement' => ['statements' => ['break', 'continue', 'return', 'throw', 'try']], // Removed 'declare' from the default list.
/* Risky */
'get_class_to_class_keyword' => true, // Risky if the get_class function is overridden. In our case, it's not.
'dir_constant' => true, // Risky when the function dirname is overridden. In our case, it's not.
'array_push' => true, // Risky when the function array_push is overridden. In our case, it's not.
'no_useless_sprintf' => true, // Risky when the function sprintf is overridden. In our case, it's not.
'php_unit_construct' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/php_unit/php_unit_construct.rst
'php_unit_mock_short_will_return' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/php_unit/php_unit_mock_short_will_return.rst
'no_homoglyph_names' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/naming/no_homoglyph_names.rst
])
->setRiskyAllowed(true)
->setFinder(
(new PhpCsFixer\Finder())
->in([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/tests-legacy'])
->exclude([
'data',
'locale',
'themes',
'vendor',
])
->notPath(
'config-sample.php'
)
)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());