Skip to content

Commit ca08f79

Browse files
committed
fix: added PHP-CS-Fixer
1 parent 27f3fe9 commit ca08f79

File tree

71 files changed

+818
-2288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+818
-2288
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea
22
release.sh
33
composer.lock
4-
vendor/
4+
vendor/
5+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__)
5+
->exclude('var')
6+
->exclude('vendor')
7+
;
8+
9+
return (new PhpCsFixer\Config())
10+
->setRules([
11+
'@Symfony' => true,
12+
'@Symfony:risky' => true,
13+
'array_syntax' => ['syntax' => 'short'],
14+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
15+
'no_unused_imports' => true,
16+
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters']],
17+
'phpdoc_order' => true,
18+
'phpdoc_separation' => true,
19+
'phpdoc_trim' => true,
20+
'phpdoc_align' => ['align' => 'left'],
21+
'phpdoc_summary' => false,
22+
'concat_space' => ['spacing' => 'one'],
23+
'declare_strict_types' => true,
24+
'strict_param' => true,
25+
'strict_comparison' => true,
26+
'yoda_style' => true,
27+
'single_line_throw' => false,
28+
'blank_line_before_statement' => [
29+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
30+
],
31+
'class_attributes_separation' => [
32+
'elements' => [
33+
'const' => 'one',
34+
'method' => 'one',
35+
'property' => 'one',
36+
],
37+
],
38+
'global_namespace_import' => [
39+
'import_classes' => true,
40+
'import_constants' => false,
41+
'import_functions' => false,
42+
],
43+
])
44+
->setRiskyAllowed(true)
45+
->setFinder($finder)
46+
;

composer.json

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
2-
"name" : "netbull/media-bundle",
3-
"description" : "Media bundle",
4-
"type" : "symfony-bundle",
5-
"authors" : [{
6-
"name" : "Aleksandar Dimitrov",
7-
"email" : "netbull2007@gmail.com"
8-
}],
9-
"keywords" : [
2+
"name": "netbull/media-bundle",
3+
"description": "Media bundle",
4+
"type": "symfony-bundle",
5+
"authors": [
6+
{
7+
"name": "Aleksandar Dimitrov",
8+
"email": "netbull2007@gmail.com"
9+
}
10+
],
11+
"keywords": [
1012
"netbull media symfony bundle"
1113
],
12-
"license" : "AGPL-3.0-or-later",
13-
"require" : {
14+
"license": "AGPL-3.0-or-later",
15+
"require": {
1416
"php": "8.4.*",
1517
"ext-curl": "*",
1618
"aws/aws-sdk-php": "3.*",
@@ -24,9 +26,22 @@
2426
"symfony/config": "7.2.*|7.3.*|7.4.*",
2527
"netbull/doctrine-behaviors": "^7.0"
2628
},
27-
"autoload" : {
28-
"psr-4" : {
29-
"NetBull\\MediaBundle\\" : "src/"
29+
"require-dev": {
30+
"friendsofphp/php-cs-fixer": "^3.64"
31+
},
32+
"autoload": {
33+
"psr-4": {
34+
"NetBull\\MediaBundle\\": "src/"
35+
}
36+
},
37+
"scripts": {
38+
"cs-fix": "vendor/bin/php-cs-fixer fix",
39+
"cs-check": "vendor/bin/php-cs-fixer fix --dry-run --diff"
40+
},
41+
"config": {
42+
"sort-packages": true,
43+
"allow-plugins": {
44+
"php-http/discovery": true
3045
}
3146
}
3247
}

config/console.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

config/controller.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

config/form.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

config/gaufrette.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

config/helpers.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/listener.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

config/media.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)