Skip to content

Commit 5f7da23

Browse files
Enable setting uri and key
1 parent 9b1a634 commit 5f7da23

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/Seq.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ class Seq
1717
*/
1818
protected $validator;
1919

20-
public function __construct()
20+
/**
21+
* Seq constructor.
22+
*
23+
* @param string $host
24+
* @param string $key
25+
*/
26+
public function __construct($host, $key)
2127
{
2228
$this->client = new Client([
23-
'base_uri' => 'http://0.0.0.0:6060'
29+
'base_uri' => 'http://' . $host . ':6060',
2430
]);
25-
$this->validator = new HMAC('an example key');
31+
$this->validator = new HMAC($key);
2632
}
2733

2834
/**

tests/Integration/SeqTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SeqTest extends TestCase
1515

1616
public function setUp()
1717
{
18-
$this->instance = new Seq();
18+
$this->instance = new Seq('http://0.0.0.0:6060', 'an example key');
1919
do {
2020
$response = $this->instance->get();
2121
} while ($response);

tests/Unit/SeqTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SeqTest extends TestCase
2020

2121
public function setUp()
2222
{
23-
$this->instance = new Seq();
23+
$this->instance = new Seq('http://0.0.0.0:6060', 'an example key');
2424
}
2525

2626
public function testInit()

0 commit comments

Comments
 (0)