This commit is contained in:
Dr Masroor Ehsan 2025-01-05 12:57:11 +06:00
parent bebfb3ca7a
commit 65a5b9971d
4 changed files with 83 additions and 2 deletions

23
.php-cs-fixer.dist.php Normal file
View File

@ -0,0 +1,23 @@
<?php
use App\Fixer\ClassNotation\CustomControllerOrderFixer;
use App\Fixer\ClassNotation\CustomOrderedClassElementsFixer;
use App\Fixer\ClassNotation\CustomPhpUnitOrderFixer;
use App\Support\PhpCsFixer;
use PhpCsFixer\Config;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
return (new Config())
->setParallelConfig(ParallelConfigFactory::detect())
->setFinder(PhpCsFixer::getFinder())
->setUsingCache(false)
->registerCustomFixers([
new CustomControllerOrderFixer(),
new CustomOrderedClassElementsFixer(),
new CustomPhpUnitOrderFixer(),
])
->setRules([
'Tighten/custom_controller_order' => true,
'Tighten/custom_ordered_class_elements' => true,
'Tighten/custom_phpunit_order' => true,
]);

12
.phpcs.xml.dist Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<ruleset>
<file>app</file>
<file>config</file>
<file>database</file>
<file>public</file>
<file>resources</file>
<file>routes</file>
<file>tests</file>
<rule ref="Tighten"/>
</ruleset>

12
duster.json Normal file
View File

@ -0,0 +1,12 @@
{
"include": [
"bin",
"scripts",
"src",
"tests"
],
"exclude": [
"tests/fixtures",
'resources/fontawesome/**'
]
}

View File

@ -1,11 +1,45 @@
{ {
"preset": "laravel", "preset": "laravel",
"rules": { "rules": {
"blank_line_between_import_groups": true,
"concat_space": { "concat_space": {
"spacing": "one" "spacing": "one"
}, },
"ordered_imports": { "class_attributes_separation": {
"sort_algorithm": "alpha" "elements": {
"method": "one"
} }
},
"curly_braces_position": {
"control_structures_opening_brace": "same_line",
"functions_opening_brace": "next_line_unless_newline_at_signature_end",
"anonymous_functions_opening_brace": "same_line",
"classes_opening_brace": "next_line_unless_newline_at_signature_end",
"anonymous_classes_opening_brace": "next_line_unless_newline_at_signature_end",
"allow_single_line_empty_anonymous_classes": true,
"allow_single_line_anonymous_functions": false
},
"explicit_string_variable": true,
"global_namespace_import": {
"import_classes": true,
"import_constants": true,
"import_functions": true
},
"new_with_braces": {
"named_class": false,
"anonymous_class": false
},
"ordered_imports": {
"sort_algorithm": "alpha",
"imports_order": [
"const",
"class",
"function"
]
},
"php_unit_test_annotation": {
"style": "annotation"
},
"simple_to_complex_string_variable": true
} }
} }