@@ -14,8 +14,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
14
14
15
15
<active>yes</active>
16
16
</lead>
17
- <date>2020-10-23 </date>
18
- <time>13:00 :00</time>
17
+ <date>2021-04-09 </date>
18
+ <time>10:51 :00</time>
19
19
<version>
20
20
<release>3.6.0</release>
21
21
<api>3.6.0</api>
@@ -2296,6 +2296,167 @@ http://pear.php.net/dtd/package-2.0.xsd">
2296
2296
</filelist>
2297
2297
</phprelease>
2298
2298
<changelog>
2299
+ <release>
2300
+ <version>
2301
+ <release>3.6.0</release>
2302
+ <api>3.6.0</api>
2303
+ </version>
2304
+ <stability>
2305
+ <release>stable</release>
2306
+ <api>stable</api>
2307
+ </stability>
2308
+ <date>2021-04-09</date>
2309
+ <license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD License</license>
2310
+ <notes>
2311
+ - Added support for PHP 8.0 union types
2312
+ -- A new T_TYPE_UNION token is available to represent the pipe character
2313
+ -- File::getMethodParameters(), getMethodProperties(), and getMemberProperties() will now return union types
2314
+ -- Thanks to Juliette Reinders Folmer for the patch
2315
+ - Added support for PHP 8.0 named function call arguments
2316
+ -- A new T_PARAM_NAME token is available to represent the label with the name of the function argument in it
2317
+ -- Thanks to Juliette Reinders Folmer for the patch
2318
+ - Added support for PHP 8.0 attributes
2319
+ -- The PHP-supplied T_ATTRIBUTE token marks the start of an attribute
2320
+ -- A new T_ATTRIBUTE_END token is available to mark the end of an attribute
2321
+ -- New attribute_owner and attribute_closer indexes are available in the tokens array for all tokens inside an attribute
2322
+ -- Tokenizing of attributes has been backfilled for older PHP versions
2323
+ -- The following sniffs have been updated to support attributes:
2324
+ --- PEAR.Commenting.ClassComment
2325
+ --- PEAR.Commenting.FileComment
2326
+ --- PSR1.Files.SideEffects
2327
+ --- PSR12.Files.FileHeader
2328
+ --- Squiz.Commenting.ClassComment
2329
+ --- Squiz.Commenting.FileComment
2330
+ --- Squiz.WhiteSpace.FunctionSpacing
2331
+ ---- Thanks to Vadim Borodavko for the patch
2332
+ -- Thanks to Alessandro Chitolina for the patch
2333
+ - Added support for PHP 8.0 dereferencing of text strings with interpolated variables
2334
+ -- Thanks to Juliette Reinders Folmer for the patch
2335
+ - Added support for PHP 8.0 match expressions
2336
+ -- Match expressions are now tokenised with parenthesis and scope openers and closers
2337
+ --- Sniffs can listen for the T_MATCH token to process match expressions
2338
+ --- Note that the case and default statements inside match expressions do not have scopes set
2339
+ -- A new T_MATCH_ARROW token is available to represent the arrows in match expressions
2340
+ -- A new T_MATCH_DEFAULT token is available to represent the default keyword in match expressions
2341
+ -- All tokenizing of match expressions has been backfilled for older PHP versions
2342
+ -- The following sniffs have been updated to support match expressions:
2343
+ --- Generic.CodeAnalysis.AssignmentInCondition
2344
+ --- Generic.CodeAnalysis.EmptyPHPStatement
2345
+ ---- Thanks to Vadim Borodavko for the patch
2346
+ --- Generic.CodeAnalysis.EmptyStatement
2347
+ --- Generic.PHP.LowerCaseKeyword
2348
+ --- PEAR.ControlStructures.ControlSignature
2349
+ --- PSR12.ControlStructures.BooleanOperatorPlacement
2350
+ --- Squiz.Commenting.LongConditionClosingComment
2351
+ --- Squiz.Commenting.PostStatementComment
2352
+ --- Squiz.ControlStructures.LowercaseDeclaration
2353
+ --- Squiz.ControlStructures.ControlSignature
2354
+ --- Squiz.Formatting.OperatorBracket
2355
+ --- Squiz.PHP.DisallowMultipleAssignments
2356
+ --- Squiz.Objects.ObjectInstantiation
2357
+ --- Squiz.WhiteSpace.ControlStructureSpacing
2358
+ -- Thanks to Juliette Reinders Folmer for the patch
2359
+ - The value of the T_FN_ARROW token has changed from "T_FN_ARROW" to "PHPCS_T_FN_ARROW" to avoid package conflicts
2360
+ -- This will have no impact on custom sniffs unless they are specifically looking at the value of the T_FN_ARROW constant
2361
+ -- If sniffs are just using constant to find arrow functions, they will continue to work without modification
2362
+ -- Thanks to Juliette Reinders Folmer for the patch
2363
+ - File::findStartOfStatement() now works correctly when passed the last token in a statement
2364
+ - File::getMethodParameters() now supports PHP 8.0 constructor property promotion
2365
+ -- Returned method params now include a "property_visibility" and "visibility_token" index if property promotion is detected
2366
+ -- Thanks to Juliette Reinders Folmer for the patch
2367
+ - File::getMethodProperties() now includes a "return_type_end_token" index in the return value
2368
+ -- This indicates the last token in the return type, which is helpful when checking union types
2369
+ -- Thanks to Juliette Reinders Folmer for the patch
2370
+ - Include patterns are now ignored when processing STDIN
2371
+ -- Previously, checks using include patterns were excluded when processing STDIN when no file path was provided via --stdin-path
2372
+ -- Now, all include and exclude rules are ignored when no file path is provided, allowing all checks to run
2373
+ -- If you want include and exclude rules enforced when checking STDIN, use --stdin-path to set the file path
2374
+ -- Thanks to Juliette Reinders Folmer for the patch
2375
+ - Spaces are now correctly escaped in the paths to external on Windows
2376
+ -- Thanks to Juliette Reinders Folmer for the patch
2377
+ - Added Generic.NamingConventions.AbstractClassNamePrefix to enforce that class names are prefixed with "Abstract"
2378
+ -- Thanks to Anna Borzenko for the contribution
2379
+ - Added Generic.NamingConventions.InterfaceNameSuffix to enforce that interface names are suffixed with "Interface"
2380
+ -- Thanks to Anna Borzenko for the contribution
2381
+ - Added Generic.NamingConventions.TraitNameSuffix to enforce that trait names are suffixed with "Trait"
2382
+ -- Thanks to Anna Borzenko for the contribution
2383
+ - Generic.CodeAnalysis.UnusedFunctionParameter can now be configured to ignore variable usage for specific type hints
2384
+ -- This allows you to suppress warnings for some variables that are not required, but leave warnings for others
2385
+ -- Set the ignoreTypeHints array property to a list of type hints to ignore
2386
+ -- Thanks to Petr Bugyík for the patch
2387
+ - Generic.Formatting.MultipleStatementAlignment can now align statements at the start of the assignment token
2388
+ -- Previously, the sniff enforced that the values were aligned, even if this meant the assignment tokens were not
2389
+ -- Now, the sniff can enforce that the assignment tokens are aligned, even if this means the values are not
2390
+ -- Set the "alignAtEnd" sniff property to "false" to align the assignment tokens
2391
+ -- The default remains at "true", so the assigned values are aligned
2392
+ -- Thanks to John P. Bloch for the patch
2393
+ - Generic.PHP.LowerCaseType now supports checking of typed properties
2394
+ -- Thanks to Juliette Reinders Folmer for the patch
2395
+ - Generic.PHP.LowerCaseType now supports checking of union types
2396
+ -- Thanks to Juliette Reinders Folmer for the patch
2397
+ - PEAR.Commenting.FunctionComment and Squiz.Commenting.FunctionComment sniffs can now ignore private and protected methods
2398
+ -- Set the "minimumVisibility" sniff property to "protected" to ignore private methods
2399
+ -- Set the "minimumVisibility" sniff property to "public" to ignore both private and protected methods
2400
+ -- The default remains at "private", so all methods are checked
2401
+ -- Thanks to Vincent Langlet for the patch
2402
+ - PEAR.Commenting.FunctionComment and Squiz.Commenting.FunctionComment sniffs can now ignore return tags in any method
2403
+ -- Previously, only __construct and __destruct were ignored
2404
+ -- Set the list of method names to ignore in the "specialMethods" sniff property
2405
+ -- The default remains at "__construct" and "__destruct" only
2406
+ -- Thanks to Vincent Langlet for the patch
2407
+ - PSR2.ControlStructures.SwitchDeclaration now supports nested switch statements where every branch terminates
2408
+ -- Previously, if a CASE only contained a SWITCH and no direct terminating statement, a fall-through error was displayed
2409
+ -- Now, the error is surpressed if every branch of the SWITCH has a terminating statement
2410
+ -- Thanks to Vincent Langlet for the patch
2411
+ - The PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket error message is now reported on the closing parenthesis token
2412
+ -- Previously, the error was being reported on the function keyword, leading to confusing line numbers in the error report
2413
+ - Squiz.Commenting.FunctionComment is now able to ignore function comments that are only inheritdoc statements
2414
+ -- Set the skipIfInheritdoc sniff property to "true" to skip checking function comments if the content is only {@inhertidoc}
2415
+ -- The default remains at "false", so these comments will continue to report errors
2416
+ -- Thanks to Jess Myrbo for the patch
2417
+ - Squiz.Commenting.FunctionComment now supports the PHP 8 mixed type
2418
+ -- Thanks to Vadim Borodavko for the patch
2419
+ - Squiz.PHP.NonExecutableCode now has improved handling of syntax errors
2420
+ -- Thanks to Thiemo Kreuz for the patch
2421
+ - Squiz.WhiteSpace.ScopeKeywordSpacing now checks spacing when using PHP 8.0 constructor property promotion
2422
+ -- Thanks to Juliette Reinders Folmer for the patch
2423
+ - Fixed an issue that could occurr when checking files on network drives, such as with WSL2 on Windows 10
2424
+ -- This works around a long-standing PHP bug with is_readable()
2425
+ -- Thanks to Michael S for the patch
2426
+ - Fixed a number of false positives in the Squiz.PHP.DisallowMultipleAssignments sniff
2427
+ -- Sniff no longer errors for default value assignments in arrow functions
2428
+ -- Sniff no longer errors for assignments on first line of closure
2429
+ -- Sniff no longer errors for assignments after a goto label
2430
+ -- Thanks to Jaroslav Hanslík for the patch
2431
+ - Fixed bug #2913 : Generic.WhiteSpace.ScopeIndent false positive when opening and closing tag on same line inside conditional
2432
+ - Fixed bug #2992 : Enabling caching using a ruleset produces invalid cache files when using --sniffs and --exclude CLI args
2433
+ - Fixed bug #3003 : Squiz.Formatting.OperatorBracket autofix incorrect when assignment used with null coalescing operator
2434
+ - Fixed bug #3145 : Autoloading of sniff fails when multiple classes declared in same file
2435
+ - Fixed bug #3157 : PSR2.ControlStructures.SwitchDeclaration.BreakIndent false positive when case keyword is not indented
2436
+ - Fixed bug #3163 : Undefined index error with pre-commit hook using husky on PHP 7.4
2437
+ -- Thanks to Ismo Vuorinen for the patch
2438
+ - Fixed bug #3165 : Squiz.PHP.DisallowComparisonAssignment false positive when comparison inside closure
2439
+ - Fixed bug #3167 : Generic.WhiteSpace.ScopeIndent false positive when using PHP 8.0 constructor property promotion
2440
+ - Fixed bug #3170 : Squiz.WhiteSpace.OperatorSpacing false positive when using negation with string concat
2441
+ -- This also fixes the same issue in the PSR12.Operators.OperatorSpacing sniff
2442
+ - Fixed bug #3177 : Incorrect tokenization of GOTO statements in mixed PHP/HTML files
2443
+ -- Thanks to Juliette Reinders Folmer for the patch
2444
+ - Fixed bug #3184 : PSR2.Namespace.NamespaceDeclaration false positive on namespace operator
2445
+ -- Thanks to Juliette Reinders Folmer for the patch
2446
+ - Fixed bug #3188 : Squiz.WhiteSpace.ScopeKeywordSpacing false positive for static return type
2447
+ -- Thanks to Juliette Reinders Folmer for the patch
2448
+ - Fixed bug #3192 : findStartOfStatement doesn't work correctly inside switch
2449
+ -- Thanks to Vincent Langlet for the patch
2450
+ - Fixed bug #3195 : Generic.WhiteSpace.ScopeIndent confusing message when combination of tabs and spaces found
2451
+ - Fixed bug #3197 : Squiz.NamingConventions.ValidVariableName does not use correct error code for all member vars
2452
+ - Fixed bug #3219 : Generic.Formatting.MultipleStatementAlignment false positive for empty anonymous classes and closures
2453
+ - Fixed bug #3258 : Squiz.Formatting.OperatorBracket duplicate error messages for unary minus
2454
+ -- Thanks to Juliette Reinders Folmer for the patch
2455
+ - Fixed bug #3273 : Squiz.Functions.FunctionDeclarationArgumentSpacing reports line break as 0 spaces between parenthesis
2456
+ - Fixed bug #3277 : Nullable static return typehint causes whitespace error
2457
+ - Fixed bug #3284 : Unused parameter false positive when using array index in arrow function
2458
+ </notes>
2459
+ </release>
2299
2460
<release>
2300
2461
<version>
2301
2462
<release>3.5.8</release>
0 commit comments