Skip to content

Commit 5dd7a3a

Browse files
author
Drak
committed
Coding standards
As requested by @fabpot
1 parent 5e5adff commit 5dd7a3a

18 files changed

+56
-56
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
2.3.0
55

66
* `UploadedFile::isValid` now returns false if the file was not uploaded via HTTP (in a non-test mode)
7-
* addded control for session start on demand.
7+
* added control for session start on demand.
88

99
2.2.0
1010
-----

Session/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
4949
/**
5050
* Constructor.
5151
*
52-
* @param SessionStorageInterface $storage A SessionStorageInterface instance.
52+
* @param SessionStorageInterface $storage A SessionStorageInterface instance
5353
* @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag)
5454
* @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag)
5555
*/

Session/SessionBagInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getStorageKey();
4242
/**
4343
* Clears out data from bag.
4444
*
45-
* @return mixed Whatever data was contained.
45+
* @return mixed Whatever data was contained
4646
*/
4747
public function clear();
4848
}

Session/SessionInterface.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ interface SessionInterface
2323
/**
2424
* Starts the session storage.
2525
*
26-
* @return Boolean True if session started.
26+
* @return Boolean True if session started
2727
*
28-
* @throws \RuntimeException If session fails to start.
28+
* @throws \RuntimeException If session fails to start
2929
*
3030
* @api
3131
*/
@@ -34,7 +34,7 @@ public function start();
3434
/**
3535
* Returns the session ID.
3636
*
37-
* @return string The session ID.
37+
* @return string The session ID
3838
*
3939
* @api
4040
*/
@@ -52,7 +52,7 @@ public function setId($id);
5252
/**
5353
* Returns the session name.
5454
*
55-
* @return mixed The session name.
55+
* @return mixed The session name
5656
*
5757
* @api
5858
*/
@@ -76,9 +76,9 @@ public function setName($name);
7676
* @param integer $lifetime Sets the cookie lifetime for the session cookie. A null value
7777
* will leave the system settings unchanged, 0 sets the cookie
7878
* to expire with browser session. Time is in seconds, and is
79-
* not a Unix timestamp.
79+
* not a Unix timestamp
8080
*
81-
* @return Boolean True if session invalidated, false if error.
81+
* @return Boolean True if session invalidated, false if error
8282
*
8383
* @api
8484
*/
@@ -92,9 +92,9 @@ public function invalidate($lifetime = null);
9292
* @param integer $lifetime Sets the cookie lifetime for the session cookie. A null value
9393
* will leave the system settings unchanged, 0 sets the cookie
9494
* to expire with browser session. Time is in seconds, and is
95-
* not a Unix timestamp.
95+
* not a Unix timestamp
9696
*
97-
* @return Boolean True if session migrated, false if error.
97+
* @return Boolean True if session migrated, false if error
9898
*
9999
* @api
100100
*/

Session/Storage/Handler/MemcacheSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
2929
private $ttl;
3030

3131
/**
32-
* @var string Key prefix for shared environments.
32+
* @var string Key prefix for shared environments
3333
*/
3434
private $prefix;
3535

Session/Storage/Handler/MemcachedSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MemcachedSessionHandler implements \SessionHandlerInterface
3434
private $ttl;
3535

3636
/**
37-
* @var string Key prefix for shared environments.
37+
* @var string Key prefix for shared environments
3838
*/
3939
private $prefix;
4040

Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
5252
public function __construct($mongo, array $options)
5353
{
5454
if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) {
55-
throw new \InvalidArgumentException('MongoClient or Mongo instance required');
55+
throw new \InvalidArgumentException('MongoClient or Mongo instance required.');
5656
}
5757

5858
if (!isset($options['database']) || !isset($options['collection'])) {
59-
throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler');
59+
throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler.');
6060
}
6161

6262
$this->mongo = $mongo;

Session/Storage/Handler/NativeFileSessionHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class NativeFileSessionHandler extends NativeSessionHandler
2424
* Constructor.
2525
*
2626
* @param string $savePath Path of directory to save session files.
27-
* Default null will leave setting as defined by PHP.
27+
* Default null will leave setting as defined by PHP
2828
* '/path', 'N;/path', or 'N;octal-mode;/path
2929
*
30-
* @see http://php.net/session.configuration.php#ini.session.save-path for further details.
30+
* @see http://php.net/session.configuration.php#ini.session.save-path for further details
3131
*
3232
* @throws \InvalidArgumentException On invalid $savePath
3333
*/
@@ -41,7 +41,7 @@ public function __construct($savePath = null)
4141

4242
if ($count = substr_count($savePath, ';')) {
4343
if ($count > 2) {
44-
throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'', $savePath));
44+
throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'.', $savePath));
4545
}
4646

4747
// characters after last ';' are the path

