Skip to content

Commit

Permalink
Fixing some code sniffing issues
Browse files Browse the repository at this point in the history
Code sniffer was not happy with the introduced changes
  • Loading branch information
DragonBe committed Jul 5, 2024
1 parent cb7ae19 commit d9193cb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@
"@test",
"@pmd"
]
},
"config": {
"allow-plugins": {
"infection/extension-installer": true
}
}
}
8 changes: 6 additions & 2 deletions src/Vies/HeartBeat.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ class HeartBeat
* @param int $port
* @param int $timeout
*/
public function __construct(?string $host = null, int $port = Vies::VIES_PORT, int $timeout = self::DEFAULT_TIMEOUT, ?string $path = null)
{
public function __construct(
?string $host = null,
int $port = Vies::VIES_PORT,
int $timeout = self::DEFAULT_TIMEOUT,
?string $path = null
) {
if (null !== $host) {
$this->setHost($host);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Vies/Vies.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ public function setOptions(array $options): self
*/
public function getHeartBeat(): HeartBeat
{
$this->heartBeat = $this->heartBeat ?? new HeartBeat(self::VIES_DOMAIN, self::VIES_PORT, HeartBeat::DEFAULT_TIMEOUT, self::VIES_PATH);
$this->heartBeat =
$this->heartBeat ??
new HeartBeat(self::VIES_DOMAIN, self::VIES_PORT, HeartBeat::DEFAULT_TIMEOUT, self::VIES_PATH);

return $this->heartBeat;
}
Expand Down
8 changes: 7 additions & 1 deletion tests/Vies/HeartBeatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ public function socketProvider(): array
return [
'Non-existing socket on localhost' => ['127.0.0.1', -1, 10, null, false],
'Socket 443 on ec.europe.eu' => [Vies::VIES_DOMAIN, Vies::VIES_PORT, 10, null, false],
'Socket 443 on ec.europe.eu'.Vies::VIES_PATH => [Vies::VIES_DOMAIN, Vies::VIES_PORT, 10, Vies::VIES_PATH, true],
'Socket 443 on ec.europe.eu'.Vies::VIES_PATH => [
Vies::VIES_DOMAIN,
Vies::VIES_PORT,
10,
Vies::VIES_PATH,
true
],
];
}

Expand Down

0 comments on commit d9193cb

Please sign in to comment.