diff --git a/src/Symfony/Component/HttpFoundation/CHANGELOG.md b/src/Symfony/Component/HttpFoundation/CHANGELOG.md index cf1b16435b..e7b801bc09 100644 --- a/src/Symfony/Component/HttpFoundation/CHANGELOG.md +++ b/src/Symfony/Component/HttpFoundation/CHANGELOG.md @@ -4,7 +4,7 @@ CHANGELOG 2.3.0 * `UploadedFile::isValid` now returns false if the file was not uploaded via HTTP (in a non-test mode) - * addded control for session start on demand. + * added control for session start on demand. 2.2.0 ----- diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index 15df097709..f644e02330 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -49,7 +49,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable /** * Constructor. * - * @param SessionStorageInterface $storage A SessionStorageInterface instance. + * @param SessionStorageInterface $storage A SessionStorageInterface instance * @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag) * @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag) */ diff --git a/src/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php b/src/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php index f8d3d32712..7937e1e80c 100644 --- a/src/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php @@ -42,7 +42,7 @@ interface SessionBagInterface /** * Clears out data from bag. * - * @return mixed Whatever data was contained. + * @return mixed Whatever data was contained */ public function clear(); } diff --git a/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php b/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php index a94fad00d6..b0990272de 100644 --- a/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php @@ -23,9 +23,9 @@ interface SessionInterface /** * Starts the session storage. * - * @return Boolean True if session started. + * @return Boolean True if session started * - * @throws \RuntimeException If session fails to start. + * @throws \RuntimeException If session fails to start * * @api */ @@ -34,7 +34,7 @@ interface SessionInterface /** * Returns the session ID. * - * @return string The session ID. + * @return string The session ID * * @api */ @@ -52,7 +52,7 @@ interface SessionInterface /** * Returns the session name. * - * @return mixed The session name. + * @return mixed The session name * * @api */ @@ -76,9 +76,9 @@ interface SessionInterface * @param integer $lifetime Sets the cookie lifetime for the session cookie. A null value * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. + * not a Unix timestamp * - * @return Boolean True if session invalidated, false if error. + * @return Boolean True if session invalidated, false if error * * @api */ @@ -92,9 +92,9 @@ interface SessionInterface * @param integer $lifetime Sets the cookie lifetime for the session cookie. A null value * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. + * not a Unix timestamp * - * @return Boolean True if session migrated, false if error. + * @return Boolean True if session migrated, false if error * * @api */ diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php index 4a5e63989a..57cadf8f83 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -29,7 +29,7 @@ class MemcacheSessionHandler implements \SessionHandlerInterface private $ttl; /** - * @var string Key prefix for shared environments. + * @var string Key prefix for shared environments */ private $prefix; diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php index b3ca0bd3cd..316f7fcd8f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -34,7 +34,7 @@ class MemcachedSessionHandler implements \SessionHandlerInterface private $ttl; /** - * @var string Key prefix for shared environments. + * @var string Key prefix for shared environments */ private $prefix; diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php index 69ebae9542..50f92bcb64 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -52,11 +52,11 @@ class MongoDbSessionHandler implements \SessionHandlerInterface public function __construct($mongo, array $options) { if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) { - throw new \InvalidArgumentException('MongoClient or Mongo instance required'); + throw new \InvalidArgumentException('MongoClient or Mongo instance required.'); } if (!isset($options['database']) || !isset($options['collection'])) { - throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler'); + throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler.'); } $this->mongo = $mongo; diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php index f39235cbfb..30993680fe 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php @@ -24,10 +24,10 @@ class NativeFileSessionHandler extends NativeSessionHandler * Constructor. * * @param string $savePath Path of directory to save session files. - * Default null will leave setting as defined by PHP. + * Default null will leave setting as defined by PHP * '/path', 'N;/path', or 'N;octal-mode;/path * - * @see http://php.net/session.configuration.php#ini.session.save-path for further details. + * @see http://php.net/session.configuration.php#ini.session.save-path for further details * * @throws \InvalidArgumentException On invalid $savePath */ @@ -41,7 +41,7 @@ class NativeFileSessionHandler extends NativeSessionHandler if ($count = substr_count($savePath, ';')) { if ($count > 2) { - throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'', $savePath)); + throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'.', $savePath)); } // characters after last ';' are the path diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php index 487dbc41e5..d88e41b5c8 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php @@ -20,12 +20,12 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; class PdoSessionHandler implements \SessionHandlerInterface { /** - * @var \PDO PDO instance. + * @var \PDO PDO instance */ private $pdo; /** - * @var array Database options. + * @var array Database options */ private $dbOptions; @@ -90,7 +90,7 @@ class PdoSessionHandler implements \SessionHandlerInterface $stmt->bindParam(':id', $id, \PDO::PARAM_STR); $stmt->execute(); } 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); } return true; @@ -113,7 +113,7 @@ class PdoSessionHandler implements \SessionHandlerInterface $stmt->bindValue(':time', time() - $lifetime, \PDO::PARAM_INT); $stmt->execute(); } 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); } return true; @@ -149,7 +149,7 @@ class PdoSessionHandler implements \SessionHandlerInterface return ''; } catch (\PDOException $e) { - throw new \RuntimeException(sprintf('PDOException was thrown when trying to read the session data: %s', $e->getMessage()), 0, $e); + throw new \RuntimeException(sprintf('PDOException was thrown when trying to read the session data: %s.', $e->getMessage()), 0, $e); } } @@ -204,7 +204,7 @@ class PdoSessionHandler implements \SessionHandlerInterface } } } catch (\PDOException $e) { - throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s', $e->getMessage()), 0, $e); + throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s.', $e->getMessage()), 0, $e); } return true; @@ -216,7 +216,7 @@ class PdoSessionHandler implements \SessionHandlerInterface * @param string $id * @param string $data * - * @return boolean True. + * @return boolean True */ private function createNewSession($id, $data = '') { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php index 892d004b5d..7465d03dad 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php @@ -51,7 +51,7 @@ class MetadataBag implements SessionBagInterface /** * Constructor. * - * @param string $storageKey The key used to store bag in the session. + * @param string $storageKey The key used to store bag in the session */ public function __construct($storageKey = '_sf2_meta') { @@ -90,7 +90,7 @@ class MetadataBag implements SessionBagInterface * @param integer $lifetime Sets the cookie lifetime for the session cookie. A null value * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. + * not a Unix timestamp */ public function stampNew($lifetime = null) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php index e55cb39500..02644758ca 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php @@ -71,9 +71,9 @@ class MockArraySessionStorage implements SessionStorageInterface /** * Constructor. * - * @param string $name Session name. - * @param MetadataBag $metaBag MetadataBag instance. - * @param integer $mode Session on demand mode. + * @param string $name Session name + * @param MetadataBag $metaBag MetadataBag instance + * @param integer $mode Session on demand mode */ public function __construct($name = 'MOCKSESSID', MetadataBag $metaBag = null, $mode = self::START_ON_DEMAND) { @@ -167,7 +167,7 @@ class MockArraySessionStorage implements SessionStorageInterface public function save() { if (!$this->started || $this->closed) { - throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + throw new \RuntimeException("Trying to save a session that was not started yet or was already closed."); } // nothing to do since we don't persist the session data $this->closed = false; @@ -204,13 +204,13 @@ class MockArraySessionStorage implements SessionStorageInterface public function getBag($name) { if (!isset($this->bags[$name])) { - throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered', $name)); + throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); } if (!$this->started && self::START_ON_DEMAND === $this->mode) { $this->start(); } elseif (!$this->started && self::NO_START_ON_DEMAND_STRICT === $this->mode) { - throw new \RuntimeException('Cannot access session bags because the session has been started'); + throw new \RuntimeException('Cannot access session bags because the session has not been started.'); } return $this->bags[$name]; diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php index 9fa851d4b5..df08e54dd9 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php @@ -32,10 +32,10 @@ class MockFileSessionStorage extends MockArraySessionStorage /** * Constructor. * - * @param string $savePath Path of directory to save session files. - * @param string $name Session name. - * @param MetadataBag $metaBag MetadataBag instance. - * @param integer $mode Start on demand mode. + * @param string $savePath Path of directory to save session files + * @param string $name Session name + * @param MetadataBag $metaBag MetadataBag instance + * @param integer $mode Start on demand mode */ public function __construct($savePath = null, $name = 'MOCKSESSID', MetadataBag $metaBag = null, $mode = self::START_ON_DEMAND) { @@ -94,7 +94,7 @@ class MockFileSessionStorage extends MockArraySessionStorage public function save() { if (!$this->started) { - throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + throw new \RuntimeException("Trying to save a session that was not started yet or was already closed."); } file_put_contents($this->getFilePath(), serialize($this->data)); diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index c3c8e38494..af15dfe55f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -102,10 +102,10 @@ class NativeSessionStorage implements SessionStorageInterface * upload_progress.min-freq, "1" * url_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset=" * - * @param array $options Session configuration options. - * @param object $handler SessionHandlerInterface. - * @param MetadataBag $metaBag MetadataBag. - * @param integer $mode Start on demand mode. + * @param array $options Session configuration options + * @param object $handler SessionHandlerInterface + * @param MetadataBag $metaBag MetadataBag + * @param integer $mode Start on demand mode */ public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null, $mode = self::START_ON_DEMAND) { @@ -157,7 +157,7 @@ class NativeSessionStorage implements SessionStorageInterface // start the session if (!session_start()) { - throw new \RuntimeException('Failed to start the session'); + throw new \RuntimeException('Failed to start the session.'); } $this->loadSession(); @@ -266,13 +266,13 @@ class NativeSessionStorage implements SessionStorageInterface public function getBag($name) { if (!isset($this->bags[$name])) { - throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered', $name)); + throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); } if (!$this->started && self::START_ON_DEMAND === $this->mode) { $this->start(); } elseif (!$this->started && self::NO_START_ON_DEMAND_STRICT === $this->mode) { - throw new \RuntimeException('Cannot access session bags because the session has been started'); + throw new \RuntimeException('Cannot access session bags because the session has not been started.'); } return $this->bags[$name]; @@ -316,7 +316,7 @@ class NativeSessionStorage implements SessionStorageInterface * For convenience we omit 'session.' from the beginning of the keys. * Explicitly ignores other ini keys. * - * @param array $options Session ini directives array(key => value). + * @param array $options Session ini directives array(key => value) * * @see http://php.net/session.configuration */ @@ -354,7 +354,7 @@ class NativeSessionStorage implements SessionStorageInterface * @see http://php.net/sessionhandlerinterface * @see http://php.net/sessionhandler * - * @param object $saveHandler Default null means NativeProxy. + * @param object $saveHandler Default null means NativeProxy */ public function setSaveHandler($saveHandler = null) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php index 1f68f24961..56b477dbb1 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php @@ -36,7 +36,7 @@ abstract class AbstractProxy protected $saveHandlerName; /** - * Gets the session.save_handler name. + * Gets the session.save_handler name * * @return string */ @@ -46,7 +46,7 @@ abstract class AbstractProxy } /** - * Is this proxy handler and instance of \SessionHandlerInterface. + * Is this proxy handler and instance of \SessionHandlerInterface * * @return boolean */ @@ -56,7 +56,7 @@ abstract class AbstractProxy } /** - * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. + * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler * * @return Boolean */ @@ -105,7 +105,7 @@ abstract class AbstractProxy public function setId($id) { if ($this->isActive()) { - throw new \LogicException('Cannot change the ID of an active session'); + throw new \LogicException('Cannot change the ID of an active session.'); } session_id($id); @@ -131,7 +131,7 @@ abstract class AbstractProxy public function setName($name) { if ($this->isActive()) { - throw new \LogicException('Cannot change the name of an active session'); + throw new \LogicException('Cannot change the name of an active session.'); } session_name($name); diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php index 23eebb3281..5cdbd420c8 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php @@ -32,7 +32,7 @@ class NativeProxy extends AbstractProxy /** * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. * - * @return Boolean False. + * @return Boolean False */ public function isWrapper() { diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php index 55d0fc01d1..ebe18aecb5 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php @@ -107,7 +107,7 @@ class MockArraySessionStorageTest extends \PHPUnit_Framework_TestCase /** * @expectedException \RuntimeException */ - public function testtStartOnDemandException() + public function testStartOnDemandException() { $storage = new MockArraySessionStorage('MOCKSESSID', null, MockArraySessionStorage::NO_START_ON_DEMAND_STRICT); $storage->registerBag(new AttributeBag); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php index 4c9fcfa52e..501d12ce23 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php @@ -127,7 +127,7 @@ class MockFileSessionStorageTest extends \PHPUnit_Framework_TestCase /** * @expectedException \RuntimeException */ - public function testtStartOnDemandException() + public function testStartOnDemandException() { $storage = new MockFileSessionStorage($this->sessionDir, 'MOCKSESSID', null, MockFileSessionStorage::NO_START_ON_DEMAND_STRICT); $storage->registerBag(new AttributeBag); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php index 17a25076fe..f75a39aa4b 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -159,7 +159,7 @@ class NativeSessionStorageTest extends \PHPUnit_Framework_TestCase /** * @expectedException \RuntimeException */ - public function testtStartOnDemandException() + public function testStartOnDemandException() { $storage = new NativeSessionStorage(array(), null, null, NativeSessionStorage::NO_START_ON_DEMAND_STRICT); $storage->registerBag(new AttributeBag);