Skip to content

Commit 89af4d4

Browse files
authored
Merge pull request #966 from noplanman/psr12-code-style
Use PSR-12 and fix code issues. Move phpcs parameters into phpcs.xml.
2 parents 9ae0cde + 7503081 commit 89af4d4

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
66
## [Unreleased]
77
### Added
88
### Changed
9+
- Use PSR-12 for code style.
910
### Deprecated
1011
### Removed
1112
### Fixed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"scripts": {
4949
"check-code": [
50-
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp --encoding=utf-8 src/ tests/ --report-width=150"
50+
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp src/ tests/"
5151
],
5252
"test": [
5353
"\"vendor/bin/phpunit\""

phpcs.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
<description>PHP Code Sniffer</description>
44

55
<arg name="colors"/>
6+
<arg name="parallel" value="8"/>
7+
<arg name="encoding" value="utf-8"/>
8+
<arg name="report-width" value="150"/>
69

7-
<rule ref="PSR2"/>
10+
<rule ref="PSR12"/>
811

912
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
1013
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>

tests/unit/Commands/CommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testCommandConstructorNeedsTelegramObject()
7474
[null],
7575
[12345],
7676
['something'],
77-
[new \stdClass],
77+
[new \stdClass()],
7878
[$this->telegram], // only this one is valid
7979
];
8080

0 commit comments

Comments
 (0)