[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)) {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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()
|
||||||
|
@ -171,18 +171,18 @@ 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
|
|
||||||
$sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)';
|
|
||||||
|
|
||||||
$stmt = $this->db->prepare($sql);
|
|
||||||
$stmt->bindParam(1, $id, \PDO::PARAM_STR);
|
|
||||||
$stmt->bindValue(2, '', \PDO::PARAM_STR);
|
|
||||||
$stmt->bindValue(3, time(), \PDO::PARAM_INT);
|
|
||||||
$stmt->execute();
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// session does not exist, create it
|
||||||
|
$sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)';
|
||||||
|
|
||||||
|
$stmt = $this->db->prepare($sql);
|
||||||
|
$stmt->bindParam(1, $id, \PDO::PARAM_STR);
|
||||||
|
$stmt->bindValue(2, '', \PDO::PARAM_STR);
|
||||||
|
$stmt->bindValue(3, time(), \PDO::PARAM_INT);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user