Skip to content

Commit

Permalink
refactor: use strict comparisons everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
adevade authored and luqven committed Jan 30, 2023
1 parent 93f7414 commit 9a60aa6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/UrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function targetWidths(
$stop=self::MAX_WIDTH,
$tol=self::SRCSET_WIDTH_TOLERANCE) {

if ($start == $stop) {
if ($start === $stop) {
return array((int) $start);
}

Expand Down
2 changes: 1 addition & 1 deletion src/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getURL() {
ksort($this->params);

foreach ($this->params as $key => $val) {
if (substr($key, -2) == '64') {
if (substr($key, -2) === '64') {
$encodedVal = self::base64url_encode($val);
} else {
$encodedVal = is_array($val) ? rawurlencode(implode(',',$val)) : rawurlencode($val);
Expand Down
2 changes: 1 addition & 1 deletion src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function validateWidths($widths) {
throw new \InvalidArgumentException("`widths` array cannot be `null`");
}

if (count($widths) == 0) {
if (count($widths) === 0) {
throw new \InvalidArgumentException("`widths` array cannot be empty");
}
foreach ($widths as &$w) {
Expand Down

0 comments on commit 9a60aa6

Please sign in to comment.