Skip to content

Commit 8374ccb

Browse files
committed
Match parameter type to parent and cast to string if not null
1 parent b02993c commit 8374ccb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/Assets/VendorAsset.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public function __construct( string $slug, string $url, string $type = 'js' ) {
5151
* @param ?string $type The asset type.
5252
* @param ?string $version The asset version.
5353
*/
54-
public static function add( string $slug, string $url, ?string $type = null, ?string $version = null ) {
54+
public static function add( string $slug, string $url, ?string $type = null, $version = null ) {
5555
$instance = new self( $slug, $url, $type ?? 'js' );
5656

5757
if ( null !== $version ) {
58-
$instance->set_version( $version );
58+
$instance->set_version( (string) $version );
5959
}
6060

6161
return Assets::init()->add( $instance );

0 commit comments

Comments
 (0)