Skip to content

Use PSR-12 and fix code issues. Move phpcs parameters into phpcs.xml. #966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased]
### Added
### Changed
- Use PSR-12 for code style.
### Deprecated
### Removed
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
"scripts": {
"check-code": [
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp --encoding=utf-8 src/ tests/ --report-width=150"
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp src/ tests/"
],
"test": [
"\"vendor/bin/phpunit\""
Expand Down
5 changes: 4 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
<description>PHP Code Sniffer</description>

<arg name="colors"/>
<arg name="parallel" value="8"/>
<arg name="encoding" value="utf-8"/>
<arg name="report-width" value="150"/>

<rule ref="PSR2"/>
<rule ref="PSR12"/>

<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Commands/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testCommandConstructorNeedsTelegramObject()
[null],
[12345],
['something'],
[new \stdClass],
[new \stdClass()],
[$this->telegram], // only this one is valid
];

Expand Down