Changeset 62733
- Timestamp:
- 07/14/2026 12:12:23 PM (3 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-hook.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-hook.php
r62408 r62733 15 15 * @see Iterator 16 16 * @see ArrayAccess 17 * 18 * @phpstan-type Hook_Callback array{ 19 * function: callable, 20 * accepted_args: int, 21 * } 22 * 23 * @phpstan-implements Iterator<int, array<string, Hook_Callback>> 24 * @phpstan-implements ArrayAccess<int, array<string, Hook_Callback>> 17 25 */ 18 26 #[AllowDynamicProperties] … … 20 28 21 29 /** 22 * Hook callbacks .30 * Hook callbacks keyed by priority. 23 31 * 24 32 * @since 4.7.0 25 33 * @var array 34 * @phpstan-var array<int, array<string, Hook_Callback>> 26 35 */ 27 36 public $callbacks = array(); … … 31 40 * 32 41 * @since 6.4.0 33 * @var array42 * @var list<int> 34 43 */ 35 44 protected $priorities = array(); … … 39 48 * 40 49 * @since 4.7.0 41 * @var array 50 * @var array<int, list<int>> 42 51 */ 43 52 private $iterations = array(); … … 47 56 * 48 57 * @since 4.7.0 49 * @var array 58 * @var array<int, int> 50 59 */ 51 60 private $current_priority = array(); … … 440 449 * 441 450 * @param array $filters Filters to normalize. See documentation above for details. 442 * @return WP_Hook[] Array of normalized filters. 451 * @phpstan-param array<string, WP_Hook|array<int, array<Hook_Callback>>> $filters 452 * @return array<string, WP_Hook> Array of normalized filters keyed by hook name. 443 453 */ 444 454 public static function build_preinitialized_hooks( $filters ) { 445 /** @var WP_Hook[]$normalized */455 /** @var array<string, WP_Hook> $normalized */ 446 456 $normalized = array(); 447 457 … … 476 486 * @link https://www.php.net/manual/en/arrayaccess.offsetexists.php 477 487 * 478 * @param mixed$offset An offset to check for.488 * @param int $offset An offset to check for. 479 489 * @return bool True if the offset exists, false otherwise. 480 490 */ … … 491 501 * @link https://www.php.net/manual/en/arrayaccess.offsetget.php 492 502 * 493 * @param mixed $offset The offset to retrieve. 494 * @return mixed If set, the value at the specified offset, null otherwise. 503 * @param int $offset The offset to retrieve. 504 * @return array|null If set, the value at the specified offset, null otherwise. 505 * @phpstan-return array<string, Hook_Callback>|null 495 506 */ 496 507 #[ReturnTypeWillChange] … … 506 517 * @link https://www.php.net/manual/en/arrayaccess.offsetset.php 507 518 * 508 * @param mixed $offset The offset to assign the value to. 509 * @param mixed $value The value to set. 519 * @param int|null $offset The offset to assign the value to. 520 * @param array $value The value to set. 521 * @phpstan-param array<string, Hook_Callback> $value 510 522 */ 511 523 #[ReturnTypeWillChange] … … 527 539 * @link https://www.php.net/manual/en/arrayaccess.offsetunset.php 528 540 * 529 * @param mixed$offset The offset to unset.541 * @param int $offset The offset to unset. 530 542 */ 531 543 #[ReturnTypeWillChange] … … 542 554 * @link https://www.php.net/manual/en/iterator.current.php 543 555 * 544 * @return array Of callbacks at current priority. 556 * @return array|false Array of callbacks at current priority, false if there are no more elements. 557 * @phpstan-return array<string, Hook_Callback>|false 545 558 */ 546 559 #[ReturnTypeWillChange] … … 556 569 * @link https://www.php.net/manual/en/iterator.next.php 557 570 * 558 * @return array Of callbacks at next priority. 571 * @return array|false Array of callbacks at next priority, false if there are no more elements. 572 * @phpstan-return array<string, Hook_Callback>|false 559 573 */ 560 574 #[ReturnTypeWillChange] … … 570 584 * @link https://www.php.net/manual/en/iterator.key.php 571 585 * 572 * @return mixedReturns current priority on success, or NULL on failure586 * @return int|null Returns current priority on success, or NULL on failure 573 587 */ 574 588 #[ReturnTypeWillChange]
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)