Skip to content

Commit

Permalink
[phpcs] typo fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Dec 17, 2023
1 parent 8adcec8 commit be2b546
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/cache/sfAPCCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function has($key)
* @see sfCache
*
* @param mixed|null $lifetime
*
* @return bool|array
*/
public function set($key, $data, $lifetime = null)
Expand Down
4 changes: 2 additions & 2 deletions lib/cache/sfFileCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function get($key, $default = null)

$rawData = $data[self::READ_DATA];

if ($rawData === 'FaLSe') {
if ('FaLSe' === $rawData) {
$rawData = false;
}

Expand Down Expand Up @@ -93,7 +93,7 @@ public function set($key, $data, $lifetime = null)
$this->clean(sfCache::OLD);
}

if ($data === false) {
if (false === $data) {
$data = 'FaLSe';
}

Expand Down
4 changes: 2 additions & 2 deletions lib/cache/sfSQLiteCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function get($key, $default = null)
$data = $this->dbh->singleQuery(sprintf("SELECT data FROM cache WHERE key = '%s' AND timeout > %d", sqlite_escape_string($key), time()));
}

if ($data === 'FaLSe') {
if ('FaLSe' === $data) {
$data = false;
}

Expand Down Expand Up @@ -102,7 +102,7 @@ public function set($key, $data, $lifetime = null)
$this->clean(sfCache::OLD);
}

if ($data === false) {
if (false === $data) {
$data = 'FaLSe';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/validator/sfValidatorDate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected function doClean($value)

$format = $this->getOption('with_time') ? $this->getOption('datetime_output') : $this->getOption('date_output');

if ($format === 'U') {
if ('U' === $format) {
return isset($date) ? (int) $date->format($format) : (int) date($format, $cleanTime);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/validator/sfValidatorError.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function getArguments($raw = false)
continue;
}

$arguments["%{$key}%"] = $value !== null ? htmlspecialchars($value, ENT_QUOTES, sfValidatorBase::getCharset()) : '';
$arguments["%{$key}%"] = null !== $value ? htmlspecialchars($value, ENT_QUOTES, sfValidatorBase::getCharset()) : '';
}

return $arguments;
Expand Down
2 changes: 1 addition & 1 deletion lib/validator/sfValidatorString.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function configure($options = array(), $messages = array())
*/
protected function doClean($value)
{
if ($value === null) {
if (null === $value) {
return $value;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/validator/sfValidatorTime.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function doClean($value)
$formattedClean = date($this->getOption('time_output'), $clean);

// don't change integer type
if ($this->getOption('time_output') === 'U') {
if ('U' === $this->getOption('time_output')) {
settype($formattedClean, 'integer');
}

Expand Down

0 comments on commit be2b546

Please sign in to comment.