Skip to content
Permalink
Browse files

Fix incorrect use of empty().

These are all places where '0' is a valid value that we were previously
mis-handling.

Refs #7329
  • Loading branch information...
markstory committed Aug 31, 2015
1 parent bbe5357 commit e54ef60ab15f9b797b13f0d6c7a06c6a2299a508
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/Cache/Cache.php
  2. +1 −1 src/Console/ConsoleInput.php
  3. +1 −1 src/Console/ConsoleInputOption.php
@@ -252,7 +252,7 @@ public static function writeMany($data, $config = 'default')
$engine = static::engine($config);
$return = $engine->writeMany($data);
foreach ($return as $key => $success) {
if ($success === false && !empty($data[$key])) {
if ($success === false && $data[$key] !== '') {
throw new RuntimeException(sprintf(
'%s cache was unable to write \'%s\' to %s cache',
$config,
@@ -59,7 +59,7 @@ public function read()
{
if ($this->_canReadline) {
$line = readline('');
if (!empty($line)) {
if (strlen($line) > 0) {
readline_add_history($line);
}
return $line;
@@ -153,7 +153,7 @@ public function usage()
{
$name = (strlen($this->_short) > 0) ? ('-' . $this->_short) : ('--' . $this->_name);
$default = '';
if (!empty($this->_default) && $this->_default !== true) {
if (strlen($this->_default) > 0 && $this->_default !== true) {
$default = ' ' . $this->_default;
}
if (!empty($this->_choices)) {

0 comments on commit e54ef60

Please sign in to comment.
You can’t perform that action at this time.