Skip to content

Various fixes #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
16 commits merged into from
Feb 27, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[HttpFoundation] Removed useless else
  • Loading branch information
pborreli committed Feb 27, 2011
commit fc42cc50661cf4a25fef48613401fe17e7aa8f7a
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpFoundation/File/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ public function getExtension()
{
if ($ext = pathinfo($this->getName(), \PATHINFO_EXTENSION)) {
return '.' . $ext;
} else {
return '';
}

return '';
}

/**
Expand All @@ -537,9 +537,9 @@ public function getDefaultExtension()

if (isset(self::$defaultExtensions[$type])) {
return '.' . self::$defaultExtensions[$type];
} else {
return $this->getExtension();
}

return $this->getExtension();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpFoundation/HeaderBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ public function get($key, $default = null, $first = true)
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];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpFoundation/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ public function getHttpHost()

if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) {
return $name;
} else {
return $name.':'.$port;
}

return $name.':'.$port;
}

public function getRequestUri()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,18 @@ public function sessionRead($id)

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 (?, ?, ?)';
}

$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();
// session does not exist, create it
$sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)';

return '';
}
$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) {
throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e);
}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy