Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Assets
* Description: Asset library with a plugin bootstrap file for automated testing.
* Version: 1.5.1
* Version: 1.5.2
* Author: StellarWP
* Author URI: https://stellarwp.com
*/
10 changes: 8 additions & 2 deletions src/Assets/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,15 @@ class Asset {
/**
* Constructor.
*
* @since 1.0.0
* @since 1.5.2 Added nullable type hints for the version and root path parameters.
*
* @param string $slug The asset slug.
* @param string $file The asset file path.
* @param string|null $version The asset version.
* @param string|null $root_path The path to the root of the plugin.
*/
public function __construct( string $slug, string $file, string $version = null, string $root_path = null ) {
public function __construct( string $slug, string $file, ?string $version = null, ?string $root_path = null ) {
$this->slug = sanitize_key( $slug );
$this->file = $file;
$this->version = $version ?? Config::get_version();
Expand Down Expand Up @@ -340,12 +343,15 @@ public function add_to_group_path( string $group_path_name ) {
/**
* Registers an asset.
*
* @since 1.0.0
* @since 1.5.2 Added nullable type hints for the version and root path parameters.
*
* @param string $slug The asset slug.
* @param string $file The asset file path.
* @param string|null $version The asset version.
* @param string|null $root_path The path to the root of the plugin.
*/
public static function add( string $slug, string $file, string $version = null, $root_path = null ) {
public static function add( string $slug, string $file, ?string $version = null, ?string $root_path = null ) {
return Assets::init()->add( new self( $slug, $file, $version, $root_path ) );
}

Expand Down
Loading