mirror of
https://github.com/friendica/friendica
synced 2024-12-22 12:40:15 +00:00
Fix deprecation warnings & remove old php_cs.dist
This commit is contained in:
parent
6be1cd895a
commit
10cb502f16
2 changed files with 8 additions and 88 deletions
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/bin/dev/php-cs-fixer/vendor/autoload.php';
|
||||||
|
|
||||||
$finder = PhpCsFixer\Finder::create()
|
$finder = PhpCsFixer\Finder::create()
|
||||||
->in(__DIR__)
|
->in(__DIR__)
|
||||||
->notPath('addon')
|
->notPath('addon')
|
||||||
|
@ -41,10 +43,10 @@ return $config
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'blank_line_after_namespace' => true,
|
'blank_line_after_namespace' => true,
|
||||||
'braces' => [
|
'braces_position' => [
|
||||||
'position_after_anonymous_constructs' => 'same',
|
'anonymous_classes_opening_brace' => 'same_line',
|
||||||
'position_after_control_structures' => 'same',
|
'control_structures_opening_brace' => 'same_line',
|
||||||
'position_after_functions_and_oop_constructs' => 'next',
|
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
|
||||||
],
|
],
|
||||||
'elseif' => true,
|
'elseif' => true,
|
||||||
'encoding' => true,
|
'encoding' => true,
|
||||||
|
@ -60,7 +62,7 @@ return $config
|
||||||
'lowercase_keywords' => true,
|
'lowercase_keywords' => true,
|
||||||
'no_closing_tag' => true,
|
'no_closing_tag' => true,
|
||||||
'no_spaces_after_function_name' => true,
|
'no_spaces_after_function_name' => true,
|
||||||
'no_spaces_inside_parenthesis' => true,
|
'spaces_inside_parenthesis' => false,
|
||||||
'no_trailing_whitespace' => true,
|
'no_trailing_whitespace' => true,
|
||||||
'no_trailing_whitespace_in_comment' => true,
|
'no_trailing_whitespace_in_comment' => true,
|
||||||
'no_unused_imports' => true,
|
'no_unused_imports' => true,
|
||||||
|
@ -73,7 +75,7 @@ return $config
|
||||||
'visibility_required' => [
|
'visibility_required' => [
|
||||||
'elements' => ['property', 'method']
|
'elements' => ['property', 'method']
|
||||||
],
|
],
|
||||||
'new_with_braces' => true,
|
'new_with_parentheses' => true,
|
||||||
])
|
])
|
||||||
->setFinder($finder)
|
->setFinder($finder)
|
||||||
->setIndent("\t");
|
->setIndent("\t");
|
||||||
|
|
82
.php_cs.dist
82
.php_cs.dist
|
@ -1,82 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: CC0-1.0
|
|
||||||
**/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
require_once __DIR__ . '/bin/dev/php-cs-fixer/vendor/autoload.php';
|
|
||||||
|
|
||||||
$finder = PhpCsFixer\Finder::create()
|
|
||||||
->in(__DIR__)
|
|
||||||
->notPath('addon')
|
|
||||||
->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,
|
|
||||||
'braces' => [
|
|
||||||
'position_after_anonymous_constructs' => 'same',
|
|
||||||
'position_after_control_structures' => 'same',
|
|
||||||
'position_after_functions_and_oop_constructs' => 'next',
|
|
||||||
],
|
|
||||||
'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,
|
|
||||||
'method_argument_space' => [],
|
|
||||||
'no_closing_tag' => true,
|
|
||||||
'no_spaces_after_function_name' => true,
|
|
||||||
'no_spaces_inside_parenthesis' => true,
|
|
||||||
'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']
|
|
||||||
],
|
|
||||||
'new_with_braces' => true,
|
|
||||||
])
|
|
||||||
->setFinder($finder)
|
|
||||||
->setIndent("\t");
|
|
Loading…
Reference in a new issue