diff options
author | Robin Appelman <robin@icewind.nl> | 2022-04-13 15:32:12 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-04-13 15:46:26 +0300 |
commit | 64f29ad66bed0d846b3a2e3491be53c416e893a0 (patch) | |
tree | f991268219774c53117ff30f63fdfa06dea32b29 /lib | |
parent | 59c4e28885e689c683d599ff97782f1ccc5731e1 (diff) |
7.3 compat
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AppConfig.php | 10 | ||||
-rw-r--r-- | lib/ICAP/ICAPClient.php | 9 | ||||
-rw-r--r-- | lib/ICAP/ICAPRequest.php | 4 | ||||
-rw-r--r-- | lib/ICAP/IcapResponse.php | 9 | ||||
-rw-r--r-- | lib/ICAP/IcapResponseStatus.php | 9 | ||||
-rw-r--r-- | lib/Scanner/ICAP.php | 16 |
6 files changed, 36 insertions, 21 deletions
diff --git a/lib/AppConfig.php b/lib/AppConfig.php index 3092de8..febd702 100644 --- a/lib/AppConfig.php +++ b/lib/AppConfig.php @@ -37,10 +37,12 @@ use OCP\IConfig; * @method null setAvStreamMaxLength(int $length) */ class AppConfig { - private string $appName = 'files_antivirus'; - private IConfig $config; + /** @var string */ + private $appName = 'files_antivirus'; + /** @var IConfig */ + private $config; - private array $defaults = [ + private $defaults = [ 'av_mode' => 'executable', 'av_socket' => '/var/run/clamav/clamd.ctl', 'av_host' => '', @@ -80,7 +82,7 @@ class AppConfig { * Get full commandline * @return string */ - public function getCmdline(): string { + public function getCmdline(): string { $avCmdOptions = $this->getAvCmdOptions(); $shellArgs = []; diff --git a/lib/ICAP/ICAPClient.php b/lib/ICAP/ICAPClient.php index 73346ae..4fc96d7 100644 --- a/lib/ICAP/ICAPClient.php +++ b/lib/ICAP/ICAPClient.php @@ -26,9 +26,12 @@ namespace OCA\Files_Antivirus\ICAP; use RuntimeException; class ICAPClient { - private string $host; - private int $port; - private int $connectTimeout; + /** @var string */ + private $host; + /** @var int */ + private $port; + /** @var int */ + private $connectTimeout; public function __construct(string $host, int $port, int $connectTimeout) { $this->host = $host; diff --git a/lib/ICAP/ICAPRequest.php b/lib/ICAP/ICAPRequest.php index 2b3fc97..5885834 100644 --- a/lib/ICAP/ICAPRequest.php +++ b/lib/ICAP/ICAPRequest.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace OCA\Files_Antivirus\ICAP; class ICAPRequest { - const USER_AGENT = 'NC-ICAP-CLIENT/0.5.0'; + public const USER_AGENT = 'NC-ICAP-CLIENT/0.5.0'; /** @var resource */ public $stream; @@ -44,7 +44,7 @@ class ICAPRequest { $headers['Connection'] = 'close'; } - $requestHeadersLength = array_sum(array_map(function(string $header) { + $requestHeadersLength = array_sum(array_map(function (string $header) { return strlen($header) + 2; }, $requestHeaders)) + 2; diff --git a/lib/ICAP/IcapResponse.php b/lib/ICAP/IcapResponse.php index 518ccce..54c59d1 100644 --- a/lib/ICAP/IcapResponse.php +++ b/lib/ICAP/IcapResponse.php @@ -24,9 +24,12 @@ declare(strict_types=1); namespace OCA\Files_Antivirus\ICAP; class IcapResponse { - private IcapResponseStatus $status; - private array $headers; - private array $responseHeaders; + /** @var IcapResponseStatus */ + private $status; + /** @var array */ + private $headers; + /** @var array */ + private $responseHeaders; public function __construct( IcapResponseStatus $status, diff --git a/lib/ICAP/IcapResponseStatus.php b/lib/ICAP/IcapResponseStatus.php index bc019c8..e1ca929 100644 --- a/lib/ICAP/IcapResponseStatus.php +++ b/lib/ICAP/IcapResponseStatus.php @@ -24,9 +24,12 @@ declare(strict_types=1); namespace OCA\Files_Antivirus\ICAP; class IcapResponseStatus { - private string $version; - private int $code; - private string $status; + /** @var string */ + private $version; + /** @var int */ + private $code; + /** @var string */ + private $status; public function __construct(string $version, int $code, string $status) { $this->version = $version; diff --git a/lib/Scanner/ICAP.php b/lib/Scanner/ICAP.php index 617554b..2821076 100644 --- a/lib/Scanner/ICAP.php +++ b/lib/Scanner/ICAP.php @@ -28,15 +28,19 @@ use OCA\Files_Antivirus\ICAP\ICAPClient; use OCA\Files_Antivirus\ICAP\ICAPRequest; use OCA\Files_Antivirus\Status; use OCA\Files_Antivirus\StatusFactory; -use OCP\Http\Client\IClientService; use OCP\ILogger; class ICAP extends ScannerBase { - private ICAPClient $icapClient; - private ?ICAPRequest $request; - private string $service; - private string $virusHeader; - private int $chunkSize; + /** @var ICAPClient */ + private $icapClient; + /** @var ?ICAPRequest */ + private $request; + /** @var string */ + private $service; + /** @var string */ + private $virusHeader; + /** @var int */ + private $chunkSize; public function __construct( AppConfig $config, |