Skip to content

Commit

Permalink
Update ShieldsIo.php
Browse files Browse the repository at this point in the history
  • Loading branch information
guibranco authored Aug 28, 2024
1 parent 8a380b6 commit fdd8858
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/ShieldsIo.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class ShieldsIo
{
private function encodeShieldsIoParameters($input)
{
if (empty($input)) {

Check warning

Code scanning / Phpcs (reported by Codacy)

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

Implicit true comparisons prohibited; use === TRUE instead
return $input;
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Whitespace found at end of line Warning

Whitespace found at end of line
$input = str_replace("_", "__", $input);
$input = str_replace(" ", "_", $input);
$input = str_replace("-", "--", $input);
Expand All @@ -19,30 +23,30 @@ public function generateBadgeUrl($label, $content, $color, $style, $labelColor,
{
$badge = array();

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

Check warning

Code scanning / Phpcs (reported by Codacy)

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

Implicit true comparisons prohibited; use === TRUE instead
$label = $this->encodeShieldsIoParameters($label);
$badge[] = $label;
}

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

Check warning

Code scanning / Phpcs (reported by Codacy)

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

Implicit true comparisons prohibited; use === TRUE instead
$content = $this->encodeShieldsIoParameters($content);
$badge[] = $content;
}

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

Check warning

Code scanning / Phpcs (reported by Codacy)

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

Implicit true comparisons prohibited; use === TRUE instead
$badge[] = $color;
}

$queryString = array();
if (isset($style) && !empty($style)) {
if (isset($style) && $style !== null) {

Check warning

Code scanning / Phpcs (reported by Codacy)

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

Implicit true comparisons prohibited; use === TRUE instead
$queryString["style"] = $style;
}

if (isset($labelColor) && !empty($labelColor)) {
if (isset($labelColor) && $labelColor !== null) {

Check warning

Code scanning / Phpcs (reported by Codacy)

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

Implicit true comparisons prohibited; use === TRUE instead
$queryString["labelColor"] = $labelColor;
}

if (isset($logo) && !empty($logo)) {
if (isset($logo) && $logo !== null) {

Check warning

Code scanning / Phpcs (reported by Codacy)

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

Implicit true comparisons prohibited; use === TRUE instead
$queryString["logo"] = $logo;
}

Expand Down

0 comments on commit fdd8858

Please sign in to comment.