Skip to content
Snippets Groups Projects

fix(class): add interface

Files
2
+ 3
19
@@ -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();
Loading