1 | <?php |
||
7 | class BotScout |
||
8 | { |
||
9 | protected $client; |
||
10 | |||
11 | protected $baseUrl = 'http://botscout.com/test/'; |
||
12 | |||
13 | private $apiKey; |
||
14 | |||
15 | /** |
||
16 | * @param \GuzzleHttp\Client $client |
||
17 | * @param string $apiKey |
||
18 | */ |
||
19 | public function __construct(Client $client, string $apiKey) |
||
24 | |||
25 | /** |
||
26 | * Test matches all parameters at once. |
||
27 | * |
||
28 | * @param string $name |
||
29 | * @param string $mail |
||
30 | * @param string $ip |
||
31 | * |
||
32 | * @return BotScoutResponse |
||
33 | */ |
||
34 | public function multi(string $name = null, string $mail = null, string $ip = null) |
||
38 | |||
39 | /** |
||
40 | * Test matches a single item against all fields in the botscout database. |
||
41 | * |
||
42 | * @param string $all |
||
43 | * |
||
44 | * @return BotScoutResponse |
||
45 | */ |
||
46 | public function all(string $all) |
||
50 | |||
51 | /** |
||
52 | * Test matches a name. |
||
53 | * |
||
54 | * @param string $name |
||
55 | * |
||
56 | * @return BotScoutResponse |
||
57 | */ |
||
58 | public function name(string $name = null) |
||
62 | |||
63 | /** |
||
64 | * Test matches an email. |
||
65 | * |
||
66 | * @param string $mail |
||
67 | * |
||
68 | * @return BotScoutResponse |
||
69 | */ |
||
70 | public function mail(string $mail = null) |
||
74 | |||
75 | /** |
||
76 | * Test matches an ip. |
||
77 | * |
||
78 | * @param string $ip |
||
79 | * |
||
80 | * @return BotScoutResponse |
||
81 | */ |
||
82 | public function ip(string $ip = null) |
||
86 | |||
87 | /** |
||
88 | * @param array $query |
||
89 | * |
||
90 | * @return BotScoutResponse |
||
91 | */ |
||
92 | public function makeRequest(string $type = null, array $query = []) |
||
105 | |||
106 | /** |
||
107 | * @param string $response |
||
108 | * |
||
109 | * @return BotScoutResponse |
||
110 | */ |
||
111 | private function decodeResponse(string $response) |
||
119 | } |
||
120 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: