Skip to content

Commit c7cfc12

Browse files
committed
build: add fixers
1 parent d7f5c5b commit c7cfc12

File tree

6 files changed

+3504
-945
lines changed

6 files changed

+3504
-945
lines changed

.php-cs-fixer.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php declare(strict_types=1);
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = Finder::create()
7+
->ignoreUnreadableDirs()
8+
->ignoreDotFiles(true)
9+
->ignoreVCS(true)
10+
->name('*.php')
11+
->in(__DIR__)
12+
->notName('_ide_helper.php')
13+
->exclude('vendor')
14+
->exclude('storage')
15+
->exclude('bootstrap')
16+
->sortByModifiedTime();
17+
18+
// https://mlocati.github.io/php-cs-fixer-configurator
19+
20+
return (new Config())
21+
->setUsingCache(false)
22+
->setRiskyAllowed(true)
23+
->setLineEnding("\n")
24+
->setFinder($finder)
25+
->setRules(
26+
[
27+
'@PSR2' => true,
28+
'@PSR12' => true,
29+
'@Symfony' => true,
30+
'@Symfony:risky' => true,
31+
'@PHP71Migration' => true,
32+
'@PHP71Migration:risky' => true,
33+
'@PHP73Migration' => false,
34+
'@PHPUnit84Migration:risky' => true,
35+
'@DoctrineAnnotation' => true,
36+
37+
'native_function_invocation' => false,
38+
'phpdoc_align' => false,
39+
'blank_line_after_opening_tag' => false,
40+
'linebreak_after_opening_tag' => false,
41+
'phpdoc_to_comment' => false,
42+
'phpdoc_separation' => true,
43+
'no_unused_imports' => true,
44+
'single_import_per_statement' => false,
45+
'yoda_style' => false,
46+
'phpdoc_var_without_name' => false,
47+
'self_accessor' => false,
48+
'no_superfluous_phpdoc_tags' => false,
49+
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
50+
'array_syntax' => ['syntax' => 'short'],
51+
'mb_str_functions' => true,
52+
'cast_spaces' => true,
53+
'no_useless_return' => true,
54+
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
55+
'phpdoc_order' => true,
56+
'phpdoc_no_empty_return' => false,
57+
'no_extra_blank_lines' => true,
58+
'visibility_required' => true,
59+
'single_trait_insert_per_statement' => false,
60+
'concat_space' => ['spacing' => 'one'],
61+
'php_unit_test_annotation' => ['style' => 'annotation'],
62+
'combine_consecutive_unsets' => true,
63+
'no_useless_else' => true,
64+
'php_unit_strict' => true,
65+
'strict_comparison' => true,
66+
'strict_param' => true,
67+
'explicit_string_variable' => true,
68+
'self_static_accessor' => true,
69+
'global_namespace_import' => true,
70+
'multiline_comment_opening_closing' => true,
71+
'multiline_whitespace_before_semicolons' => true,
72+
'ordered_class_elements' => true,
73+
'phpdoc_var_annotation_correct_order' => true,
74+
'protected_to_private' => true,
75+
'simple_to_complex_string_variable' => true,
76+
'static_lambda' => false,
77+
]
78+
);

composer.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,32 @@
66
{
77
"name": "Vladimir Yuldashev",
88
"email": "misterio92@gmail.com"
9+
},
10+
{
11+
"name": "Everli Team",
12+
"email": "tech@everli.com"
913
}
1014
],
1115
"require": {
1216
"php": "7.2.*",
1317
"ext-json": "*",
14-
"illuminate/database": "^6.18.43",
15-
"illuminate/support": "^6.18.43",
16-
"illuminate/queue": "^6.18.43",
18+
"illuminate/database": "6.20.*",
19+
"illuminate/support": "6.20.*",
20+
"illuminate/queue": "6.20.*",
1721
"enqueue/amqp-lib": "0.10.*",
1822
"queue-interop/amqp-interop": "0.8.*"
1923
},
2024
"require-dev": {
2125
"phpunit/phpunit": "8.5.*",
22-
"illuminate/events": "^6.18.43",
23-
"mockery/mockery": "1.3.*"
26+
"illuminate/events": "6.20.*",
27+
"mockery/mockery": "1.3.*",
28+
"friendsofphp/php-cs-fixer": "2.19.*",
29+
"phpmd/phpmd": "2.10.*",
30+
"phpstan/phpstan": "0.12.*",
31+
"phpstan/phpstan-strict-rules": "0.12.*",
32+
"povils/phpmnd": "2.4.*",
33+
"squizlabs/php_codesniffer": "3.6.*",
34+
"vimeo/psalm": "4.10.*"
2435
},
2536
"autoload": {
2637
"psr-4": {
@@ -43,7 +54,8 @@
4354
}
4455
},
4556
"scripts": {
46-
"test": "vendor/bin/phpunit"
57+
"test": "vendor/bin/phpunit",
58+
"test-style": "build/test_style.sh"
4759
},
4860
"minimum-stability": "dev",
4961
"prefer-stable": true,

0 commit comments

Comments
 (0)