Skip to content

Commit

Permalink
Fix static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Dec 17, 2024
1 parent b00e052 commit 2c1a2c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Assets/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
use InvalidArgumentException;
use RuntimeException;

/**
* @method self print_assets()
* @method self enqueue_asset()
* @method self register_asset( string $url, array $dependencies = [], string $version = null, mixed $in_footer_or_media )
* @method self dequeue_asset()
* @method self deregister_asset()
*/
class Asset {
/**
* @var array The asset action.
Expand Down
8 changes: 7 additions & 1 deletion src/Assets/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,13 @@ public function remove( $slug ) {
return false;
}

$this->get( $slug )->dequeue_asset()->deregister_asset();
$asset = $this->get( $slug );

if ( ! $asset instanceof Asset ) {
return true;
}

$asset->dequeue_asset()->deregister_asset();

unset( $this->assets[ $slug ] );

Expand Down

0 comments on commit 2c1a2c5

Please sign in to comment.