Skip to content

Commit eee80f1

Browse files
committed
Check domain exmaple updated
1 parent 84b2a60 commit eee80f1

File tree

2 files changed

+47
-8
lines changed

2 files changed

+47
-8
lines changed

Examples/CheckDomain.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,39 @@
2929

3030
$response = $client->checkDomain($existingDomain);
3131
var_dump($response);
32+
33+
/**
34+
array(5) {
35+
'name' =>
36+
string(9) "spoje.net"
37+
'avail' =>
38+
int(0)
39+
'price' =>
40+
array(3) {
41+
'amount' =>
42+
string(6) "291.32"
43+
'premium' =>
44+
int(0)
45+
'currency' =>
46+
string(3) "CZK"
47+
}
48+
'price_renew' =>
49+
array(3) {
50+
'amount' =>
51+
string(6) "291.32"
52+
'premium' =>
53+
int(0)
54+
'currency' =>
55+
string(3) "CZK"
56+
}
57+
'price_transfer' =>
58+
array(3) {
59+
'amount' =>
60+
string(6) "291.32"
61+
'premium' =>
62+
int(0)
63+
'currency' =>
64+
string(3) "CZK"
65+
}
66+
}
67+
*/

src/Subreg/Client.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Client extends \Ease\Molecule
2727
/**
2828
* ClientLibrary version.
2929
*/
30-
public static string $libVersion = '1.0';
30+
public static string $libVersion = '1.2.0';
3131

3232
/**
3333
* Object Configuration.
@@ -42,7 +42,7 @@ class Client extends \Ease\Molecule
4242
/**
4343
* Authentification.
4444
*/
45-
public string $token = null;
45+
public string $token = '';
4646

4747
/**
4848
* Last call status code.
@@ -63,10 +63,10 @@ class Client extends \Ease\Molecule
6363

6464
/**
6565
* SubReg Client.
66-
* *
67-
* @param array $config
66+
*
67+
* @param array<string,string> $config
6868
*/
69-
public function __construct($config)
69+
public function __construct(array $config)
7070
{
7171
$this->config = $config;
7272
$this->soaper = new \SoapClient(
@@ -77,14 +77,17 @@ public function __construct($config)
7777
],
7878
);
7979
$this->setObjectName();
80+
$this->login();
8081
}
8182

8283
/**
8384
* Convert ENV keys to configuration.
8485
*
85-
* @return array
86+
* @param array<string,string> $env Env Data
87+
*
88+
* @return array<string,string>
8689
*/
87-
public static function env2conf(array $env)
90+
public static function env2conf(array $env): array
8891
{
8992
$conf = [];
9093

@@ -408,6 +411,6 @@ public function getDnsZone(string $zoneName)
408411
*/
409412
public function makeOrder(string $domain, string $type, array $data = [])
410413
{
411-
return $this->call('Make_Order', ['domain' => $zoneName, 'type' => $type, 'params' => $data]);
414+
return $this->call('Make_Order', ['domain' => $domain, 'type' => $type, 'params' => $data]);
412415
}
413416
}

0 commit comments

Comments
 (0)