[CS-FIXER] Updated cs-fixer rules and added a temporary exception to the src/Entity folder (awaiting pr merge)

This commit is contained in:
Hugo Sales 2020-03-18 16:40:07 +00:00 committed by Hugo Sales
parent e3c0669b37
commit 23b47b2aeb
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 11 additions and 54 deletions

16
.php_cs
View File

@ -13,7 +13,10 @@ return PhpCsFixer\Config::create()
// PHP arrays should be declared using the configured syntax. // PHP arrays should be declared using the configured syntax.
'array_syntax' => ['syntax' => 'short'], 'array_syntax' => ['syntax' => 'short'],
// Binary operators should be surrounded by space as configured. // Binary operators should be surrounded by space as configured.
'binary_operator_spaces' => ['default' => 'align_single_space_minimal'], 'binary_operator_spaces' => [
'default' => 'align_single_space_minimal',
'operators' => ['??' => 'align'],
],
// There MUST be one blank line after the namespace declaration. // There MUST be one blank line after the namespace declaration.
'blank_line_after_namespace' => true, 'blank_line_after_namespace' => true,
// Each element of an array must be indented exactly once. // Each element of an array must be indented exactly once.
@ -21,11 +24,13 @@ return PhpCsFixer\Config::create()
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line. // Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.
'blank_line_after_opening_tag' => true, 'blank_line_after_opening_tag' => true,
// The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be properly indented. // The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be properly indented.
'braces' => ['allow_single_line_closure' => true, 'position_after_functions_and_oop_constructs' => 'next'], 'braces' => ['allow_single_line_closure' => true, 'position_after_functions_and_oop_constructs' => 'next',
// 'allow_single_line_functions' => true, // Awaiting PR merge...
],
// A single space or none should be between cast and variable. // A single space or none should be between cast and variable.
'cast_spaces' => true, 'cast_spaces' => true,
// Class, trait and interface elements must be separated with one blank line. // Class, trait and interface elements must be separated with one blank line.
'class_attributes_separation' => true, 'class_attributes_separation' => false,
// Whitespace around the keywords of a class, trait or interfaces definition should be one space. // Whitespace around the keywords of a class, trait or interfaces definition should be one space.
'class_definition' => ['single_item_single_line' => true, 'single_line' => true], 'class_definition' => ['single_item_single_line' => true, 'single_line' => true],
// Using `isset($var) &&` multiple times should be done in one call. // Using `isset($var) &&` multiple times should be done in one call.
@ -145,7 +150,7 @@ return PhpCsFixer\Config::create()
// In function arguments there must not be arguments with default values before non-default ones. // In function arguments there must not be arguments with default values before non-default ones.
'no_unreachable_default_argument_value' => true, 'no_unreachable_default_argument_value' => true,
// Variables must be set `null` instead of using `(unset)` casting. // Variables must be set `null` instead of using `(unset)` casting.
'no_unset_cast' => true, 'no_unset_cast' => false,
// Properties should be set to `null` instead of using `unset`. // Properties should be set to `null` instead of using `unset`.
'no_unset_on_property' => true, 'no_unset_on_property' => true,
// Unused `use` statements must be removed. // Unused `use` statements must be removed.
@ -205,7 +210,7 @@ return PhpCsFixer\Config::create()
// Annotations in PHPDoc should be grouped together so that annotations of the same type immediately follow each other, and annotations of a different type are separated by a single blank line. // Annotations in PHPDoc should be grouped together so that annotations of the same type immediately follow each other, and annotations of a different type are separated by a single blank line.
'phpdoc_separation' => true, 'phpdoc_separation' => true,
// Single line `@var` PHPDoc should have proper spacing. // Single line `@var` PHPDoc should have proper spacing.
'phpdoc_single_line_var_spacing' => true, 'phpdoc_single_line_var_spacing' => false,
// Removes extra blank lines after summary and after description in PHPDoc. // Removes extra blank lines after summary and after description in PHPDoc.
'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true,
// The correct case must be used for standard PHP types in PHPDoc. // The correct case must be used for standard PHP types in PHPDoc.
@ -266,5 +271,6 @@ return PhpCsFixer\Config::create()
->setFinder(PhpCsFixer\Finder::create() ->setFinder(PhpCsFixer\Finder::create()
->exclude('vendor') ->exclude('vendor')
->exclude('var') ->exclude('var')
->exclude('src/Entity')
->in(__DIR__) ->in(__DIR__)
); );

