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

chore: update phpcs rules #206

Merged
merged 1 commit into from
Dec 7, 2024
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
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
Loading