Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Jun 13, 2024
1 parent fce09b2 commit 91852d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Assets/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public static function get_relative_asset_path(): string {
*/
public static function get_url( $path ): string {
$key = Utils::get_runtime_cache_key();

if ( empty( static::$path_urls[ $path ] ) ) {
static::$path_urls[ $path ] = [];
}

if ( empty( static::$path_urls[ $path ][ $key ] ) ) {

Check failure on line 79 in src/Assets/Config.php

View workflow job for this annotation

GitHub Actions / phpstan

Offset string on array{}|non-falsy-string in empty() does not exist.
$bases = Utils::get_bases();
static::$path_urls[ $path ][ $key ] = trailingslashit( str_replace( wp_list_pluck( $bases, 'base_dir' ), wp_list_pluck( $bases, 'base_url' ), $path ) );
Expand Down

0 comments on commit 91852d9

Please sign in to comment.