Skip to content

Commit

Permalink
chore: update phpcs rules (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
rancoud authored Dec 7, 2024
1 parent abcb257 commit 8b44d58
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
32 changes: 17 additions & 15 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'spacing' => 'one'
],
'declare_strict_types' => true,
'get_class_to_class_keyword' => false,
'global_namespace_import' => false,
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
Expand All @@ -28,21 +29,22 @@
'@all'
]
],
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => false,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'single_import_per_statement' => false,
'strict_comparison' => true,
'strict_param' => true,
'single_line_throw' => false,
'trailing_comma_in_multiline' => false,
'yoda_style' => [
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => false,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'single_import_per_statement' => false,
'strict_comparison' => true,
'strict_param' => true,
'single_line_throw' => false,
'trailing_comma_in_multiline' => false,
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false
Expand Down
4 changes: 2 additions & 2 deletions src/ErrorWarning.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function addErrorField(string $field, string $reasons): void
/**
* @param string|null $field
*/
protected function resetErrorField(string $field = null): void
protected function resetErrorField(?string $field = null): void
{
if ($field === null) {
$this->errorFields = [];
Expand Down Expand Up @@ -149,7 +149,7 @@ protected function addWarningField(string $field, string $reasons): void
/**
* @param string|null $field
*/
protected function resetWarningField(string $field = null): void
protected function resetWarningField(?string $field = null): void
{
if ($field === null) {
$this->warningFields = [];
Expand Down
2 changes: 1 addition & 1 deletion src/JsonOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait JsonOutput
*
* @return string
*/
public function getJson(int $id = null): string
public function getJson(?int $id = null): string
{
if ($id !== null) {
return \json_encode($this->getOneJson($id), \JSON_THROW_ON_ERROR);
Expand Down
4 changes: 2 additions & 2 deletions tests/ImplementationErrorWarning.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function addErrorField(string $field, string $reasons): void
/**
* @param string|null $field
*/
public function resetErrorField(string $field = null): void
public function resetErrorField(?string $field = null): void
{
parent::resetErrorField($field);
}
Expand All @@ -66,7 +66,7 @@ public function addWarningField(string $field, string $reasons): void
/**
* @param string|null $field
*/
public function resetWarningField(string $field = null): void
public function resetWarningField(?string $field = null): void
{
parent::resetWarningField($field);
}
Expand Down

0 comments on commit 8b44d58

Please sign in to comment.