Skip to content

Commit

Permalink
Rename sniff back to GetMetaSingle
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed Aug 22, 2024
1 parent 9806487 commit 20a3e3b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion WordPress-Extra/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
<!-- Flags calls to get_*_meta() and get_metadata*() functions
that include the $[meta_]key parameter but omit the $single parameter.
https://github.com/WordPress/WordPress-Coding-Standards/issues/2459 -->
<rule ref="WordPress.WP.GetMetaFunctionSingleParameter"/>
<rule ref="WordPress.WP.GetMetaSingle"/>

<!--
#############################################################################
Expand Down
2 changes: 2 additions & 0 deletions WordPress/Docs/WP/GetMetaFunctionSingleParameterStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
When calling the `get_(comment|post|site|term|user)_meta()`, `get_metadata()`,
`get_metadata_default()`, and `get_metadata_raw()` functions, if the `$[meta_]key` parameter is
passed, the `$single` parameter should be passed as well to make it explicit whether the functions should return a single value (the first value) or an array of values stored for the meta key.
Note that these functions may still return `false` for an invalid ID. They may also return an empty string if `$single` is `true` or an empty array if `$single` is `false` for a valid but non-existing ID. This can be confusing as these might be valid values for a meta value.
]]>
</standard>
<code_comparison>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @since 3.2.0
*/
final class GetMetaFunctionSingleParameterSniff extends AbstractFunctionParameterSniff {
final class GetMetaSingleSniff extends AbstractFunctionParameterSniff {

/**
* The group name for this group of functions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;

/**
* Unit test class for the GetMetaFunctionSingleParameter sniff.
* Unit test class for the GetMetaSingle sniff.
*
* @since 3.2.0
*
* @covers \WordPressCS\WordPress\Sniffs\WP\GetMetaFunctionSingleParameterSniff
* @covers \WordPressCS\WordPress\Sniffs\WP\GetMetaSingleSniff
*/
final class GetMetaFunctionSingleParameterUnitTest extends AbstractSniffUnitTest {
final class GetMetaSingleUnitTest extends AbstractSniffUnitTest {

/**
* Returns the lines where errors should occur.
Expand Down

0 comments on commit 20a3e3b

Please sign in to comment.