Verified Commit b62ead8d authored by Dave Long's avatar Dave Long
Browse files

Issue #3330481 by spokje, quietone, mstrelan, smustgrave: Fix PHPStan L2 error...

Issue #3330481 by spokje, quietone, mstrelan, smustgrave: Fix PHPStan L2 error "PHPDoc tag @foo has invalid value (Bar)"

(cherry picked from commit 5a87e35f)
parent b98a997f
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface, Capable {
  /**
   * Record whether the 'require' command was called.
   *
   * @param bool
   * @var bool
   */
  protected $requireWasCalled;

+2 −5
Original line number Diff line number Diff line
@@ -441,7 +441,7 @@ function drupal_static_reset($name = NULL) {
 *
 * @param callable $callback
 *   The shutdown function to register.
 * @param ...
 * @param ...$args
 *   Additional arguments to pass to the shutdown function.
 *
 * @return array
@@ -450,7 +450,7 @@ function drupal_static_reset($name = NULL) {
 * @see register_shutdown_function()
 * @ingroup php_wrappers
 */
function &drupal_register_shutdown_function($callback = NULL) {
function &drupal_register_shutdown_function($callback = NULL, ...$args) {
  // We cannot use drupal_static() here because the static cache is reset during
  // batch processing, which breaks batch handling.
  static $callbacks = [];
@@ -460,9 +460,6 @@ function &drupal_register_shutdown_function($callback = NULL) {
    if (empty($callbacks)) {
      register_shutdown_function('_drupal_shutdown_function');
    }
    $args = func_get_args();
    // Remove $callback from the arguments.
    unset($args[0]);
    // Save callback and arguments
    $callbacks[] = ['callback' => $callback, 'arguments' => $args];
  }
+2 −2
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ public static function assertAllStrictArrays($traversable) {
   *
   * @param mixed $traversable
   *   Variable to be examined.
   * @param string ...
   * @param ...$keys
   *   Keys to be searched for.
   *
   * @return bool
@@ -370,7 +370,7 @@ public static function assertAllRegularExpressionMatch($pattern, $traversable) {
   *
   * @param mixed $traversable
   *   Variable to be examined.
   * @param string ...
   * @param ...$classes
   *   Classes and interfaces to test objects against.
   *
   * @return bool
+3 −3
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ public static function keyExists(array $array, array $parents) {
   * $correct = NestedArray::mergeDeep($link_options_1, $link_options_2);
   * @endcode
   *
   * @param array ...
   * @param array ...$arrays
   *   Arrays to merge.
   *
   * @return array
@@ -294,8 +294,8 @@ public static function keyExists(array $array, array $parents) {
   *
   * @see NestedArray::mergeDeepArray()
   */
  public static function mergeDeep() {
    return self::mergeDeepArray(func_get_args());
  public static function mergeDeep(...$arrays) {
    return self::mergeDeepArray($arrays);
  }

  /**
+3 −3
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ class Cache {
  /**
   * Merges lists of cache contexts and removes duplicates.
   *
   * @param list<string> ...
   * @param list<string> ...$cache_contexts
   *   Cache contexts to merge.
   *
   * @return list<string>
@@ -42,7 +42,7 @@ public static function mergeContexts(array ...$cache_contexts) {
   * allows items to be invalidated based on all tags attached to the content
   * they're constituted from.
   *
   * @param list<string> ...
   * @param list<string> ...$cache_tags
   *   Cache tags to merge.
   *
   * @return list<string>
@@ -59,7 +59,7 @@ public static function mergeTags(array ...$cache_tags) {
   *
   * Ensures infinite max-age (Cache::PERMANENT) is taken into account.
   *
   * @param int ...
   * @param int ...$max_ages
   *   Max age values to merge.
   *
   * @return int
Loading