2024-01-11 19:12:01 +00:00
|
|
|
<?php
|
2024-01-15 12:31:29 +00:00
|
|
|
/**
|
2024-08-20 04:52:12 +00:00
|
|
|
* SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
|
2024-01-15 12:31:29 +00:00
|
|
|
*
|
2024-08-20 04:52:12 +00:00
|
|
|
* SPDX-License-Identifier: CC0-1.0
|
2024-01-15 12:31:29 +00:00
|
|
|
*/
|
2024-01-11 19:12:01 +00:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-08-23 19:44:03 +00:00
|
|
|
require_once __DIR__ . '/bin/dev/php-cs-fixer/vendor/autoload.php';
|
|
|
|
|
2024-01-11 19:12:01 +00:00
|
|
|
$finder = PhpCsFixer\Finder::create()
|
|
|
|
->in(__DIR__)
|
2024-01-11 19:17:40 +00:00
|
|
|
->notPath('addon')
|
2024-01-11 19:12:01 +00:00
|
|
|
->notPath('bin/dev')
|
|
|
|
->notPath('config')
|
|
|
|
->notPath('doc')
|
|
|
|
->notPath('images')
|
|
|
|
->notPath('mods')
|
|
|
|
->notPath('spec')
|
|
|
|
->notPath('vendor')
|
|
|
|
->notPath('view/asset')
|
|
|
|
->notPath('lang')
|
|
|
|
->notPath('view/smarty3/compiled');
|
|
|
|
|
|
|
|
$config = new PhpCsFixer\Config();
|
|
|
|
return $config
|
|
|
|
->setRules([
|
|
|
|
'@PSR1' => true,
|
|
|
|
'@PSR2' => true,
|
|
|
|
'@PSR12' => true,
|
|
|
|
'align_multiline_comment' => true,
|
|
|
|
'array_indentation' => true,
|
|
|
|
'array_syntax' => [
|
|
|
|
'syntax' => 'short',
|
|
|
|
],
|
|
|
|
'binary_operator_spaces' => [
|
|
|
|
'default' => 'single_space',
|
|
|
|
'operators' => [
|
|
|
|
'=>' => 'align_single_space_minimal',
|
|
|
|
'=' => 'align_single_space_minimal',
|
|
|
|
'??' => 'align_single_space_minimal',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'blank_line_after_namespace' => true,
|
2024-08-23 19:44:03 +00:00
|
|
|
'braces_position' => [
|
|
|
|
'anonymous_classes_opening_brace' => 'same_line',
|
|
|
|
'control_structures_opening_brace' => 'same_line',
|
|
|
|
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
|
2024-01-11 19:12:01 +00:00
|
|
|
],
|
|
|
|
'elseif' => true,
|
|
|
|
'encoding' => true,
|
|
|
|
'full_opening_tag' => true,
|
|
|
|
'function_declaration' => [
|
|
|
|
'closure_function_spacing' => 'one',
|
|
|
|
],
|
|
|
|
'indentation_type' => true,
|
|
|
|
'line_ending' => true,
|
|
|
|
'list_syntax' => [
|
|
|
|
'syntax' => 'long',
|
|
|
|
],
|
|
|
|
'lowercase_keywords' => true,
|
|
|
|
'no_closing_tag' => true,
|
|
|
|
'no_spaces_after_function_name' => true,
|
2024-08-23 19:44:03 +00:00
|
|
|
'spaces_inside_parenthesis' => false,
|
2024-01-11 19:12:01 +00:00
|
|
|
'no_trailing_whitespace' => true,
|
|
|
|
'no_trailing_whitespace_in_comment' => true,
|
|
|
|
'no_unused_imports' => true,
|
|
|
|
'single_blank_line_at_eof' => true,
|
|
|
|
'single_class_element_per_statement' => true,
|
|
|
|
'single_import_per_statement' => true,
|
|
|
|
'single_line_after_imports' => true,
|
|
|
|
'switch_case_space' => true,
|
|
|
|
'ternary_operator_spaces' => false,
|
|
|
|
'visibility_required' => [
|
|
|
|
'elements' => ['property', 'method']
|
|
|
|
],
|
2024-08-23 19:44:03 +00:00
|
|
|
'new_with_parentheses' => true,
|
2024-01-11 19:12:01 +00:00
|
|
|
])
|
|
|
|
->setFinder($finder)
|
|
|
|
->setIndent("\t");
|