Skip to content

Commit

Permalink
qa: use is_object over isset
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
  • Loading branch information
boesing committed Mar 2, 2024
1 parent 5f31f26 commit c0b95a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Pattern/CallbackCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ protected function generateCallbackKey(callable $callback, array $args): string
// functions, methods and classnames are case-insensitive
$callbackKey = strtolower($callbackKey);

$object = null;

// generate a unique key of object callbacks
if (is_object($callback)) {
// Closures & __invoke
Expand All @@ -126,7 +128,8 @@ protected function generateCallbackKey(callable $callback, array $args): string
// array($object, 'method')
$object = $callback[0];
}
if (isset($object)) {

if (is_object($object)) {
try {
$serializedObject = serialize($object);
} catch (Throwable $throwable) {
Expand Down

0 comments on commit c0b95a1

Please sign in to comment.