[HttpFoundation] Removed useless else

This commit is contained in:
Pascal Borreli 2011-02-27 18:28:11 +01:00
parent 03f91ff1e0
commit fc42cc5066
4 changed files with 21 additions and 21 deletions

View File

@ -519,9 +519,9 @@ class File
{ {
if ($ext = pathinfo($this->getName(), \PATHINFO_EXTENSION)) { if ($ext = pathinfo($this->getName(), \PATHINFO_EXTENSION)) {
return '.' . $ext; return '.' . $ext;
} else {
return '';
} }
return '';
} }
/** /**
@ -537,9 +537,9 @@ class File
if (isset(self::$defaultExtensions[$type])) { if (isset(self::$defaultExtensions[$type])) {
return '.' . self::$defaultExtensions[$type]; return '.' . self::$defaultExtensions[$type];
} else {
return $this->getExtension();
} }
return $this->getExtension();
} }
/** /**

View File

@ -96,16 +96,16 @@ class HeaderBag
if (!array_key_exists($key, $this->headers)) { if (!array_key_exists($key, $this->headers)) {
if (null === $default) { if (null === $default) {
return $first ? null : array(); return $first ? null : array();
} else {
return $first ? $default : array($default);
} }
return $first ? $default : array($default);
} }
if ($first) { if ($first) {
return count($this->headers[$key]) ? $this->headers[$key][0] : $default; return count($this->headers[$key]) ? $this->headers[$key][0] : $default;
} else {
return $this->headers[$key];
} }
return $this->headers[$key];
} }
/** /**

View File

@ -436,9 +436,9 @@ class Request
if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) { if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) {
return $name; return $name;
} else {
return $name.':'.$port;
} }
return $name.':'.$port;
} }
public function getRequestUri() public function getRequestUri()

View File

@ -171,7 +171,8 @@ class PdoSessionStorage extends NativeSessionStorage
if (count($sessionRows) == 1) { if (count($sessionRows) == 1) {
return $sessionRows[0][0]; return $sessionRows[0][0];
} else { }
// session does not exist, create it // session does not exist, create it
$sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)'; $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(); $stmt->execute();
return ''; return '';
}
} catch (\PDOException $e) { } catch (\PDOException $e) {
throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e); throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e);
} }