Skip to content

Commit

Permalink
Laravel - fixed possible PHP 8.1 deprecation warning when collecting …
Browse files Browse the repository at this point in the history
…database queries.
  • Loading branch information
itsgoingd committed Dec 24, 2021
1 parent b5ffb5f commit df3a7c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Clockwork/DataSource/EloquentDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ protected function createRunnableQuery($query, $bindings, $connection)
$binding = $this->quoteBinding($bindings[$index++], $connection);

// convert binary bindings to hexadecimal representation
if (! preg_match('//u', $binding)) $binding = '0x' . bin2hex($binding);
if (! preg_match('//u', (string) $binding)) $binding = '0x' . bin2hex($binding);

// escape backslashes in the binding (preg_replace requires to do so)
return str_replace('\\', '\\\\', $binding);
return str_replace('\\', '\\\\', (string) $binding);
}, $query, count($bindings));

// highlight keywords
Expand Down

0 comments on commit df3a7c1

Please sign in to comment.