Skip to content

Commit

Permalink
Update php/WP_Mock/Hook.php
Browse files Browse the repository at this point in the history
chore: ensure only strings are returned

Co-authored-by: Nabeel Molham <[email protected]>
  • Loading branch information
badasswp and nmolham-godaddy authored Feb 3, 2025
1 parent c2d06d1 commit 4f2a401
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/WP_Mock/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ protected function safe_offset($value): string
if (! $value instanceof Type) {
$class = get_class($value);

if (isset(static::$objects[ $class ])) {
return static::$objects[ $class ];
if (isset(static::$objects[$class]) && is_string(static::$objects[$class])) {
return static::$objects[$class];
}
}

Expand Down

0 comments on commit 4f2a401

Please sign in to comment.