Skip to content

Commit

Permalink
PHPCS: Update to a newer snapshot of WordPress-Coding-Standards (#28199)
Browse files Browse the repository at this point in the history
* Update WPCS to 2023-01-04 tag
* Update codesniffer config
* Drop MediaWiki.Usage.DirUsage, WPCS brings in
  Modernize.FunctionCalls.Dirname which checks the same and more.
* Configure `WordPress.WP.Capabilities`
* Ignore new Generic.CodeAnalysis.UnusedFunctionParameter, we already
  use VariableAnalysis.CodeAnalysis.VariableAnalysis that checks more
  stuff.
* Ignore new Universal.NamingConventions.NoReservedKeywordParameterNames,
  not really useful until we can use PHP 8.
* Add ignores with todo notes for existing instances of Universal.Files.SeparateFunctionsFromOO.Mixed
* Fix/ignore remaining sniffs:

  Fixed:

  * Universal.Arrays.DuplicateArrayKey
  * WordPress.WP.AlternativeFunctions.unlink_unlink
  * WordPress.WP.Capabilities.RoleFound
  * WordPress.WP.ClassNameCase.Incorrect

  Ignored:

  * Universal.CodeAnalysis.ConstructorDestructorReturn - 1 false positive
  * WordPress.DB.DirectDatabaseQuery - "db call ok" comment is no longer
    recognized.
  * WordPress.WP.AlternativeFunctions.file_system_operations_is_writeable -
  * WordPress.WP.AlternativeFunctions.file_system_operations_mkdir -
  * WordPress.WP.AlternativeFunctions.file_system_operations_touch -
    Matching nearby ignores for fopen etc.
  * WordPress.WP.Capabilities.Unknown - Capabilities from other plugins.

  Renamed existing ignores:

  * WordPress.PHP.IniSet.display_errors_Disallowed
  * WordPress.WP.AlternativeFunctions.file_system_operations_fopen
  * WordPress.WP.AlternativeFunctions.file_system_operations_fread
  * WordPress.WP.AlternativeFunctions.file_system_operations_fwrite
  * WordPress.WP.AlternativeFunctions.file_system_operations_fclose
  * WordPress.WP.EnqueuedResourceParameters.MissingVersion

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/3876225948
  • Loading branch information
anomiex authored and matticbot committed Jan 9, 2023
1 parent f90ad89 commit ebba40a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/php/lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package automattic/jetpack-autoloader
*/

// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed

/**
* Since PHP8 added a warning for setting `$throw` to `false` in `spl_autoload_register()`,
* we need to define the autoload functions in order for them to be registered.
Expand Down

0 comments on commit ebba40a

Please sign in to comment.