Skip to content
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
10 changes: 5 additions & 5 deletions WordPress/AbstractFunctionParameterSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ abstract class AbstractFunctionParameterSniff extends AbstractFunctionRestrictio
/**
* Functions this sniff is looking for. Should be defined in the child class.
*
* @var array The only requirement for this array is that the top level
* array keys are the names of the functions you're looking for.
* Other than that, the array can have arbitrary content
* depending on your needs.
* @var array<string, mixed> The only requirement for this array is that the top level
* array keys are the names of the functions you're looking for.
* Other than that, the array can have arbitrary content
* depending on your needs.
*/
protected $target_functions = array();

/**
* Groups of functions to restrict.
*
* @return array
* @return array<string, array<string, array<string>>>
*/
public function getGroups() {
if ( empty( $this->target_functions ) ) {
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ValidHookNameSniff extends AbstractFunctionParameterSniff {
*
* @since 0.11.0
*
* @return array
* @return array<string, array<string, array<string>>>
*/
public function getGroups() {
// Only retrieve functions which are not used for deprecated hooks.
Expand Down
9 changes: 3 additions & 6 deletions WordPress/Sniffs/PHP/IniSetSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ final class IniSetSniff extends AbstractFunctionParameterSniff {
*
* @since 2.1.0
*
* @var array Multidimensional array with parameter details.
* $target_functions = array(
* (string) Function name.
* );
* @var array<string, true> Key is function name, value irrelevant.
*/
protected $target_functions = array(
'ini_set' => true,
Expand All @@ -47,7 +44,7 @@ final class IniSetSniff extends AbstractFunctionParameterSniff {
* @since 2.1.0
* @since 3.0.0 Renamed from `$whitelisted_options` to `$safe_options`.
*
* @var array Multidimensional array with parameter details.
* @var array<string, array<string, array<string>>> Multidimensional array with parameter details.
* $safe_options = array(
* (string) option name. = array(
* (string[]) 'valid_values' = array()
Expand All @@ -74,7 +71,7 @@ final class IniSetSniff extends AbstractFunctionParameterSniff {
* @since 2.1.0
* @since 3.0.0 Renamed from `$blacklisted_options` to `$disallowed_options`.
*
* @var array Multidimensional array with parameter details.
* @var array<string, array<string, string|array<string>>> Multidimensional array with parameter details.
* $disallowed_options = array(
* (string) option name. = array(
* (string[]) 'invalid_values' = array()
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class DeprecatedParameterValuesSniff extends AbstractFunctionParameterSnif
* @since 3.0.0 The format of the value has changed to support function calls
* using named parameters.
*
* @var array Multidimensional array with parameter details.
* @var array<string, array<int, array<string, mixed>>> Multidimensional array with parameter details.
* $target_functions = array(
* (string) Function name. => array(
* (int) Target parameter position, 1-based. => array(
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Sniffs/WP/DeprecatedParametersSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class DeprecatedParametersSniff extends AbstractFunctionParameterSniff {
*
* @since 0.12.0
*
* @var array Multidimensional array with parameter details.
* @var array<string, array<int, array<string, mixed>>> Multidimensional array with parameter details.
* $target_functions = array(
* (string) Function name. => array(
* (int) Target parameter position, 1-based. => array(
Expand Down
Loading