-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom rate/period on pre create event
- Loading branch information
Marcos Gómez
committed
Aug 1, 2016
1 parent
27daf33
commit 2b746f8
Showing
4 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Instasent\RateLimitBundle\Events; | ||
|
||
use Instasent\RateLimitBundle\Annotation\RateLimit; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class RateLimitEvent extends Event | ||
{ | ||
|
||
/** @var Request */ | ||
protected $request; | ||
|
||
/** @var string */ | ||
protected $rateLimit; | ||
|
||
public function __construct(Request $request, RateLimit $rateLimitAnnotation) | ||
{ | ||
$this->request = $request; | ||
$this->rateLimit = $rateLimitAnnotation; | ||
} | ||
|
||
/** | ||
* @return RateLimit | ||
*/ | ||
public function getRateLimit() | ||
{ | ||
return $this->rateLimit; | ||
} | ||
|
||
/** | ||
* @return Request | ||
*/ | ||
public function getRequest() | ||
{ | ||
return $this->request; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters