Skip to content

Commit 85aec76

Browse files
committed
Fix some issues
1 parent 9d01b15 commit 85aec76

File tree

5 files changed

+32
-91
lines changed

5 files changed

+32
-91
lines changed

EventListener/FlashMessageSubscriber.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ public static function getSubscribedEvents()
5858
);
5959
}
6060

61-
/**
62-
* Moves flash messages from the session to a cookie inside a Response Kernel listener
63-
*
64-
* @param FilterResponseEvent $event
65-
*/
61+
/**
62+
* Moves flash messages from the session to a cookie inside a Response Kernel listener
63+
*
64+
* @param FilterResponseEvent $event
65+
*/
6666
public function onKernelResponse(FilterResponseEvent $event)
6767
{
6868
if ($event->getRequestType() !== HttpKernel::MASTER_REQUEST) {

EventListener/InvalidationSubscriber.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ class InvalidationSubscriber extends AbstractRuleSubscriber implements EventSubs
5858
/**
5959
* Constructor
6060
*
61-
* @param CacheManager $cacheManager
62-
* @param UrlGeneratorInterface $urlGenerator
63-
* @param ExpressionLanguage $expressionLanguage
61+
* @param CacheManager $cacheManager
62+
* @param UrlGeneratorInterface $urlGenerator
63+
* @param ExpressionLanguage|null $expressionLanguage
6464
*/
6565
public function __construct(
6666
CacheManager $cacheManager,
@@ -82,8 +82,6 @@ public function __construct(
8282
* HTTP cache.
8383
*
8484
* @param PostResponseEvent $event
85-
*
86-
* @return array Paths that were flushed from the invalidation queue
8785
*/
8886
public function onKernelTerminate(PostResponseEvent $event)
8987
{

EventListener/TagSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class TagSubscriber extends AbstractRuleSubscriber implements EventSubscriberInt
3939
/**
4040
* Constructor
4141
*
42-
* @param CacheManager $cacheManager
43-
* @param ExpressionLanguage $expressionLanguage
42+
* @param CacheManager $cacheManager
43+
* @param ExpressionLanguage|null $expressionLanguage
4444
*/
4545
public function __construct(
4646
CacheManager $cacheManager,

Test/ProxyTestCase.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ abstract class ProxyTestCase extends WebTestCase
1919
/**
2020
* Assert cache hit
2121
*
22-
* @param Response $response
23-
* @param string $message
22+
* @param Response $response
23+
* @param string|null $message
2424
*/
2525
public function assertHit(Response $response, $message = null)
2626
{
@@ -30,8 +30,8 @@ public function assertHit(Response $response, $message = null)
3030
/**
3131
* Assert cache miss
3232
*
33-
* @param Response $response
34-
* @param string $message
33+
* @param Response $response
34+
* @param string|null $message
3535
*/
3636
public function assertMiss(Response $response, $message = null)
3737
{

Tests/Functional/Fixtures/Session/TestSessionStorage.php

Lines changed: 18 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,166 +3,109 @@
33
namespace FOS\HttpCacheBundle\Tests\Functional\Fixtures\Session;
44

55
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
6-
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
76
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
87
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
98

9+
/**
10+
* {@inheritdoc}
11+
*/
1012
class TestSessionStorage implements SessionStorageInterface
1113
{
1214
private $started = false;
1315

1416
private $bags = array();
1517

1618
/**
17-
* Starts the session.
18-
*
19-
* @throws \RuntimeException If something goes wrong starting the session.
20-
*
21-
* @return bool True if started.
22-
*
23-
* @api
19+
* {@inheritdoc}
2420
*/
2521
public function start()
2622
{
27-
$this->started = true;
23+
return $this->started = true;
2824
}
2925

3026
/**
31-
* Checks if the session is started.
32-
*
33-
* @return bool True if started, false otherwise.
27+
* {@inheritdoc}
3428
*/
3529
public function isStarted()
3630
{
3731
return $this->started;
3832
}
3933

4034
/**
41-
* Returns the session ID
42-
*
43-
* @return string The session ID or empty.
44-
*
45-
* @api
35+
* {@inheritdoc}
4636
*/
4737
public function getId()
4838
{
4939
return 'test';
5040
}
5141

5242
/**
53-
* Sets the session ID
54-
*
55-
* @param string $id
56-
*
57-
* @api
43+
* {@inheritdoc}
5844
*/
5945
public function setId($id)
6046
{
6147
}
6248

6349
/**
64-
* Returns the session name
65-
*
66-
* @return mixed The session name.
67-
*
68-
* @api
50+
* {@inheritdoc}
6951
*/
7052
public function getName()
7153
{
7254
return 'TESTSESSID';
7355
}
7456

7557
/**
76-
* Sets the session name
77-
*
78-
* @param string $name
79-
*
80-
* @api
58+
* {@inheritdoc}
8159
*/
60+
8261
public function setName($name)
8362
{
8463
}
8564

8665
/**
87-
* Regenerates id that represents this storage.
88-
*
89-
* This method must invoke session_regenerate_id($destroy) unless
90-
* this interface is used for a storage object designed for unit
91-
* or functional testing where a real PHP session would interfere
92-
* with testing.
93-
*
94-
* Note regenerate+destroy should not clear the session data in memory
95-
* only delete the session data from persistent storage.
96-
*
97-
* @param bool $destroy Destroy session when regenerating?
98-
* @param int $lifetime Sets the cookie lifetime for the session cookie. A null value
99-
* will leave the system settings unchanged, 0 sets the cookie
100-
* to expire with browser session. Time is in seconds, and is
101-
* not a Unix timestamp.
102-
*
103-
* @return bool True if session regenerated, false if error
104-
*
105-
* @throws \RuntimeException If an error occurs while regenerating this storage
106-
*
107-
* @api
66+
* {@inheritdoc}
10867
*/
10968
public function regenerate($destroy = false, $lifetime = null)
11069
{
11170
return true;
11271
}
11372

11473
/**
115-
* Force the session to be saved and closed.
116-
*
117-
* This method must invoke session_write_close() unless this interface is
118-
* used for a storage object design for unit or functional testing where
119-
* a real PHP session would interfere with testing, in which case it
120-
* it should actually persist the session data if required.
121-
*
122-
* @throws \RuntimeException If the session is saved without being started, or if the session
123-
* is already closed.
74+
* {@inheritdoc}
12475
*/
12576
public function save()
12677
{
12778
}
12879

12980
/**
130-
* Clear all session data in memory.
81+
* {@inheritdoc}
13182
*/
13283
public function clear()
13384
{
13485
}
13586

13687
/**
137-
* Gets a SessionBagInterface by name.
138-
*
139-
* @param string $name
140-
*
141-
* @return SessionBagInterface
142-
*
143-
* @throws \InvalidArgumentException If the bag does not exist
88+
* {@inheritdoc}
14489
*/
14590
public function getBag($name)
14691
{
14792
return $this->bags[$name];
14893
}
14994

15095
/**
151-
* Registers a SessionBagInterface for use.
152-
*
153-
* @param SessionBagInterface $bag
96+
* {@inheritdoc}
15497
*/
15598
public function registerBag(SessionBagInterface $bag)
15699
{
157-
if ($bag->getName() == "attributes") {
100+
if ($bag->getName() == 'attributes') {
158101
$bag->set('_security_secured_area', serialize(new UsernamePasswordToken('user', 'user', 'in_memory', array('ROLE_USER'))));
159102
}
160103

161104
$this->bags[$bag->getName()] = $bag;
162105
}
163106

164107
/**
165-
* @return MetadataBag
108+
* {@inheritdoc}
166109
*/
167110
public function getMetadataBag()
168111
{

0 commit comments

Comments
 (0)