Session/Storage/Handler/PdoSessionHandler.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
class PdoSessionHandler implements \SessionHandlerInterface
2121
{
2222
/**
23-
* @var \PDO PDO instance.
23+
* @var \PDO PDO instance
2424
*/
2525
private $pdo;
2626

2727
/**
28-
* @var array Database options.
28+
* @var array Database options
2929
*/
3030
private $dbOptions;
3131

@@ -90,7 +90,7 @@ public function destroy($id)
9090
$stmt->bindParam(':id', $id, \PDO::PARAM_STR);
9191
$stmt->execute();
9292
} catch (\PDOException $e) {
93-
throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e);
93+
throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s.', $e->getMessage()), 0, $e);
9494
}
9595

9696
return true;
@@ -113,7 +113,7 @@ public function gc($lifetime)
113113
$stmt->bindValue(':time', time() - $lifetime, \PDO::PARAM_INT);
114114
$stmt->execute();
115115
} catch (\PDOException $e) {
116-
throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e);
116+
throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s.', $e->getMessage()), 0, $e);
117117
}
118118

119119
return true;
@@ -149,7 +149,7 @@ public function read($id)
149149

150150
return '';
151151
} catch (\PDOException $e) {
152-
throw new \RuntimeException(sprintf('PDOException was thrown when trying to read the session data: %s', $e->getMessage()), 0, $e);
152+
throw new \RuntimeException(sprintf('PDOException was thrown when trying to read the session data: %s.', $e->getMessage()), 0, $e);
153153
}
154154
}
155155

@@ -204,7 +204,7 @@ public function write($id, $data)
204204
}
205205
}
206206
} catch (\PDOException $e) {
207-
throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s', $e->getMessage()), 0, $e);
207+
throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s.', $e->getMessage()), 0, $e);
208208
}
209209

