Skip to content
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

use php-cs-fixer ^3.2 #7

Merged
merged 3 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ composer.phar
/.idea

.php_cs.cache
.php-cs-fixer.cache
File renamed without changes.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "Nextcloud coding standards for the php cs fixer",
"type": "library",
"require": {
"php": "^7.2|^8.0",
"friendsofphp/php-cs-fixer": "^2.17"
"php": "^7.4|^8.0",
dartcafe marked this conversation as resolved.
Show resolved Hide resolved
"friendsofphp/php-cs-fixer": "^3.2"
},
"license": "MIT",
"authors": [
Expand Down
12 changes: 4 additions & 8 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ public function __construct($name = 'default') {
$this->setIndent("\t");
}

public function getRules() {
public function getRules() : array {
return [
'@PSR1' => true,
'@PSR2' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'default' => 'single_space',
],
Expand All @@ -39,11 +36,10 @@ public function getRules() {
],
'indentation_type' => true,
'line_ending' => true,
'list_syntax' => [
'syntax' => 'short',
],
Comment on lines -42 to -44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this intentional? It's this here, right:

list($a, $b) = …;
[$a, $b] = …;

I don't think we want to go back and allow the long one?

Copy link
Member

@ChristophWurst ChristophWurst Nov 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't catch this but no, I would not go back. Could you send a PR to fix it? We can do a v1.0.1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or is this rule not supported anymore and "short" by default now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR in #8

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it, because it is declared as default in 3.2.

From https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.0.0/UPGRADE-v3.md

Changed default values of options

Rule Option Old value New value
list_syntax syntax 'long' 'short'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy, sorry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, that someone does a real review...

'lowercase_keywords' => true,
'method_argument_space' => [],
'method_argument_space' => [
'on_multiline' => 'ignore',
],
'no_closing_tag' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
Expand Down