Skip to content

Commit

Permalink
Fix deprecation error messages on PHP 8.1 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar authored Feb 13, 2022
1 parent eb30772 commit 13beb19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BlockManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected function replaceThemeFromLanguage($classes)
{
$pattern = '/(language-(?:.+?)):([:\w-]+)/';

preg_match($pattern, $classes, $matches);
preg_match($pattern, $classes ?? '', $matches);

if (count($matches) === 3) {
$classes = str_replace($matches[0], $matches[1], $classes);
Expand All @@ -225,7 +225,7 @@ protected function filesWithBlocks()
// Recursively look for any blocks in the output
// directory, returning only the paths.
$output = explode(
"\n", trim(shell_exec("grep -l -r __torchlight-block- {$this->jigsaw->getDestinationPath()}/*"))
"\n", trim(shell_exec("grep -l -r __torchlight-block- {$this->jigsaw->getDestinationPath()}/*") ?? '')
);

// Filter out empty values caused by our grep query.
Expand Down

0 comments on commit 13beb19

Please sign in to comment.