29
29
class ConcurrentSessionControlAuthenticationStrategy implements SessionAuthenticationStrategyInterface
30
30
{
31
31
protected $ registry ;
32
- protected $ exceptionIfMaximumExceeded ;
32
+ protected $ errorIfMaximumExceeded ;
33
33
protected $ maximumSessions ;
34
34
35
- public function __construct (SessionRegistry $ registry , $ maximumSessions , $ exceptionIfMaximumExceeded = true )
35
+ public function __construct (SessionRegistry $ registry , $ maximumSessions , $ errorIfMaximumExceeded = true )
36
36
{
37
37
$ this ->registry = $ registry ;
38
38
$ this ->setMaximumSessions ($ maximumSessions );
39
- $ this ->setExceptionIfMaximumExceeded ( $ exceptionIfMaximumExceeded );
39
+ $ this ->setErrorIfMaximumExceeded ( $ errorIfMaximumExceeded );
40
40
}
41
41
42
42
/**
@@ -63,17 +63,17 @@ public function onAuthentication(Request $request, TokenInterface $token)
63
63
}
64
64
}
65
65
66
- $ this ->allowableSessionsExceeded ($ sessions , $ maxSessions , $ this ->registry );
66
+ $ this ->allowedSessionsExceeded ($ sessions , $ maxSessions , $ this ->registry );
67
67
}
68
68
69
69
/**
70
70
* Sets a boolean flag that causes a RuntimeException to be thrown if the number of sessions is exceeded.
71
71
*
72
- * @param bool $exceptionIfMaximumExceeded
72
+ * @param bool $errorIfMaximumExceeded
73
73
*/
74
- public function setExceptionIfMaximumExceeded ( $ exceptionIfMaximumExceeded )
74
+ public function setErrorIfMaximumExceeded ( $ errorIfMaximumExceeded )
75
75
{
76
- $ this ->exceptionIfMaximumExceeded = (bool ) $ exceptionIfMaximumExceeded ;
76
+ $ this ->errorIfMaximumExceeded = (bool ) $ errorIfMaximumExceeded ;
77
77
}
78
78
79
79
/**
@@ -94,9 +94,9 @@ public function setMaximumSessions($maximumSessions)
94
94
* @param int $allowableSessions
95
95
* @param SessionRegistry $registry
96
96
*/
97
- protected function allowableSessionsExceeded ($ orderedSessions , $ allowableSessions , SessionRegistry $ registry )
97
+ protected function allowedSessionsExceeded ($ orderedSessions , $ allowableSessions , SessionRegistry $ registry )
98
98
{
99
- if ($ this ->exceptionIfMaximumExceeded ) {
99
+ if ($ this ->errorIfMaximumExceeded ) {
100
100
throw new MaxSessionsExceededException (sprintf ('Maximum number of sessions (%s) exceeded ' , $ allowableSessions ));
101
101
}
102
102
0 commit comments