Skip to content

Commit 9d261de

Browse files
committed
fix: fix sonarcloud issues
1 parent 9944826 commit 9d261de

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Html/HtmlBuilder.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function attributes(array $attributes): string
8989
}
9090
}
9191

92-
return count($html) > 0 ? ' '.implode(' ', $html) : '';
92+
return ! empty($html) ? ' '.implode(' ', $html) : '';
9393
}
9494

9595
/**
@@ -226,7 +226,9 @@ public function link(
226226
$title = $this->entities($title);
227227
}
228228

229-
return $this->toHtmlString('<a href="'.$this->entities($url).'"'.$this->attributes($attributes).'>'.$title.'</a>');
229+
return $this->toHtmlString(
230+
'<a href="'.$this->entities($url).'"'.$this->attributes($attributes).'>'.$title.'</a>'
231+
);
230232
}
231233

232234
/**
@@ -430,7 +432,7 @@ protected function listing(string $type, array $list, array $attributes = []): H
430432
{
431433
$html = '';
432434

433-
if (count($list) === 0) {
435+
if (empty($list)) {
434436
return $html;
435437
}
436438

@@ -520,7 +522,7 @@ public function dl(array $list, array $attributes = []): HtmlString
520522

521523
$html .= "<dt>$key</dt>";
522524

523-
foreach ($value as $v_key => $v_value) {
525+
foreach ($value as $v_value) {
524526
$html .= "<dd>$v_value</dd>";
525527
}
526528
}

0 commit comments

Comments
 (0)