-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from frozenminds/feature/event-virus-detection
Dispatch an event when virus is uploaded
- Loading branch information
Showing
7 changed files
with
96 additions
and
4 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
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,58 @@ | ||
<?php | ||
|
||
namespace CL\Bundle\TissueBundle\Event; | ||
|
||
use CL\Bundle\TissueBundle\Validator\Constraints\CleanFile; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\HttpFoundation\File\UploadedFile; | ||
|
||
/** | ||
* Virus Detection Event. | ||
* | ||
* @copyright Evozon Systems SRL (http://www.evozon.com/) | ||
* @author Constantin Bejenaru <[email protected]> | ||
*/ | ||
class DetectionVirusEvent extends Event | ||
{ | ||
/** | ||
* @var UploadedFile | ||
*/ | ||
private $uploadedFile; | ||
|
||
/** | ||
* @var CleanFile | ||
*/ | ||
private $constraint; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param UploadedFile $uploadedFile | ||
* @param CleanFile $constraint | ||
*/ | ||
public function __construct(UploadedFile $uploadedFile, CleanFile $constraint) | ||
{ | ||
$this->uploadedFile = $uploadedFile; | ||
$this->constraint = $constraint; | ||
} | ||
|
||
/** | ||
* Get UploadedFile. | ||
* | ||
* @return UploadedFile | ||
*/ | ||
public function getUploadedFile(): UploadedFile | ||
{ | ||
return $this->uploadedFile; | ||
} | ||
|
||
/** | ||
* Get Constraint. | ||
* | ||
* @return CleanFile | ||
*/ | ||
public function getConstraint(): CleanFile | ||
{ | ||
return $this->constraint; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
namespace CL\Bundle\TissueBundle; | ||
|
||
/** | ||
* Events. | ||
* | ||
* @copyright Evozon Systems SRL (http://www.evozon.com/) | ||
* @author Constantin Bejenaru <[email protected]> | ||
*/ | ||
final class Events | ||
{ | ||
/** | ||
* Dispatched when a virus detection is found during an upload file validation. | ||
*/ | ||
const DETECTION_VIRUS = 'tissue.detection.virus'; | ||
} |
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
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