[HttpFoundation] Removed useless else
This commit is contained in:
parent
03f91ff1e0
commit
fc42cc5066
@ -519,9 +519,9 @@ class File
|
||||
{
|
||||
if ($ext = pathinfo($this->getName(), \PATHINFO_EXTENSION)) {
|
||||
return '.' . $ext;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -537,9 +537,9 @@ class File
|
||||
|
||||
if (isset(self::$defaultExtensions[$type])) {
|
||||
return '.' . self::$defaultExtensions[$type];
|
||||
} else {
|
||||
return $this->getExtension();
|
||||
}
|
||||
|
||||
return $this->getExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,16 +96,16 @@ class HeaderBag
|
||||
if (!array_key_exists($key, $this->headers)) {
|
||||
if (null === $default) {
|
||||
return $first ? null : array();
|
||||
} else {
|
||||
return $first ? $default : array($default);
|
||||
}
|
||||
|
||||
return $first ? $default : array($default);
|
||||
}
|
||||
|
||||
if ($first) {
|
||||
return count($this->headers[$key]) ? $this->headers[$key][0] : $default;
|
||||
} else {
|
||||
return $this->headers[$key];
|
||||
}
|
||||
|
||||
return $this->headers[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -436,9 +436,9 @@ class Request
|
||||
|
||||
if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) {
|
||||
return $name;
|
||||
} else {
|
||||
return $name.':'.$port;
|
||||
}
|
||||
|
||||
return $name.':'.$port;
|
||||
}
|
||||
|
||||
public function getRequestUri()
|
||||
|
@ -171,7 +171,8 @@ class PdoSessionStorage extends NativeSessionStorage
|
||||
|
||||
if (count($sessionRows) == 1) {
|
||||
return $sessionRows[0][0];
|
||||
} else {
|
||||
}
|
||||
|
||||
// session does not exist, create it
|
||||
$sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)';
|
||||
|
||||
@ -182,7 +183,6 @@ class PdoSessionStorage extends NativeSessionStorage
|
||||
$stmt->execute();
|
||||
|
||||
return '';
|
||||
}
|
||||
} catch (\PDOException $e) {
|
||||
throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user