diff --git a/Listener/VirusScannerListener.php b/Listener/VirusScannerListener.php index f4b49a9dabec7908281c458cf0ce4d680e38e9d7..c79d637ba718ee6984a04610c50b71348590581f 100644 --- a/Listener/VirusScannerListener.php +++ b/Listener/VirusScannerListener.php @@ -6,9 +6,9 @@ namespace Irstea\FileUploadBundle\Listener; -use Xenolope\Quahog\Client; use Irstea\FileUploadBundle\Event\FileUploadCompleteEvent; use Irstea\FileUploadBundle\Exception\RejectedFileException; +use Xenolope\Quahog\Client; use Xenolope\Quahog\Exception\ConnectionException; /** @@ -21,7 +21,6 @@ class VirusScannerListener */ private $client; - /** * @param Client $client */ @@ -30,9 +29,9 @@ class VirusScannerListener $this->client = $client; } - /** * @param FileUploadCompleteEvent $event + * * @throws ConnectionException */ public function onFileUploadCompleted(FileUploadCompleteEvent $event) @@ -61,13 +60,15 @@ class VirusScannerListener } /** - * @return Client * @throws ConnectionException + * + * @return Client */ private function getClient(): Client { // Check clamd server's state $this->client->ping(); + return $this->client; } } diff --git a/Tests/Listener/VirusScannerListenerTest.php b/Tests/Listener/VirusScannerListenerTest.php index 590dbffb986e2b80e9fa48ada1241abf1679d0ee..ef71021d02c9d064b83ec68303ba92a86207f7da 100644 --- a/Tests/Listener/VirusScannerListenerTest.php +++ b/Tests/Listener/VirusScannerListenerTest.php @@ -40,7 +40,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase protected $file; /** - * {@inheritDoc} + * {@inheritdoc} */ protected function setUp() { @@ -93,7 +93,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Xenolope\Quahog\Exception\ConnectionException + * @expectedException \Xenolope\Quahog\Exception\ConnectionException */ public function testGetClientFailed() { @@ -106,5 +106,4 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase $this->client->expects($this->once())->method('ping')->willReturn(true); $this->listener->onFileUploadCompleted($this->event); } - }