@@ -67,11 +67,11 @@ class FloodControl
6767 /**
6868 *
6969 * @access public
70- * @param \Symfony\Component\Security\Core\SecurityContextInterface $securityContext
71- * @param \Symfony\Component\HttpFoundation\Session\Session $session
72- * @param string $kernelEnv
73- * @param int $sendLimit
74- * @param int $blockForMinutes
70+ * @param \Symfony\Component\Security\Core\SecurityContextInterface $securityContext
71+ * @param \Symfony\Component\HttpFoundation\Session\Session $session
72+ * @param string $kernelEnv
73+ * @param int $sendLimit
74+ * @param int $blockForMinutes
7575 */
7676 public function __construct (SecurityContextInterface $ securityContext , Session $ session , $ kernelEnv , $ sendLimit , $ blockForMinutes )
7777 {
@@ -94,12 +94,12 @@ public function __construct(SecurityContextInterface $securityContext, Session $
9494 public function incrementCounter ()
9595 {
9696 if (! $ this ->securityContext ->isGranted ('ROLE_MODERATOR ' ) || $ this ->kernelEnv != 'prod ' ) {
97- $ sendCount = $ this ->session ->get ('flood_control_message_send_count ' );
97+ $ sendCount = $ this ->session ->get ('flood_control_message_send_count ' );
9898
99- $ sendCount [] = new \DateTime ('now ' );
99+ $ sendCount [] = new \DateTime ('now ' );
100100
101- $ this ->session ->set ('flood_control_message_send_count ' , $ sendCount );
102- }
101+ $ this ->session ->set ('flood_control_message_send_count ' , $ sendCount );
102+ }
103103 }
104104
105105 /**
@@ -110,16 +110,16 @@ public function incrementCounter()
110110 public function isFlooded ()
111111 {
112112 if ($ this ->sendLimit < 1 || ! $ this ->securityContext ->isGranted ('ROLE_MODERATOR ' ) || $ this ->kernelEnv != 'prod ' ) {
113- return false ;
114- }
113+ return false ;
114+ }
115115
116116 if ($ this ->session ->has ('flood_control_message_send_count ' )) {
117117 $ attempts = $ this ->session ->get ('flood_control_message_send_count ' );
118118
119119 // Iterate over attempts and only reveal attempts that fall within the $timeLimit.
120120 $ freshenedAttempts = array ();
121121
122- $ timeLimit = new \DateTime ('- ' . $ this ->blockForMinutes . ' minutes ' );
122+ $ timeLimit = new \DateTime ('- ' . $ this ->blockForMinutes . ' minutes ' );
123123 $ limit = $ timeLimit ->getTimestamp ();
124124
125125 foreach ($ attempts as $ attempt ) {
0 commit comments