Skip to content

Commit cc59804

Browse files
committed
Update the method return values
1 parent 56f4ec4 commit cc59804

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Diff for: src/Assets/Asset.php

+2
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ public function add_to_group_path( string $group_path_name ) {
344344
* @param string $file The asset file path.
345345
* @param string|null $version The asset version.
346346
* @param string|null $root_path The path to the root of the plugin.
347+
*
348+
* @return self
347349
*/
348350
public static function add( string $slug, string $file, string $version = null, $root_path = null ) {
349351
return Assets::init()->add( new self( $slug, $file, $version, $root_path ) );

Diff for: src/Assets/Assets.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static function asset( string $slug, string $file, string $version = null
109109
*
110110
* @param Asset $asset Register an asset.
111111
*
112-
* @return Asset|false The registered object or false on error.
112+
* @return Asset|VendorAsset The registered object or false on error.
113113
* @since 1.0.0
114114
*
115115
*/
@@ -192,7 +192,7 @@ public function filter_print_before_after_script( $tag, $handle ): string {
192192
* @param string|array $slug Slug of the Asset.
193193
* @param boolean $sort If we should do any sorting before returning.
194194
*
195-
* @return array|Asset Array of asset objects, single asset object, or null if looking for a single asset but
195+
* @return array|Asset|VendorAsset Array of asset objects, single asset object, or null if looking for a single asset but
196196
* it was not in the array of objects.
197197
* @since 1.0.0
198198
*

Diff for: src/Assets/VendorAsset.php

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public function __construct( string $slug, string $url, string $type = 'js' ) {
5050
* @param string $url The asset file path.
5151
* @param ?string $type The asset type.
5252
* @param ?string $version The asset version.
53+
*
54+
* @return self
5355
*/
5456
public static function add( string $slug, string $url, ?string $type = null, $version = null ) {
5557
$instance = new self( $slug, $url, $type ?? 'js' );

0 commit comments

Comments
 (0)