Loading core/lib/Drupal/Component/Assertion/Inspector.php +7 −13 Original line number Diff line number Diff line Loading @@ -184,19 +184,16 @@ public static function assertAllStrictArrays($traversable) { * * @param mixed $traversable * Variable to be examined. * @param ...$keys * @param string ...$keys * Keys to be searched for. * * @return bool * TRUE if $traversable can be traversed and all members have all keys. */ public static function assertAllHaveKey($traversable) { $args = func_get_args(); unset($args[0]); public static function assertAllHaveKey($traversable, string ...$keys) { if (is_iterable($traversable)) { foreach ($traversable as $member) { foreach ($args as $key) { foreach ($keys as $key) { if (!array_key_exists($key, $member)) { return FALSE; } Loading Loading @@ -370,21 +367,18 @@ public static function assertAllRegularExpressionMatch($pattern, $traversable) { * * @param mixed $traversable * Variable to be examined. * @param ...$classes * @param string ...$classes * Classes and interfaces to test objects against. * * @return bool * TRUE if $traversable can be traversed and all members are objects with * at least one of the listed classes or interfaces. */ public static function assertAllObjects($traversable) { $args = func_get_args(); unset($args[0]); public static function assertAllObjects($traversable, string ...$classes) { if (is_iterable($traversable)) { foreach ($traversable as $member) { if (count($args) > 0) { foreach ($args as $instance) { if (count($classes) > 0) { foreach ($classes as $instance) { if ($member instanceof $instance) { // We're continuing to the next member on the outer loop. // @see http://php.net/continue Loading core/lib/Drupal/Core/Config/ConfigInstaller.php +1 −1 Original line number Diff line number Diff line Loading @@ -517,7 +517,7 @@ public function isSyncing() { * * @param \Drupal\Core\Config\StorageInterface $storage * The storage containing the default configuration. * @param $previous_config_names * @param array $previous_config_names * An array of configuration names that have previously been checked. * * @return array Loading core/lib/Drupal/Core/Extension/ProceduralCall.php +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public function __call($name, $args): mixed { /** * Loads the file a function lives in, if any. * * @param $function * @param string $function * The name of the function. */ public function loadFile($function): void { Loading core/lib/Drupal/Core/Hook/HookCollectorPass.php +6 −6 Original line number Diff line number Diff line Loading @@ -156,14 +156,14 @@ public static function collectAllHookImplementations(array $module_filenames, ?C /** * Collects procedural and Attribute hook implementations. * * @param $dir * @param string $dir * The directory in which the module resides. * @param $module * @param string $module * The name of the module. * @param $module_preg * @param string $module_preg * A regular expression matching every module, longer module names are * matched first. * @param $skip_procedural * @param bool $skip_procedural * Skip the procedural check for the current module. */ protected function collectModuleHookImplementations($dir, $module, $module_preg, bool $skip_procedural): void { Loading Loading @@ -300,9 +300,9 @@ protected static function getHookAttributesInClass(string $class): array { * * @param \Drupal\Core\Hook\Attribute\Hook $hook * A hook attribute. * @param $class * @param string $class * The class in which said attribute resides in. * @param $module * @param string $module * The module in which the class resides in. */ protected function addFromAttribute(Hook $hook, $class, $module): void { Loading core/lib/Drupal/Core/Utility/ProjectInfo.php +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public function getProjectName(Extension $file) { * @param array $info * Array of .info.yml file data as returned by * \Drupal\Core\Extension\InfoParser. * @param $additional_elements * @param array $additional_elements * (optional) Array of additional elements to be collected from the * .info.yml file. Defaults to []. * Loading Loading
core/lib/Drupal/Component/Assertion/Inspector.php +7 −13 Original line number Diff line number Diff line Loading @@ -184,19 +184,16 @@ public static function assertAllStrictArrays($traversable) { * * @param mixed $traversable * Variable to be examined. * @param ...$keys * @param string ...$keys * Keys to be searched for. * * @return bool * TRUE if $traversable can be traversed and all members have all keys. */ public static function assertAllHaveKey($traversable) { $args = func_get_args(); unset($args[0]); public static function assertAllHaveKey($traversable, string ...$keys) { if (is_iterable($traversable)) { foreach ($traversable as $member) { foreach ($args as $key) { foreach ($keys as $key) { if (!array_key_exists($key, $member)) { return FALSE; } Loading Loading @@ -370,21 +367,18 @@ public static function assertAllRegularExpressionMatch($pattern, $traversable) { * * @param mixed $traversable * Variable to be examined. * @param ...$classes * @param string ...$classes * Classes and interfaces to test objects against. * * @return bool * TRUE if $traversable can be traversed and all members are objects with * at least one of the listed classes or interfaces. */ public static function assertAllObjects($traversable) { $args = func_get_args(); unset($args[0]); public static function assertAllObjects($traversable, string ...$classes) { if (is_iterable($traversable)) { foreach ($traversable as $member) { if (count($args) > 0) { foreach ($args as $instance) { if (count($classes) > 0) { foreach ($classes as $instance) { if ($member instanceof $instance) { // We're continuing to the next member on the outer loop. // @see http://php.net/continue Loading
core/lib/Drupal/Core/Config/ConfigInstaller.php +1 −1 Original line number Diff line number Diff line Loading @@ -517,7 +517,7 @@ public function isSyncing() { * * @param \Drupal\Core\Config\StorageInterface $storage * The storage containing the default configuration. * @param $previous_config_names * @param array $previous_config_names * An array of configuration names that have previously been checked. * * @return array Loading
core/lib/Drupal/Core/Extension/ProceduralCall.php +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public function __call($name, $args): mixed { /** * Loads the file a function lives in, if any. * * @param $function * @param string $function * The name of the function. */ public function loadFile($function): void { Loading
core/lib/Drupal/Core/Hook/HookCollectorPass.php +6 −6 Original line number Diff line number Diff line Loading @@ -156,14 +156,14 @@ public static function collectAllHookImplementations(array $module_filenames, ?C /** * Collects procedural and Attribute hook implementations. * * @param $dir * @param string $dir * The directory in which the module resides. * @param $module * @param string $module * The name of the module. * @param $module_preg * @param string $module_preg * A regular expression matching every module, longer module names are * matched first. * @param $skip_procedural * @param bool $skip_procedural * Skip the procedural check for the current module. */ protected function collectModuleHookImplementations($dir, $module, $module_preg, bool $skip_procedural): void { Loading Loading @@ -300,9 +300,9 @@ protected static function getHookAttributesInClass(string $class): array { * * @param \Drupal\Core\Hook\Attribute\Hook $hook * A hook attribute. * @param $class * @param string $class * The class in which said attribute resides in. * @param $module * @param string $module * The module in which the class resides in. */ protected function addFromAttribute(Hook $hook, $class, $module): void { Loading
core/lib/Drupal/Core/Utility/ProjectInfo.php +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public function getProjectName(Extension $file) { * @param array $info * Array of .info.yml file data as returned by * \Drupal\Core\Extension\InfoParser. * @param $additional_elements * @param array $additional_elements * (optional) Array of additional elements to be collected from the * .info.yml file. Defaults to []. * Loading