Skip to content

Commit

Permalink
Fix trim warning in PHP 8 (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubdibala authored Feb 14, 2022
1 parent 4f14cb9 commit 5255e71
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Lavary/Menu/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,13 @@ protected function prefix($uri)
public static function formatGroupClass($new, $old)
{
if (isset($new['class']) and $new['class'] !== null) {
$classes = trim(trim(Arr::get($old, 'class')).' '.trim(Arr::get($new, 'class')));
$oldClass = Arr::get($old, 'class');

if ($oldClass !== null) {
$oldClass = trim($oldClass);
}

$classes = trim($oldClass.' '.trim(Arr::get($new, 'class')));

return implode(' ', array_unique(explode(' ', $classes)));
}
Expand Down

0 comments on commit 5255e71

Please sign in to comment.