Skip to content

Commit 791a00e

Browse files
committed
Edit docs and add timeout test
1 parent 89e2477 commit 791a00e

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

CheckSSL.php

+5
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ public function check(): ?array
9999
return $this->getResults();
100100
}
101101

102+
public function getTimeout(): float
103+
{
104+
return $this->timeOut;
105+
}
106+
102107
/**
103108
* @param resource|false $siteStream
104109
* @return array

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ print_r($example3);
120120
```
121121

122122

123-
#### Custom output format
123+
#### Custom output format / custom timeout
124124

125125
``` php
126126
<?php
@@ -134,8 +134,9 @@ $data = [ 'https://symfony.com', 'https://getlaminas.org'];
134134
$dateFormat = 'U';
135135
$formatString = 'd-m-Y H:i:s';
136136
$timeZone = 'America/Sao_Paulo';
137+
$timeOut = 30
137138

138-
$checkSLL = new CheckSSL($data, $dateFormat, $formatString, $timeZone);
139+
$checkSLL = new CheckSSL($data, $dateFormat, $formatString, $timeZone, $timeOut);
139140

140141
print_r($checkSLL->check());
141142
```

tests/CheckSSLTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ public function testCustomDate() {
5858
);
5959
}
6060

61+
public function testCustomTimeout() {
62+
63+
$checkSLL = new CheckSSL([], '', '', '', 60.0);
64+
65+
$this->assertEquals(60.0, $checkSLL->getTimeout());
66+
}
67+
6168
public function test() {
6269

6370
$this->expectException(TypeError::class);

0 commit comments

Comments
 (0)