| @@ 12-54 (lines=43) @@ | ||
| 9 | use Symfony\Component\HttpFoundation\Request; |
|
| 10 | ||
| 11 | if(Kernel::VERSION_ID >= 40300) { |
|
| 12 | class CheckedRateLimitEvent extends ContractsEvent |
|
| 13 | { |
|
| 14 | ||
| 15 | /** |
|
| 16 | * @var Request |
|
| 17 | */ |
|
| 18 | protected $request; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var RateLimit|null |
|
| 22 | */ |
|
| 23 | protected $rateLimit; |
|
| 24 | ||
| 25 | public function __construct(Request $request, RateLimit $rateLimit = null) |
|
| 26 | { |
|
| 27 | $this->request = $request; |
|
| 28 | $this->rateLimit = $rateLimit; |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @return RateLimit|null |
|
| 33 | */ |
|
| 34 | public function getRateLimit() |
|
| 35 | { |
|
| 36 | return $this->rateLimit; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @param RateLimit|null $rateLimit |
|
| 41 | */ |
|
| 42 | public function setRateLimit(RateLimit $rateLimit = null) |
|
| 43 | { |
|
| 44 | $this->rateLimit = $rateLimit; |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * @return Request |
|
| 49 | */ |
|
| 50 | public function getRequest() |
|
| 51 | { |
|
| 52 | return $this->request; |
|
| 53 | } |
|
| 54 | } |
|
| 55 | } else { |
|
| 56 | class CheckedRateLimitEvent extends ComponentEvent |
|
| 57 | { |
|
| @@ 56-98 (lines=43) @@ | ||
| 53 | } |
|
| 54 | } |
|
| 55 | } else { |
|
| 56 | class CheckedRateLimitEvent extends ComponentEvent |
|
| 57 | { |
|
| 58 | ||
| 59 | /** |
|
| 60 | * @var Request |
|
| 61 | */ |
|
| 62 | protected $request; |
|
| 63 | ||
| 64 | /** |
|
| 65 | * @var RateLimit|null |
|
| 66 | */ |
|
| 67 | protected $rateLimit; |
|
| 68 | ||
| 69 | public function __construct(Request $request, RateLimit $rateLimit = null) |
|
| 70 | { |
|
| 71 | $this->request = $request; |
|
| 72 | $this->rateLimit = $rateLimit; |
|
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * @return RateLimit|null |
|
| 77 | */ |
|
| 78 | public function getRateLimit() |
|
| 79 | { |
|
| 80 | return $this->rateLimit; |
|
| 81 | } |
|
| 82 | ||
| 83 | /** |
|
| 84 | * @param RateLimit|null $rateLimit |
|
| 85 | */ |
|
| 86 | public function setRateLimit(RateLimit $rateLimit = null) |
|
| 87 | { |
|
| 88 | $this->rateLimit = $rateLimit; |
|
| 89 | } |
|
| 90 | ||
| 91 | /** |
|
| 92 | * @return Request |
|
| 93 | */ |
|
| 94 | public function getRequest() |
|
| 95 | { |
|
| 96 | return $this->request; |
|
| 97 | } |
|
| 98 | } |
|
| 99 | } |
|