Skip to content
Snippets Groups Projects
Commit e38b64fc authored by Mathew Winstone's avatar Mathew Winstone Committed by Vladimir Roudakov
Browse files

Issue #3403522 by minoroffense, solideogloria, jannakha: Scanner class doesn't...

Issue #3403522 by minoroffense, solideogloria, jannakha: Scanner class doesn't implement the scanner interface
parent e49bc854
No related branches found
No related tags found
1 merge request!8fix(class): add interface
......@@ -13,7 +13,7 @@ use Drupal\clamav\Config;
* Passes the methods "scan" and "version" to a specific handler, according to
* the configuration.
*/
class Scanner {
class Scanner implements ScannerInterface {
// Constants defining the infection state of a specific file.
const FILE_IS_UNCHECKED = -1;
......@@ -139,21 +139,8 @@ class Scanner {
return $scannable;
}
/**
* Scan a file for viruses.
*
* @param Drupal\file\FileInterface $file
* The file to scan for viruses.
*
* @return int
* One of the following class constants:
* - CLAMAV_SCANRESULT_UNCHECKED
* The file was not scanned. The ClamAV service may be unavailable.
* - CLAMAV_SCANRESULT_CLEAN
* The file was scanned, and no infection was found.
* - CLAMAV_SCANRESULT_INFECTED
* The file was scanned, and found to be infected with a virus.
* {@inheritdoc}
*/
public function scan(FileInterface $file) {
// Empty files are never infected.
......@@ -201,10 +188,7 @@ class Scanner {
}
/**
* The version of the ClamAV service.
*
* @return string
* The version number provided by ClamAV.
* {@inheritdoc}
*/
public function version() {
return $this->scanner->version();
......
......@@ -13,7 +13,7 @@ interface ScannerInterface {
/**
* Constructor.
*
* @param Drupal\clamav\Config $config
* @param \Drupal\clamav\Config $config
* Configuration to use.
*/
public function __construct(Config $config);
......@@ -21,7 +21,7 @@ interface ScannerInterface {
/**
* Scan a file.
*
* @param Drupal\file\FileInterface $file
* @param \Drupal\file\FileInterface $file
* The file to scan for viruses.
*
* @return int
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment