Skip to content

Commit e0df160

Browse files
authored
Update PHP-CS-Fixer and Config (#725)
Update PHP-CS-Fixer from version 3.2.0 to 3.68.5. Correct php-cs-fixer.php config for updates. Correct api mustache template spacing and new-lines.
1 parent 02576c2 commit e0df160

File tree

755 files changed

+3749
-2967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

755 files changed

+3749
-2967
lines changed

.php-cs-fixer.php

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
$config = new PhpCsFixer\Config();
1818

1919
return $config
20+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
2021
->setRiskyAllowed(true)
2122
->setUsingCache(false)
2223
->setRules([
@@ -47,12 +48,18 @@
4748
'while',
4849
],
4950
],
50-
'braces' => true,
51+
'braces_position' => true,
52+
'control_structure_braces' => true,
53+
'control_structure_continuation_position' => true,
54+
'declare_parentheses' => true,
55+
'no_multiple_statements_per_line' => true,
56+
'single_space_around_construct' => true,
57+
'statement_indentation' => true,
5158
'cast_spaces' => true,
5259
'class_attributes_separation' => ['elements' => ['const'=>'one', 'method'=>'one', 'property'=>'one']],
5360
'combine_consecutive_issets' => true,
5461
'combine_consecutive_unsets' => true,
55-
'compact_nullable_typehint' => true,
62+
'compact_nullable_type_declaration' => true,
5663
'concat_space' => ['spacing' => 'one'],
5764
'constant_case' => true,
5865
'declare_equal_normalize' => ['space' => 'none'],
@@ -65,7 +72,7 @@
6572
'explicit_string_variable' => true,
6673
'full_opening_tag' => true,
6774
'fully_qualified_strict_types' => true,
68-
'function_typehint_space' => true,
75+
'type_declaration_spaces' => true,
6976
'function_declaration' => true,
7077
'global_namespace_import' => [
7178
'import_classes' => false,
@@ -74,7 +81,7 @@
7481
],
7582
'heredoc_to_nowdoc' => true,
7683
'increment_style' => [
77-
'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST,
84+
'style' => 'post',
7885
],
7986
'indentation_type' => true,
8087
'is_null' => true,
@@ -92,8 +99,8 @@
9299
'native_constant_invocation' => false,
93100
'native_function_casing' => false,
94101
'native_function_invocation' => ['include'=>['@all']],
95-
'native_function_type_declaration_casing' => true,
96-
'new_with_braces' => false,
102+
'native_type_declaration_casing' => true,
103+
'new_with_parentheses' => false,
97104
'no_alias_functions' => true,
98105
'no_alternative_syntax' => true,
99106
'no_blank_lines_after_class_opening' => true,
@@ -103,7 +110,24 @@
103110
'no_empty_comment' => true,
104111
'no_empty_phpdoc' => true,
105112
'no_empty_statement' => true,
106-
'no_extra_blank_lines' => true,
113+
'no_extra_blank_lines' => [
114+
'tokens' => [
115+
'attribute',
116+
'break',
117+
'case',
118+
'continue',
119+
'curly_brace_block',
120+
'default',
121+
'extra',
122+
'parenthesis_brace_block',
123+
'return',
124+
'square_brace_block',
125+
'switch',
126+
'throw',
127+
'use',
128+
'use_trait',
129+
],
130+
],
107131
'no_homoglyph_names' => true,
108132
'no_leading_import_slash' => true,
109133
'no_leading_namespace_whitespace' => true,
@@ -115,14 +139,14 @@
115139
'no_singleline_whitespace_before_semicolons' => true,
116140
'no_spaces_after_function_name' => true,
117141
'no_spaces_around_offset' => true,
118-
'no_spaces_inside_parenthesis' => true,
142+
'spaces_inside_parentheses' => ['space' => 'none'],
119143
'no_superfluous_elseif' => true,
120144
'no_superfluous_phpdoc_tags' => true,
121145
'no_trailing_comma_in_singleline' => true,
122146
'no_trailing_whitespace' => true,
123147
'no_trailing_whitespace_in_comment' => true,
124148
'no_unneeded_control_parentheses' => true,
125-
'no_unneeded_curly_braces' => true,
149+
'no_unneeded_braces' => true,
126150
'no_unneeded_final_method' => true,
127151
'no_unreachable_default_argument_value' => true,
128152
'no_unset_on_property' => true,
@@ -160,9 +184,9 @@
160184
],
161185
'ordered_imports' => [
162186
'imports_order' => [
163-
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CONST,
164-
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_FUNCTION,
165-
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CLASS,
187+
'const',
188+
'function',
189+
'class',
166190
]
167191
],
168192
'ordered_interfaces' => [
@@ -188,8 +212,12 @@
188212
'phpdoc_types' => ['groups' => ['simple', 'meta']],
189213
'phpdoc_types_order' => true,
190214
'phpdoc_var_without_name' => true,
191-
'phpdoc_to_param_type' => true,
192-
'phpdoc_to_return_type' => true,
215+
'phpdoc_to_param_type' => [
216+
'union_types' => false,
217+
],
218+
'phpdoc_to_return_type' => [
219+
'union_types' => false,
220+
],
193221
'pow_to_exponentiation' => true,
194222
'protected_to_private' => true,
195223
'return_assignment' => true,

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/php-amazon-selling-partner-api/api.mustache

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,13 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
283283
if (is_array(${{paramName}})) {
284284
${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{#style}}{{style}}{{/style}}{{^style}}{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}{{/style}}', true);
285285
}
286+
286287
if (${{paramName}} !== null) {
287288
$queryParams['{{baseName}}'] = ObjectSerializer::toString(${{paramName}});
288289
}
289290
{{/isExplode}}
290-
{{/queryParams}}
291291

292+
{{/queryParams}}
292293
if (\count($queryParams)) {
293294
$query = http_build_query($queryParams);
294295
}
@@ -299,18 +300,20 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
299300
if (is_array(${{paramName}})) {
300301
${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}');
301302
}
303+
302304
{{/collectionFormat}}
303305
if (${{paramName}} !== null) {
304306
$headerParams['{{baseName}}'] = ObjectSerializer::toHeaderValue(${{paramName}});
305307
}
306-
{{/headerParams}}
307308

309+
{{/headerParams}}
308310
{{#pathParams}}
309311
// path params
310312
{{#collectionFormat}}
311313
if (is_array(${{paramName}})) {
312314
${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}');
313315
}
316+
314317
{{/collectionFormat}}
315318
if (${{paramName}} !== null) {
316319
$resourcePath = str_replace(
@@ -319,8 +322,8 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
319322
$resourcePath
320323
);
321324
}
322-
{{/pathParams}}
323325

326+
{{/pathParams}}
324327
{{#formParams}}
325328
// form params
326329
if (${{paramName}} !== null) {
@@ -339,8 +342,8 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
339342
$formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}});
340343
{{/isFile}}
341344
}
342-
{{/formParams}}
343345

346+
{{/formParams}}
344347
if ($multipart) {
345348
$headers = [
346349
'accept' => ['application/json'],

0 commit comments

Comments
 (0)