1 | <?php |
||
30 | class FloodControl |
||
31 | { |
||
32 | /** |
||
33 | * |
||
34 | * @access protected |
||
35 | * @var \Symfony\Component\Security\Core\SecurityContextInterface $securityContext |
||
36 | */ |
||
37 | protected $securityContext; |
||
38 | |||
39 | /** |
||
40 | * |
||
41 | * @access protected |
||
42 | * @var \Symfony\Component\HttpFoundation\Session\Session $session |
||
43 | */ |
||
44 | protected $session; |
||
45 | |||
46 | /** |
||
47 | * |
||
48 | * @access protected |
||
49 | * @var string $kernelEnv |
||
50 | */ |
||
51 | protected $kernelEnv; |
||
52 | |||
53 | /** |
||
54 | * |
||
55 | * @access protected |
||
56 | * @var int $postLimit |
||
57 | */ |
||
58 | protected $postLimit; |
||
59 | |||
60 | /** |
||
61 | * |
||
62 | * @access protected |
||
63 | * @var int $blockTimeInMinutes |
||
64 | */ |
||
65 | protected $blockTimeInMinutes; |
||
66 | |||
67 | /** |
||
68 | * |
||
69 | * @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 $postLimit |
||
74 | * @param int $blockTimeInMinutes |
||
75 | */ |
||
76 | public function __construct(SecurityContextInterface $securityContext, Session $session, $kernelEnv, $postLimit, $blockTimeInMinutes) |
||
89 | |||
90 | /** |
||
91 | * |
||
92 | * @access public |
||
93 | */ |
||
94 | public function incrementCounter() |
||
104 | |||
105 | /** |
||
106 | * |
||
107 | * @access public |
||
108 | * @return bool |
||
109 | */ |
||
110 | public function isFlooded() |
||
140 | } |
||
141 |