Skip to content

Commit fd37e37

Browse files
committed
Increase WP_Dependencies and related classes to PHPStan level 8
1 parent 2d2911d commit fd37e37

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/wp-includes/class-wp-dependencies.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class WP_Dependencies {
6060
*
6161
* @since 2.6.0
6262
*
63-
* @var array
63+
* @var array<string, string>
6464
*/
6565
public $args = array();
6666

@@ -100,7 +100,7 @@ class WP_Dependencies {
100100
*
101101
* @since 5.9.0
102102
*
103-
* @var array
103+
* @var array<string, string|null>
104104
*/
105105
private $queued_before_register = array();
106106

src/wp-includes/class-wp-dependency.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class _WP_Dependency {
6666
* Extra data to supply to the handle.
6767
*
6868
* @since 2.6.0
69-
* @var array
69+
* @var array<string, mixed>
7070
*/
7171
public $extra = array();
7272

@@ -82,7 +82,7 @@ class _WP_Dependency {
8282
* Translation path set for this dependency.
8383
*
8484
* @since 5.0.0
85-
* @var string
85+
* @var string|null
8686
*/
8787
public $translations_path;
8888

src/wp-includes/class-wp-scripts.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class WP_Scripts extends WP_Dependencies {
4646
* Holds handles of scripts which are enqueued in footer.
4747
*
4848
* @since 2.8.0
49-
* @var array
49+
* @var string[]
5050
*/
5151
public $in_footer = array();
5252

@@ -118,7 +118,7 @@ class WP_Scripts extends WP_Dependencies {
118118
* List of default directories.
119119
*
120120
* @since 2.8.0
121-
* @var array
121+
* @var string[]
122122
*/
123123
public $default_dirs;
124124

@@ -589,9 +589,9 @@ public function get_inline_script_tag( $handle, $position = 'after' ) {
589589
*
590590
* @since 2.1.0
591591
*
592-
* @param string $handle Name of the script to attach data to.
593-
* @param string $object_name Name of the variable that will contain the data.
594-
* @param array $l10n Array of data to localize.
592+
* @param string $handle Name of the script to attach data to.
593+
* @param string $object_name Name of the variable that will contain the data.
594+
* @param array<string, mixed> $l10n Array of data to localize.
595595
* @return bool True on success, false on failure.
596596
*/
597597
public function localize( $handle, $object_name, $l10n ) {

src/wp-includes/class-wp-styles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class WP_Styles extends WP_Dependencies {
9696
* List of default directories.
9797
*
9898
* @since 2.8.0
99-
* @var array
99+
* @var string[]
100100
*/
101101
public $default_dirs;
102102

@@ -183,7 +183,7 @@ public function do_item( $handle, $group = false ) {
183183
}
184184

185185
if ( $this->do_concat ) {
186-
if ( $this->in_default_dir( $src ) && ! isset( $obj->extra['alt'] ) ) {
186+
if ( $src && $this->in_default_dir( $src ) && ! isset( $obj->extra['alt'] ) ) {
187187
$this->concat .= "$handle,";
188188
$this->concat_version .= "$handle$ver";
189189

0 commit comments

Comments
 (0)