@@ -18,23 +18,23 @@ class WP_Script_Modules {
1818 * Holds the registered script modules, keyed by script module identifier.
1919 *
2020 * @since 6.5.0
21- * @var array<non-empty- string, array<non-empty- string, mixed>>
21+ * @var array<string, array<string, mixed>>
2222 */
2323 private $ registered = array ();
2424
2525 /**
2626 * An array of IDs for queued script modules.
2727 *
2828 * @since 6.9.0
29- * @var non-empty- string[]
29+ * @var string[]
3030 */
3131 private $ queue = array ();
3232
3333 /**
3434 * Holds the script module identifiers that have been printed.
3535 *
3636 * @since 6.9.0
37- * @var non-empty- string[]
37+ * @var string[]
3838 */
3939 private $ done = array ();
4040
@@ -54,15 +54,15 @@ class WP_Script_Modules {
5454 * Used to optimize recursive dependency tree checks.
5555 *
5656 * @since 6.9.0
57- * @var array<non-empty- string, non-empty- string[]>
57+ * @var array<string, string[]>
5858 */
5959 private $ dependents_map = array ();
6060
6161 /**
6262 * Holds the valid values for fetchpriority.
6363 *
6464 * @since 6.9.0
65- * @var non-empty- string[]
65+ * @var string[]
6666 */
6767 private $ priorities = array (
6868 'low ' ,
@@ -77,7 +77,7 @@ class WP_Script_Modules {
7777 * @since 6.5.0
7878 * @since 6.9.0 Added the $args parameter.
7979 *
80- * @param non-empty- string $id The identifier of the script module. Should be unique. It will be used in the
80+ * @param string $id The identifier of the script module. Should be unique. It will be used in the
8181 * final import map.
8282 * @param string $src Optional. Full URL of the script module, or path of the script module relative
8383 * to the WordPress root directory. If it is provided and the script module has
@@ -171,7 +171,7 @@ public function register( string $id, string $src, array $deps = array(), $versi
171171 *
172172 * @since 6.9.0
173173 *
174- * @return non-empty- string[] Script module IDs.
174+ * @return string[] Script module IDs.
175175 */
176176 public function get_queue (): array {
177177 return $ this ->queue ;
@@ -194,7 +194,7 @@ private function is_valid_fetchpriority( $priority ): bool {
194194 *
195195 * @since 6.9.0
196196 *
197- * @param non-empty- string $id Script module identifier.
197+ * @param string $id Script module identifier.
198198 * @param 'auto'|'low'|'high' $priority Fetch priority for the script module.
199199 * @return bool Whether setting the fetchpriority was successful.
200200 */
@@ -226,7 +226,7 @@ public function set_fetchpriority( string $id, string $priority ): bool {
226226 *
227227 * @since 6.9.0
228228 *
229- * @param non-empty- string $id Script module identifier.
229+ * @param string $id Script module identifier.
230230 * @param bool $in_footer Whether to print in the footer.
231231 * @return bool Whether setting the printing location was successful.
232232 */
@@ -247,7 +247,7 @@ public function set_in_footer( string $id, bool $in_footer ): bool {
247247 * @since 6.5.0
248248 * @since 6.9.0 Added the $args parameter.
249249 *
250- * @param non-empty- string $id The identifier of the script module. Should be unique. It will be used in the
250+ * @param string $id The identifier of the script module. Should be unique. It will be used in the
251251 * final import map.
252252 * @param string $src Optional. Full URL of the script module, or path of the script module relative
253253 * to the WordPress root directory. If it is provided and the script module has
@@ -297,7 +297,7 @@ public function enqueue( string $id, string $src = '', array $deps = array(), $v
297297 *
298298 * @since 6.5.0
299299 *
300- * @param non-empty- string $id The identifier of the script module.
300+ * @param string $id The identifier of the script module.
301301 */
302302 public function dequeue ( string $ id ) {
303303 $ this ->queue = array_values ( array_diff ( $ this ->queue , array ( $ id ) ) );
@@ -308,7 +308,7 @@ public function dequeue( string $id ) {
308308 *
309309 * @since 6.5.0
310310 *
311- * @param non-empty- string $id The identifier of the script module.
311+ * @param string $id The identifier of the script module.
312312 */
313313 public function deregister ( string $ id ) {
314314 $ this ->dequeue ( $ id );
@@ -355,7 +355,7 @@ public function add_hooks() {
355355 *
356356 * @since 6.9.0
357357 *
358- * @param non-empty- string[] $ids Script module IDs.
358+ * @param string[] $ids Script module IDs.
359359 * @return 'auto'|'low'|'high' Highest fetch priority for the provided script module IDs.
360360 */
361361 private function get_highest_fetchpriority ( array $ ids ): string {
@@ -424,7 +424,7 @@ public function print_enqueued_script_modules() {
424424 *
425425 * @since 6.9.0
426426 *
427- * @param non-empty- string $id The script module identifier.
427+ * @param string $id The script module identifier.
428428 */
429429 private function print_script_module ( string $ id ) {
430430 if ( in_array ( $ id , $ this ->done , true ) || ! in_array ( $ id , $ this ->queue , true ) ) {
@@ -540,10 +540,10 @@ private function get_import_map(): array {
540540 *
541541 * @since 6.5.0
542542 *
543- * @param non-empty- string[] $ids The identifiers of the script modules for which to gather dependencies.
544- * @param non-empty- string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
543+ * @param string[] $ids The identifiers of the script modules for which to gather dependencies.
544+ * @param string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
545545 * Default is both.
546- * @return non-empty- string[] List of IDs for script module dependencies.
546+ * @return string[] List of IDs for script module dependencies.
547547 */
548548 private function get_dependencies ( array $ ids , array $ import_types = array ( 'static ' , 'dynamic ' ) ): array {
549549 $ all_dependencies = array ();
@@ -581,8 +581,8 @@ private function get_dependencies( array $ids, array $import_types = array( 'sta
581581 *
582582 * @see WP_Scripts::get_dependents()
583583 *
584- * @param non-empty- string $id The script ID.
585- * @return non-empty- string[] Script module IDs.
584+ * @param string $id The script ID.
585+ * @return string[] Script module IDs.
586586 */
587587 private function get_dependents ( string $ id ): array {
588588 // Check if dependents map for the handle in question is present. If so, use it.
@@ -612,8 +612,8 @@ private function get_dependents( string $id ): array {
612612 *
613613 * @see WP_Scripts::get_dependents()
614614 *
615- * @param non-empty- string $id The script ID.
616- * @return non-empty- string[] Script module IDs.
615+ * @param string $id The script ID.
616+ * @return string[] Script module IDs.
617617 */
618618 private function get_recursive_dependents ( string $ id ): array {
619619 $ dependents = array ();
@@ -655,10 +655,10 @@ private function get_recursive_dependents( string $id ): array {
655655 *
656656 * @since 6.9.0
657657 *
658- * @param non-empty- string[] $ids The identifiers of the script modules to sort.
659- * @param non-empty- string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
658+ * @param string[] $ids The identifiers of the script modules to sort.
659+ * @param string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
660660 * Default is both.
661- * @return non-empty- string[] Sorted list of script module identifiers.
661+ * @return string[] Sorted list of script module identifiers.
662662 */
663663 private function get_sorted_dependencies ( array $ ids , array $ import_types = array ( 'static ' , 'dynamic ' ) ): array {
664664 $ sorted = array ();
@@ -675,9 +675,9 @@ private function get_sorted_dependencies( array $ids, array $import_types = arra
675675 *
676676 * @since 6.9.0
677677 *
678- * @param non-empty- string $id The identifier of the script module to sort.
679- * @param non-empty- string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
680- * @param non-empty- string[] &$sorted The array of sorted identifiers, passed by reference.
678+ * @param string $id The identifier of the script module to sort.
679+ * @param string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
680+ * @param string[] &$sorted The array of sorted identifiers, passed by reference.
681681 * @return bool True on success, false on failure (e.g., missing dependency).
682682 */
683683 private function sort_item_dependencies ( string $ id , array $ import_types , array &$ sorted ): bool {
@@ -726,7 +726,7 @@ private function sort_item_dependencies( string $id, array $import_types, array
726726 *
727727 * @since 6.5.0
728728 *
729- * @param non-empty- string $id The script module identifier.
729+ * @param string $id The script module identifier.
730730 * @return string The script module src with a version if relevant.
731731 */
732732 private function get_src ( string $ id ): string {
0 commit comments