View File

@ -7,53 +7,29 @@ class User
// AUTOCODE BEGIN // AUTOCODE BEGIN
private int $id; private int $id;
private ?string $nickname; private ?string $nickname;
private ?string $password; private ?string $password;
private ?string $email; private ?string $email;
private ?string $incomingemail; private ?string $incomingemail;
private ?bool $emailnotifysub; private ?bool $emailnotifysub;
private ?int $emailnotifyfav; private ?int $emailnotifyfav;
private ?bool $emailnotifynudge; private ?bool $emailnotifynudge;
private ?bool $emailnotifymsg; private ?bool $emailnotifymsg;
private ?bool $emailnotifyattn; private ?bool $emailnotifyattn;
private ?string $language; private ?string $language;
private ?string $timezone; private ?string $timezone;
private ?bool $emailpost; private ?bool $emailpost;
private ?string $sms; private ?string $sms;
private ?int $carrier; private ?int $carrier;
private ?bool $smsnotify; private ?bool $smsnotify;
private ?bool $smsreplies; private ?bool $smsreplies;
private ?string $smsemail; private ?string $smsemail;
private ?string $uri; private ?string $uri;
private ?bool $autosubscribe; private ?bool $autosubscribe;
private ?int $subscribe_policy; private ?int $subscribe_policy;
private ?string $urlshorteningservice; private ?string $urlshorteningservice;
private ?bool $private_stream; private ?bool $private_stream;
private DateTime $created; private DateTime $created;
private DateTime $modified; private DateTime $modified;
public function setId(int $id): self public function setId(int $id): self
@ -61,7 +37,6 @@ class User
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
public function getId(): int public function getId(): int
{ {
return $this->id; return $this->id;
@ -72,7 +47,6 @@ class User
$this->nickname = $nickname; $this->nickname = $nickname;
return $this; return $this;
} }
public function getNickname(): ?string public function getNickname(): ?string
{ {
return $this->nickname; return $this->nickname;
@ -83,7 +57,6 @@ class User
$this->password = $password; $this->password = $password;
return $this; return $this;
} }
public function getPassword(): ?string public function getPassword(): ?string
{ {
return $this->password; return $this->password;
@ -94,7 +67,6 @@ class User
$this->email = $email; $this->email = $email;
return $this; return $this;
} }
public function getEmail(): ?string public function getEmail(): ?string
{ {
return $this->email; return $this->email;
@ -105,7 +77,6 @@ class User
$this->incomingemail = $incomingemail; $this->incomingemail = $incomingemail;
return $this; return $this;
} }
public function getIncomingemail(): ?string public function getIncomingemail(): ?string
{ {
return $this->incomingemail; return $this->incomingemail;
@ -116,7 +87,6 @@ class User
$this->emailnotifysub = $emailnotifysub; $this->emailnotifysub = $emailnotifysub;
return $this; return $this;
} }
public function getEmailnotifysub(): ?bool public function getEmailnotifysub(): ?bool
{ {
return $this->emailnotifysub; return $this->emailnotifysub;
@ -127,7 +97,6 @@ class User
$this->emailnotifyfav = $emailnotifyfav; $this->emailnotifyfav = $emailnotifyfav;
return $this; return $this;
} }
public function getEmailnotifyfav(): ?int public function getEmailnotifyfav(): ?int
{ {
return $this->emailnotifyfav; return $this->emailnotifyfav;
@ -138,7 +107,6 @@ class User
$this->emailnotifynudge = $emailnotifynudge; $this->emailnotifynudge = $emailnotifynudge;
return $this; return $this;
} }
public function getEmailnotifynudge(): ?bool public function getEmailnotifynudge(): ?bool
{ {
return $this->emailnotifynudge; return $this->emailnotifynudge;
@ -149,7 +117,6 @@ class User
$this->emailnotifymsg = $emailnotifymsg; $this->emailnotifymsg = $emailnotifymsg;
return $this; return $this;
} }
public function getEmailnotifymsg(): ?bool public function getEmailnotifymsg(): ?bool
{ {
return $this->emailnotifymsg; return $this->emailnotifymsg;
@ -160,7 +127,6 @@ class User
$this->emailnotifyattn = $emailnotifyattn; $this->emailnotifyattn = $emailnotifyattn;
return $this; return $this;
} }
public function getEmailnotifyattn(): ?bool public function getEmailnotifyattn(): ?bool
{ {
return $this->emailnotifyattn; return $this->emailnotifyattn;
@ -171,7 +137,6 @@ class User
$this->language = $language; $this->language = $language;
return $this; return $this;
} }
public function getLanguage(): ?string public function getLanguage(): ?string
{ {
return $this->language; return $this->language;
@ -182,7 +147,6 @@ class User
$this->timezone = $timezone; $this->timezone = $timezone;
return $this; return $this;
} }
public function getTimezone(): ?string public function getTimezone(): ?string
{ {
return $this->timezone; return $this->timezone;
@ -193,7 +157,6 @@ class User
$this->emailpost = $emailpost; $this->emailpost = $emailpost;
return $this; return $this;
} }
public function getEmailpost(): ?bool public function getEmailpost(): ?bool
{ {
return $this->emailpost; return $this->emailpost;
@ -204,7 +167,6 @@ class User
$this->sms = $sms; $this->sms = $sms;
return $this; return $this;
} }
public function getSms(): ?string public function getSms(): ?string
{ {
return $this->sms; return $this->sms;
@ -215,7 +177,6 @@ class User
$this->carrier = $carrier; $this->carrier = $carrier;
return $this; return $this;
} }
public function getCarrier(): ?int public function getCarrier(): ?int
{ {
return $this->carrier; return $this->carrier;
@ -226,7 +187,6 @@ class User
$this->smsnotify = $smsnotify; $this->smsnotify = $smsnotify;
return $this; return $this;
} }
public function getSmsnotify(): ?bool public function getSmsnotify(): ?bool
{ {
return $this->smsnotify; return $this->smsnotify;
@ -237,7 +197,6 @@ class User
$this->smsreplies = $smsreplies; $this->smsreplies = $smsreplies;
return $this; return $this;
} }
public function getSmsreplies(): ?bool public function getSmsreplies(): ?bool
{ {
return $this->smsreplies; return $this->smsreplies;
@ -248,7 +207,6 @@ class User
$this->smsemail = $smsemail; $this->smsemail = $smsemail;
return $this; return $this;
} }
public function getSmsemail(): ?string public function getSmsemail(): ?string
{ {
return $this->smsemail; return $this->smsemail;
@ -259,7 +217,6 @@ class User
$this->uri = $uri; $this->uri = $uri;
return $this; return $this;
} }
public function getUri(): ?string public function getUri(): ?string
{ {
return $this->uri; return $this->uri;
@ -270,7 +227,6 @@ class User
$this->autosubscribe = $autosubscribe; $this->autosubscribe = $autosubscribe;
return $this; return $this;
} }
public function getAutosubscribe(): ?bool public function getAutosubscribe(): ?bool
{ {
return $this->autosubscribe; return $this->autosubscribe;
@ -281,7 +237,6 @@ class User
$this->subscribe_policy = $subscribe_policy; $this->subscribe_policy = $subscribe_policy;
return $this; return $this;
} }
public function getSubscribePolicy(): ?int public function getSubscribePolicy(): ?int
{ {
return $this->subscribe_policy; return $this->subscribe_policy;
@ -292,7 +247,6 @@ class User
$this->urlshorteningservice = $urlshorteningservice; $this->urlshorteningservice = $urlshorteningservice;
return $this; return $this;
} }
public function getUrlshorteningservice(): ?string public function getUrlshorteningservice(): ?string
{ {
return $this->urlshorteningservice; return $this->urlshorteningservice;
@ -303,7 +257,6 @@ class User
$this->private_stream = $private_stream; $this->private_stream = $private_stream;
return $this; return $this;
} }
public function getPrivateStream(): ?bool public function getPrivateStream(): ?bool
{ {
return $this->private_stream; return $this->private_stream;
@ -314,7 +267,6 @@ class User
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTime public function getCreated(): DateTime
{ {
return $this->created; return $this->created;
@ -325,7 +277,6 @@ class User
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTime public function getModified(): DateTime
{ {
return $this->modified; return $this->modified;