210210
return true;
@@ -216,7 +216,7 @@ public function write($id, $data)
216216
* @param string $id
217217
* @param string $data
218218
*
219-
* @return boolean True.
219+
* @return boolean True
220220
*/
221221
private function createNewSession($id, $data = '')
222222
{

Session/Storage/MetadataBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class MetadataBag implements SessionBagInterface
5151
/**
5252
* Constructor.
5353
*
54-
* @param string $storageKey The key used to store bag in the session.
54+
* @param string $storageKey The key used to store bag in the session
5555
*/
5656
public function __construct($storageKey = '_sf2_meta')
5757
{
@@ -90,7 +90,7 @@ public function getLifetime()
9090
* @param integer $lifetime Sets the cookie lifetime for the session cookie. A null value
9191
* will leave the system settings unchanged, 0 sets the cookie
9292
* to expire with browser session. Time is in seconds, and is
93-
* not a Unix timestamp.
93+
* not a Unix timestamp
9494
*/
9595
public function stampNew($lifetime = null)
9696
{

Session/Storage/MockArraySessionStorage.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ class MockArraySessionStorage implements SessionStorageInterface
7171
/**
7272
* Constructor.
7373
*
74-
* @param string $name Session name.
75-
* @param MetadataBag $metaBag MetadataBag instance.
76-
* @param integer $mode Session on demand mode.
74+
* @param string $name Session name
75+
* @param MetadataBag $metaBag MetadataBag instance
76+
* @param integer $mode Session on demand mode
7777
*/
7878
public function __construct($name = 'MOCKSESSID', MetadataBag $metaBag = null, $mode = self::START_ON_DEMAND)
7979
{
@@ -167,7 +167,7 @@ public function setName($name)
167167
public function save()
168168
{
169169
if (!$this->started || $this->closed) {
170-
throw new \RuntimeException("Trying to save a session that was not started yet or was already closed");
170+
throw new \RuntimeException("Trying to save a session that was not started yet or was already closed.");
171171
}
172172
// nothing to do since we don't persist the session data
173173
$this->closed = false;
@@ -204,13 +204,13 @@ public function registerBag(SessionBagInterface $bag)
204204
public function getBag($name)
205205
{
206206
if (!isset($this->bags[$name])) {
207-
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered', $name));
207+
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name));
208208
}
209209

210210
if (!$this->started && self::START_ON_DEMAND === $this->mode) {
211211
$this->start();
212212
} elseif (!$this->started && self::NO_START_ON_DEMAND_STRICT === $this->mode) {
213-
throw new \RuntimeException('Cannot access session bags because the session has been started');
213+
throw new \RuntimeException('Cannot access session bags because the session has not been started.');
214214
}
215215

216216
return $this->bags[$name];

Session/Storage/MockFileSessionStorage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class MockFileSessionStorage extends MockArraySessionStorage
3232
/**
3333
* Constructor.
3434
*
35-
* @param string $savePath Path of directory to save session files.
36-
* @param string $name Session name.
37-
* @param MetadataBag $metaBag MetadataBag instance.
38-
* @param integer $mode Start on demand mode.
35+
* @param string $savePath Path of directory to save session files
36+
* @param string $name Session name
37+
* @param MetadataBag $metaBag MetadataBag instance
38+
* @param integer $mode Start on demand mode
3939
*/
4040
public function __construct($savePath = null, $name = 'MOCKSESSID', MetadataBag $metaBag = null, $mode = self::START_ON_DEMAND)
4141
{
@@ -94,7 +94,7 @@ public function regenerate($destroy = false, $lifetime = null)
9494
public function save()
9595
{
9696
if (!$this->started) {
97-
throw new \RuntimeException("Trying to save a session that was not started yet or was already closed");
97+
throw new \RuntimeException("Trying to save a session that was not started yet or was already closed.");
9898
}
9999

100100
file_put_contents($this->getFilePath(), serialize($this->data));

Session/Storage/NativeSessionStorage.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ class NativeSessionStorage implements SessionStorageInterface
102102
* upload_progress.min-freq, "1"
103103
* url_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset="
104104
*
105-
* @param array $options Session configuration options.
106-
* @param object $handler SessionHandlerInterface.
107-
* @param MetadataBag $metaBag MetadataBag.
108-
* @param integer $mode Start on demand mode.
105+
* @param array $options Session configuration options
106+
* @param object $handler SessionHandlerInterface
107+
* @param MetadataBag $metaBag MetadataBag
108+
* @param integer $mode Start on demand mode
109109
*/
110110
public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null, $mode = self::START_ON_DEMAND)
111111
{
@@ -157,7 +157,7 @@ public function start()
157157

158158
// start the session
159159
if (!session_start()) {
160-
throw new \RuntimeException('Failed to start the session');
160+
throw new \RuntimeException('Failed to start the session.');
161161
}
162162

163163
$this->loadSession();
@@ -266,13 +266,13 @@ public function registerBag(SessionBagInterface $bag)
266266
public function getBag($name)
267267
{
268268
if (!isset($this->bags[$name])) {
269-
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered', $name));
269+
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name));
270270
}
271271

272272
if (!$this->started && self::START_ON_DEMAND === $this->mode) {
273273
$this->start();
274274
} elseif (!$this->started && self::NO_START_ON_DEMAND_STRICT === $this->mode) {
275-
throw new \RuntimeException('Cannot access session bags because the session has been started');
275+
throw new \RuntimeException('Cannot access session bags because the session has not been started.');
276276
}
277277

278278
return $this->bags[$name];
@@ -316,7 +316,7 @@ public function isStarted()
316316
* For convenience we omit 'session.' from the beginning of the keys.
317317
* Explicitly ignores other ini keys.
318318
*
319-
* @param array $options Session ini directives array(key => value).
319+
* @param array $options Session ini directives array(key => value)
320320
*
321321
* @see http://php.net/session.configuration
322322
*/
@@ -354,7 +354,7 @@ public function setOptions(array $options)
354354
* @see http://php.net/sessionhandlerinterface
355355
* @see http://php.net/sessionhandler
356356
*
357-
* @param object $saveHandler Default null means NativeProxy.
357+
* @param object $saveHandler Default null means NativeProxy
358358
*/
359359
public function setSaveHandler($saveHandler = null)
360360
{

Session/Storage/Proxy/AbstractProxy.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class AbstractProxy
3636
protected $saveHandlerName;
3737

3838
/**
39-
* Gets the session.save_handler name.
39+
* Gets the session.save_handler name
4040
*
4141
* @return string
4242
*/
@@ -46,7 +46,7 @@ public function getSaveHandlerName()
4646
}
4747

4848
/**
49-
* Is this proxy handler and instance of \SessionHandlerInterface.
49+
* Is this proxy handler and instance of \SessionHandlerInterface
5050
*
5151
* @return boolean
5252
*/
@@ -56,7 +56,7 @@ public function isSessionHandlerInterface()
5656
}
5757

5858
/**
59-
* Returns true if this handler wraps an internal PHP session save handler using \SessionHandler.
59+
* Returns true if this handler wraps an internal PHP session save handler using \SessionHandler
6060
*
6161
* @return Boolean
6262
*/
@@ -105,7 +105,7 @@ public function getId()
105105
public function setId($id)
106106
{
107107
if ($this->isActive()) {
108-
throw new \LogicException('Cannot change the ID of an active session');
108+
throw new \LogicException('Cannot change the ID of an active session.');
109109
}
110110

111111
session_id($id);
@@ -131,7 +131,7 @@ public function getName()
131131
public function setName($name)
132132
{
133133
if ($this->isActive()) {
134-
throw new \LogicException('Cannot change the name of an active session');
134+
throw new \LogicException('Cannot change the name of an active session.');
135135
}
136136

137137
session_name($name);

Session/Storage/Proxy/NativeProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct()
3232
/**
3333
* Returns true if this handler wraps an internal PHP session save handler using \SessionHandler.
3434
*
35-
* @return Boolean False.
35+
* @return Boolean False
3636
*/
3737
public function isWrapper()
3838
{

Tests/Session/Storage/MockArraySessionStorageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testUnstartedSave()
107107
/**
108108
* @expectedException \RuntimeException
109109
*/
110-
public function testtStartOnDemandException()
110+
public function testStartOnDemandException()
111111
{
112112
$storage = new MockArraySessionStorage('MOCKSESSID', null, MockArraySessionStorage::NO_START_ON_DEMAND_STRICT);
113113
$storage->registerBag(new AttributeBag);

0 commit comments

Comments
 (0)