Skip to content

Commit

Permalink
Fixing types
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed Dec 30, 2024
1 parent 8caf8d8 commit 487ca32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function am_modify_load_method( string $handle, string $load_method = 'sync' ):
* @param string $load_hook Hook on which to load this asset.
* @param string $media Media query to restrict when this asset is loaded.
*/
function am_enqueue_style( string $handle, ?string $src = null, array $deps = [], array|string $condition = 'global', string $load_method = 'sync', string $version = '1.0.0', string $load_hook = 'wp_head', ?string $media = null ): void {
function am_enqueue_style( array|string $handle, ?string $src = null, array $deps = [], array|string $condition = 'global', string $load_method = 'sync', string $version = '1.0.0', string $load_hook = 'wp_head', ?string $media = null ): void {
$defaults = compact( 'handle', 'src', 'deps', 'condition', 'load_method', 'version', 'load_hook', 'media' );
$args = is_array( $handle ) ? array_merge( $defaults, $handle ) : $defaults;

Expand Down Expand Up @@ -148,7 +148,7 @@ function am_enqueue_style( string $handle, ?string $src = null, array $deps = []
* @param boolean $crossorigin Preload this asset cross-origin.
* @param string $mime_type The MIME type for the preloaded asset.
*/
function am_preload( string $handle, ?string $src = null, array|string $condition = 'global', string $version = '1.0.0', string $media = 'all', ?string $as = null, bool $crossorigin = false, ?string $mime_type = null ): void {
function am_preload( array|string $handle, ?string $src = null, array|string $condition = 'global', string $version = '1.0.0', string $media = 'all', ?string $as = null, bool $crossorigin = false, ?string $mime_type = null ): void {
$defaults = compact( 'handle', 'src', 'condition', 'version', 'media', 'as', 'crossorigin', 'mime_type' );
$args = is_array( $handle ) ? array_merge( $defaults, $handle ) : $defaults;
Preload::instance()->add_asset( $args );
Expand Down Expand Up @@ -179,7 +179,7 @@ function am_preload( string $handle, ?string $src = null, array|string $conditio
* @param array $attributes An array of attribute names and values to add to the resulting <svg>
* everywhere it is printed.
*/
function am_register_symbol( string $handle, ?string $src = null, array|string $condition = 'global', array $attributes = [] ): void {
function am_register_symbol( array|string $handle, ?string $src = null, array|string $condition = 'global', array $attributes = [] ): void {
$defaults = compact( 'handle', 'src', 'condition', 'attributes' );
$args = is_array( $handle ) ? array_merge( $defaults, $handle ) : $defaults;
SVG_Sprite::instance()->add_asset( $args );
Expand Down

0 comments on commit 487ca32

Please sign in to comment.