diff --git a/php/examples/VaasExample/GetVerdictByFile.php b/php/examples/VaasExample/GetVerdictByFile.php index 65362a03..47782e24 100644 --- a/php/examples/VaasExample/GetVerdictByFile.php +++ b/php/examples/VaasExample/GetVerdictByFile.php @@ -14,8 +14,8 @@ ); $vaas = (new Vaas()) - ->WithAuthenticator($authenticator) - ->WithUrl(getenv("VAAS_URL") ?? "wss://gateway.production.vaas.gdatasecurity.de") + ->withAuthenticator($authenticator) + ->withUrl(getenv("VAAS_URL") ?? "wss://gateway.production.vaas.gdatasecurity.de") ->build(); $scanPath = getenv("SCAN_PATH"); diff --git a/php/examples/VaasExample/GetVerdictByHash.php b/php/examples/VaasExample/GetVerdictByHash.php index 627f5703..097de49f 100644 --- a/php/examples/VaasExample/GetVerdictByHash.php +++ b/php/examples/VaasExample/GetVerdictByHash.php @@ -13,8 +13,8 @@ getenv("TOKEN_URL") ?: "https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token" ); $vaas = (new Vaas()) - ->WithAuthenticator($authenticator) - ->WithUrl(getenv("VAAS_URL") ?? "wss://gateway.production.vaas.gdatasecurity.de") + ->withAuthenticator($authenticator) + ->withUrl(getenv("VAAS_URL") ?? "wss://gateway.production.vaas.gdatasecurity.de") ->build(); // EICAR diff --git a/php/examples/VaasExample/GetVerdictByUrl.php b/php/examples/VaasExample/GetVerdictByUrl.php index a0a76899..70757bf7 100644 --- a/php/examples/VaasExample/GetVerdictByUrl.php +++ b/php/examples/VaasExample/GetVerdictByUrl.php @@ -13,8 +13,8 @@ getenv("TOKEN_URL") ?: "https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token" ); $vaas = (new Vaas()) - ->WithAuthenticator($authenticator) - ->WithUrl(getenv("VAAS_URL") ?? "wss://gateway.production.vaas.gdatasecurity.de") + ->withAuthenticator($authenticator) + ->withUrl(getenv("VAAS_URL") ?? "wss://gateway.production.vaas.gdatasecurity.de") ->build(); // EICAR diff --git a/php/examples/wordpress/src/gd-scan/Vaas/Client.php b/php/examples/wordpress/src/gd-scan/Vaas/Client.php index 3712880b..7266a3d5 100644 --- a/php/examples/wordpress/src/gd-scan/Vaas/Client.php +++ b/php/examples/wordpress/src/gd-scan/Vaas/Client.php @@ -17,7 +17,7 @@ public function __construct() getenv("TOKEN_URL") ?: "https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token" ); $this->vaas = (new Vaas()) - ->WithAuthenticator($authenticator) + ->withAuthenticator($authenticator) ->build(); } diff --git a/php/src/vaas/Vaas.php b/php/src/vaas/Vaas.php index c62bc51f..be5a458d 100644 --- a/php/src/vaas/Vaas.php +++ b/php/src/vaas/Vaas.php @@ -47,37 +47,37 @@ public function __destruct() { } } - public function WithOptions(VaasOptions $options): self + public function withOptions(VaasOptions $options): self { $this->options = $options; return $this; } - public function WithHtttpClient(HttpClient $httpClient): self + public function withHtttpClient(HttpClient $httpClient): self { $this->httpClient = $httpClient; return $this; } - public function WithAuthenticator(AuthenticatorInterface $authenticator): self + public function withAuthenticator(AuthenticatorInterface $authenticator): self { $this->authenticator = $authenticator; return $this; } - public function WithLogger(LoggerInterface $logger): self + public function withLogger(LoggerInterface $logger): self { $this->logger = $logger; return $this; } - public function WithUrl(string $vaasUrl): self + public function withUrl(string $vaasUrl): self { $this->vaasUrl = $vaasUrl; return $this; } - public function WithVaasConnection(VaasConnection $vaasConnection): self + public function withVaasConnection(VaasConnection $vaasConnection): self { $this->vaasConnection = $vaasConnection; return $this; @@ -90,14 +90,14 @@ public function build(): self } if (!isset($this->vaasConnection) && isset($this->authenticator)) { $this->vaasConnection = (new VaasConnection()) - ->WithAuthenticator($this->authenticator) - ->WithUrl($this->vaasUrl) - ->WithLogger($this->logger) + ->withAuthenticator($this->authenticator) + ->withUrl($this->vaasUrl) + ->withLogger($this->logger) ->build(); } else if (!isset($this->vaasConnection)) { $this->vaasConnection = (new VaasConnection()) - ->WithUrl($this->vaasUrl) - ->WithLogger($this->logger) + ->withUrl($this->vaasUrl) + ->withLogger($this->logger) ->build(); } if (!isset($this->options)) { diff --git a/php/src/vaas/VaasConnection.php b/php/src/vaas/VaasConnection.php index 8410e78e..91b5ba1c 100644 --- a/php/src/vaas/VaasConnection.php +++ b/php/src/vaas/VaasConnection.php @@ -54,27 +54,27 @@ public function close(): void { $this->loop->ignore(); } - public function WithAuthenticator(AuthenticatorInterface $authenticator): VaasConnection { + public function withAuthenticator(AuthenticatorInterface $authenticator): VaasConnection { $this->authenticator = $authenticator; return $this; } - public function WithConnection(WebsocketConnection $WebSocketClient): VaasConnection { + public function withConnection(WebsocketConnection $WebSocketClient): VaasConnection { $this->WebSocketClient = $WebSocketClient; return $this; } - public function WithUrl(string $url): VaasConnection { + public function withUrl(string $url): VaasConnection { $this->url = $url; return $this; } - public function WithLogger(LoggerInterface $logger): VaasConnection { + public function withLogger(LoggerInterface $logger): VaasConnection { $this->logger = $logger; return $this; } - public function WithTimeout(int $timeoutInSeconds): VaasConnection { + public function withTimeout(int $timeoutInSeconds): VaasConnection { $this->waitTimeoutInSeconds = $timeoutInSeconds; return $this; } diff --git a/php/tests/vaas/ProtocolTest.php b/php/tests/vaas/ProtocolTest.php index 9a5fe53e..753aaa95 100644 --- a/php/tests/vaas/ProtocolTest.php +++ b/php/tests/vaas/ProtocolTest.php @@ -42,12 +42,12 @@ public function testConnectionGetsClosedAfterConnecting_ThrowsVaasConnectionClos $fakeWebsocket->method('receive') ->willReturn(WebsocketMessage::fromText('{"kind": "AuthResponse", "success": true, "session_id": "id"}')); $vaasConnection = (new VaasConnection()) - ->WithConnection($fakeWebsocket) + ->withConnection($fakeWebsocket) ->build(); $vaas = (new Vaas()) - ->WithUrl("wws://url.de") - ->WithVaasConnection($vaasConnection) + ->withUrl("wws://url.de") + ->withVaasConnection($vaasConnection) ->build(); $vaas->Connect("valid"); $vaas->ForSha256("000005c43196142f01d615a67b7da8a53cb0172f8e9317a2ec9a0a39a1da6fe8"); @@ -64,12 +64,12 @@ public function testConnectionGetsClosedBeforeConnect_ThrowsVaasConnectionClosed $fakeWebsocket->method('receive') ->willReturn(WebsocketMessage::fromText('{"kind": "AuthResponse", "success": true, "session_id": "id"}')); $vaasConnection = (new VaasConnection()) - ->WithConnection($fakeWebsocket) + ->withConnection($fakeWebsocket) ->build(); $vaas = (new Vaas()) - ->WithUrl("wws://url.de") - ->WithVaasConnection($vaasConnection) + ->withUrl("wws://url.de") + ->withVaasConnection($vaasConnection) ->build(); $vaas->Connect("valid"); } diff --git a/php/tests/vaas/VaasTest.php b/php/tests/vaas/VaasTest.php index ea224001..814b5386 100644 --- a/php/tests/vaas/VaasTest.php +++ b/php/tests/vaas/VaasTest.php @@ -80,9 +80,9 @@ public function setUp(): void private function _getVaas(bool $useCache = false, bool $useHashLookup = true, LoggerInterface $logger = null): Vaas { return (new Vaas()) - ->WithUrl($_ENV["VAAS_URL"]) - ->WithLogger($logger ?? $this->_getDebugLogger()) - ->WithOptions(new VaasOptions($useCache, $useHashLookup)) + ->withUrl($_ENV["VAAS_URL"]) + ->withLogger($logger ?? $this->_getDebugLogger()) + ->withOptions(new VaasOptions($useCache, $useHashLookup)) ->build(); }