Skip to content

Commit

Permalink
Fix optional parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
guibranco committed Jul 22, 2024
1 parent 67e22c0 commit 2b4e497
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ShieldsIo.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ public function generateBadgeUrl($label, $content, $color, $style, $labelColor,

if (isset($label) && !empty($label)) {

Check warning

Code scanning / Phpcs (reported by Codacy)

Implicit true comparisons prohibited; use === TRUE instead Warning

Implicit true comparisons prohibited; use === TRUE instead

Check warning

Code scanning / Phpcs (reported by Codacy)

Operator ! prohibited; use === FALSE instead Warning

Operator ! prohibited; use === FALSE instead
$label = $this->encodeShieldsIoParameters($label);
$badge .= $label . "-";
$badge .= $label;

if (isset($content) || isset($color)) {

Check warning

Code scanning / Phpcs (reported by Codacy)

Implicit true comparisons prohibited; use === TRUE instead Warning

Implicit true comparisons prohibited; use === TRUE instead
$badge .= "-";
}
}

if (isset($content) && !empty($content)) {

Check warning

Code scanning / Phpcs (reported by Codacy)

Implicit true comparisons prohibited; use === TRUE instead Warning

Implicit true comparisons prohibited; use === TRUE instead

Check warning

Code scanning / Phpcs (reported by Codacy)

Operator ! prohibited; use === FALSE instead Warning

Operator ! prohibited; use === FALSE instead
$content = $this->encodeShieldsIoParameters($content);
$badge .= $content . "-";
$badge .= $content;

Check warning

Code scanning / Phpcs (reported by Codacy)

Whitespace found at end of line Warning

Whitespace found at end of line
if (isset($color)) {

Check warning

Code scanning / Phpcs (reported by Codacy)

Implicit true comparisons prohibited; use === TRUE instead Warning

Implicit true comparisons prohibited; use === TRUE instead
$badge .= "-";
}
}

if (isset($color) && !empty($color)) {

Check warning

Code scanning / Phpcs (reported by Codacy)

Implicit true comparisons prohibited; use === TRUE instead Warning

Implicit true comparisons prohibited; use === TRUE instead

Check warning

Code scanning / Phpcs (reported by Codacy)

Operator ! prohibited; use === FALSE instead Warning

Operator ! prohibited; use === FALSE instead
Expand Down

0 comments on commit 2b4e497

Please sign in to comment.