Commit cd985e6a authored by Predhumeau Manon's avatar Predhumeau Manon Committed by Guillaume Perréal
Browse files

CS.

Showing with 7 additions and 7 deletions
+7 -7
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
namespace Irstea\FileUploadBundle\Listener; namespace Irstea\FileUploadBundle\Listener;
use Xenolope\Quahog\Client;
use Irstea\FileUploadBundle\Event\FileUploadCompleteEvent; use Irstea\FileUploadBundle\Event\FileUploadCompleteEvent;
use Irstea\FileUploadBundle\Exception\RejectedFileException; use Irstea\FileUploadBundle\Exception\RejectedFileException;
use Xenolope\Quahog\Client;
use Xenolope\Quahog\Exception\ConnectionException; use Xenolope\Quahog\Exception\ConnectionException;
/** /**
...@@ -21,7 +21,6 @@ class VirusScannerListener ...@@ -21,7 +21,6 @@ class VirusScannerListener
*/ */
private $client; private $client;
/** /**
* @param Client $client * @param Client $client
*/ */
...@@ -30,9 +29,9 @@ class VirusScannerListener ...@@ -30,9 +29,9 @@ class VirusScannerListener
$this->client = $client; $this->client = $client;
} }
/** /**
* @param FileUploadCompleteEvent $event * @param FileUploadCompleteEvent $event
*
* @throws ConnectionException * @throws ConnectionException
*/ */
public function onFileUploadCompleted(FileUploadCompleteEvent $event) public function onFileUploadCompleted(FileUploadCompleteEvent $event)
...@@ -61,13 +60,15 @@ class VirusScannerListener ...@@ -61,13 +60,15 @@ class VirusScannerListener
} }
/** /**
* @return Client
* @throws ConnectionException * @throws ConnectionException
*
* @return Client
*/ */
private function getClient(): Client private function getClient(): Client
{ {
// Check clamd server's state // Check clamd server's state
$this->client->ping(); $this->client->ping();
return $this->client; return $this->client;
} }
} }
...@@ -40,7 +40,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase ...@@ -40,7 +40,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
protected $file; protected $file;
/** /**
* {@inheritDoc} * {@inheritdoc}
*/ */
protected function setUp() protected function setUp()
{ {
...@@ -93,7 +93,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase ...@@ -93,7 +93,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException Xenolope\Quahog\Exception\ConnectionException * @expectedException \Xenolope\Quahog\Exception\ConnectionException
*/ */
public function testGetClientFailed() public function testGetClientFailed()
{ {
...@@ -106,5 +106,4 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase ...@@ -106,5 +106,4 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
$this->client->expects($this->once())->method('ping')->willReturn(true); $this->client->expects($this->once())->method('ping')->willReturn(true);
$this->listener->onFileUploadCompleted($this->event); $this->listener->onFileUploadCompleted($this->event);
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment