Skip to content

Commit 1fb7b1a

Browse files
committed
Merge branch 'code-style-fixes'
2 parents 8bb5dd6 + 0350b33 commit 1fb7b1a

46 files changed

Lines changed: 198 additions & 616 deletions

Some content is hidden

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

.codecov.yml

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

.gitattributes

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
/tests/ export-ignore
77

8-
/.editorconfig export-ignore
9-
/.gitattributes export-ignore
10-
/.gitignore export-ignore
11-
/.travis.yml export-ignore
12-
/.php-censor.yml export-ignore
13-
/.codecov.yml export-ignore
14-
/phpunit.xml.dist export-ignore
15-
/infection.json.dist export-ignore
8+
/.editorconfig export-ignore
9+
/.gitattributes export-ignore
10+
/.gitignore export-ignore
11+
/.php-censor.yml export-ignore
12+
/.php-cs-fixer.dist.php export-ignore
13+
/infection.json.dist export-ignore
14+
/phpunit.xml.dist export-ignore
15+
/psalm.xml.dist export-ignore

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
/vendor
21
/composer.phar
32
/composer.lock
4-
/.php_cs.cache
3+
4+
/vendor
5+
6+
/.php-cs-fixer.cache
7+
/.phpunit.result.cache
8+
59
/tests/var/log/*.log
610
/tests/var/coverage
7-
/tests/runtime/*

.php-censor.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ test:
1313
- phpunit.xml.dist
1414
coverage: true
1515

16-
php_mess_detector:
16+
php_cs_fixer:
17+
args: '--allow-risky=yes'
18+
errors: true
19+
report_errors: true
20+
config: .php-cs-fixer.dist.php
1721
allow_failures: true
1822

19-
php_code_sniffer:
20-
standard: PSR2
21-
encoding: UTF-8
23+
php_mess_detector:
2224
allow_failures: true
2325

2426
php_cpd:
@@ -30,9 +32,6 @@ test:
3032
php_parallel_lint:
3133
allow_failures: true
3234

33-
php_docblock_checker:
34-
allow_failures: true
35-
3635
security_checker:
3736
binary_type: symfony
3837
allow_failures: false

.php-cs-fixer.dist.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
use PhpCsFixer\Config;
4+
5+
$finder = PhpCsFixer\Finder::create()
6+
->name('*.php')
7+
->ignoreDotFiles(true)
8+
->ignoreVCS(true)
9+
->exclude(['vendor'])
10+
->in(__DIR__)
11+
;
12+
13+
$config = new Config();
14+
15+
return $config
16+
->setRules([
17+
'@PSR1' => true,
18+
'@PSR12' => true,
19+
'strict_param' => true,
20+
'array_syntax' => ['syntax' => 'short'],
21+
'blank_line_before_statement' => ['statements' => ['return', 'throw']],
22+
'general_phpdoc_tag_rename' => ['replacements' => [
23+
'inheritDocs' => 'inheritDoc',
24+
'inheritdocs' => 'inheritDoc',
25+
'inheritdoc' => 'inheritDoc',
26+
]],
27+
'no_superfluous_phpdoc_tags' => [
28+
'allow_mixed' => true,
29+
'allow_unused_params' => true,
30+
],
31+
'no_unneeded_curly_braces' => [
32+
'namespaces' => true,
33+
],
34+
'phpdoc_types_order' => [
35+
'null_adjustment' => 'always_last',
36+
],
37+
])
38+
->setIndent(' ')
39+
->setLineEnding("\n")
40+
->setFinder($finder)
41+
;

.php_cs.dist

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

.travis.yml

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

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Code style
1414
----------
1515

1616
```bash
17-
vendor/bin/php-cs-fixer --diff fix
17+
vendor/bin/php-cs-fixer fix --allow-risky=yes --diff
1818

1919
vendor/bin/psalm --config=psalm.xml.dist --threads=4 --show-snippet=true --show-info=true
2020
```
@@ -33,4 +33,3 @@ Infection mutation tests:
3333
```bash
3434
vendor/bin/infection --threads=4 --show-mutations -vvv
3535
```
36-

composer.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{
2020
"name": "Dmitry Khomutov",
2121
"email": "poisoncorpsee@gmail.com",
22-
"homepage": "http://corpsee.com",
22+
"homepage": "https://corpsee.com",
2323
"role": "PHP Censor developer"
2424
}
2525
],
@@ -40,18 +40,24 @@
4040
"require": {
4141
"php": ">=7.4.0",
4242
"ext-json": "*",
43-
"psr/container": "^1.1",
44-
"swiftmailer/swiftmailer": "^6.2"
43+
"psr/container": "^2.0",
44+
"swiftmailer/swiftmailer": "^6.3"
4545
},
4646
"require-dev": {
47-
"phpunit/phpunit": "^7.5",
48-
"friendsofphp/php-cs-fixer": "^2.16",
49-
"infection/infection": "^0.12",
50-
"vimeo/psalm": "^3.16"
47+
"phpunit/phpunit": "^9.5",
48+
"friendsofphp/php-cs-fixer": "^3.4",
49+
"infection/infection": "^0.25",
50+
"vimeo/psalm": "^4.16"
5151
},
5252
"extra": {
5353
"platform": {
5454
"php": "7.4.*"
5555
}
56+
},
57+
"config": {
58+
"allow-plugins": {
59+
"composer/package-versions-deprecated": true,
60+
"infection/extension-installer": true
61+
}
5662
}
5763
}

phpunit.xml.dist

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<phpunit
43
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
65
backupGlobals="false"
76
backupStaticAttributes="false"
87
convertErrorsToExceptions="true"
@@ -18,9 +17,9 @@
1817
<directory suffix="Test.php">./tests/src</directory>
1918
</testsuite>
2019
</testsuites>
21-
<filter>
22-
<whitelist processUncoveredFilesFromWhitelist="true">
20+
<coverage processUncoveredFiles="true">
21+
<include>
2322
<directory suffix=".php">./src</directory>
24-
</whitelist>
25-
</filter>
23+
</include>
24+
</coverage>
2625
</phpunit>

0 commit comments

Comments
 (0)