@@ -23,6 +23,6 @@ |
||
23 | 23 | |
24 | 24 | private function quote(string $string) |
25 | 25 | { |
26 | - return "\"" . $string ."\""; |
|
26 | + return "\"" . $string . "\""; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | \ No newline at end of file |
@@ -23,6 +23,6 @@ |
||
23 | 23 | |
24 | 24 | private function quote(string $string) |
25 | 25 | { |
26 | - return "\"" . $string ."\""; |
|
26 | + return "\"" . $string . "\""; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | \ No newline at end of file |
@@ -23,6 +23,6 @@ |
||
23 | 23 | |
24 | 24 | private function quote(string $string) |
25 | 25 | { |
26 | - return "\"" . $string ."\""; |
|
26 | + return "\"" . $string . "\""; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | \ No newline at end of file |
@@ -23,6 +23,6 @@ |
||
23 | 23 | |
24 | 24 | private function quote(string $string) |
25 | 25 | { |
26 | - return "\"" . $string ."\""; |
|
26 | + return "\"" . $string . "\""; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | \ No newline at end of file |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | $response = $this->send(new StartControlChannelCommand()); |
23 | 23 | |
24 | - if($bufferSize = $response->get('bufferSize')){ |
|
24 | + if ($bufferSize = $response->get('bufferSize')) { |
|
25 | 25 | $this->bufferSize = (int) $bufferSize; |
26 | 26 | } |
27 | 27 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $response = $this->send(new StartSearchChannelCommand()); |
25 | 25 | |
26 | - if($bufferSize = $response->get('bufferSize')){ |
|
26 | + if ($bufferSize = $response->get('bufferSize')) { |
|
27 | 27 | $this->bufferSize = (int) $bufferSize; |
28 | 28 | } |
29 | 29 | |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | { |
35 | 35 | $response = $this->send(new QueryCommand($collection, $bucket, $terms)); |
36 | 36 | |
37 | - if(! $response->getStatus() == 'PENDING') { |
|
37 | + if (!$response->getStatus() == 'PENDING') { |
|
38 | 38 | throw new CommandFailedException; |
39 | 39 | } |
40 | 40 | |
41 | 41 | $results = $this->read(); |
42 | 42 | |
43 | - if(! $results->getStatus() == 'EVENT') { |
|
43 | + if (!$results->getStatus() == 'EVENT') { |
|
44 | 44 | throw new CommandFailedException; |
45 | 45 | } |
46 | 46 | |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | { |
52 | 52 | $response = $this->send(new SuggestCommand($collection, $bucket, $terms)); |
53 | 53 | |
54 | - if(! $response->getStatus() == 'PENDING') { |
|
54 | + if (!$response->getStatus() == 'PENDING') { |
|
55 | 55 | throw new CommandFailedException; |
56 | 56 | } |
57 | 57 | |
58 | 58 | $results = $this->read(); |
59 | 59 | |
60 | - if(! $results->getStatus() == 'EVENT') { |
|
60 | + if (!$results->getStatus() == 'EVENT') { |
|
61 | 61 | throw new CommandFailedException; |
62 | 62 | } |
63 | 63 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | public function disconnect() |
38 | 38 | { |
39 | 39 | $message = $this->client->send(new QuitChannelCommand); |
40 | - $this->client->disconnect(); |
|
40 | + $this->client->disconnect(); |
|
41 | 41 | return $message; |
42 | 42 | } |
43 | 43 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $this->client->connect(); |
30 | 30 | $response = $this->client->read(); |
31 | - if($response->getStatus() == "CONNECTED") { |
|
31 | + if ($response->getStatus() == "CONNECTED") { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | throw new ConnectionException; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $response = $this->send(new StartIngestChannelCommand); |
28 | 28 | |
29 | - if($bufferSize = $response->get('bufferSize')){ |
|
29 | + if ($bufferSize = $response->get('bufferSize')) { |
|
30 | 30 | $this->bufferSize = (int) $bufferSize; |
31 | 31 | } |
32 | 32 | |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | public function push(string $collection, string $bucket, string $object, string $text) |
37 | 37 | { |
38 | 38 | |
39 | - $chunks = $this->splitString($collection,$bucket, $object, $text); |
|
39 | + $chunks = $this->splitString($collection, $bucket, $object, $text); |
|
40 | 40 | |
41 | - if($text == "" || empty($chunks)) { |
|
41 | + if ($text == "" || empty($chunks)) { |
|
42 | 42 | throw new InvalidArgumentException("The parameter \$text is empty"); |
43 | 43 | } |
44 | 44 | foreach ($chunks as $chunk) { |
45 | 45 | $message = $this->send(new PushCommand($collection, $bucket, $object, $chunk)); |
46 | - if($message == false || $message == "") { |
|
46 | + if ($message == false || $message == "") { |
|
47 | 47 | throw new InvalidArgumentException(); |
48 | 48 | } |
49 | 49 | } |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | |
53 | 53 | public function pop(string $collection, string $bucket, string $object, string $text) |
54 | 54 | { |
55 | - $chunks = $this->splitString($collection,$bucket, $object, $text); |
|
55 | + $chunks = $this->splitString($collection, $bucket, $object, $text); |
|
56 | 56 | |
57 | 57 | foreach ($chunks as $chunk) { |
58 | 58 | $message = $this->send(new PopCommand($collection, $bucket, $object, $chunk)); |
59 | - if($message == false || $message == "") { |
|
59 | + if ($message == false || $message == "") { |
|
60 | 60 | throw new InvalidArgumentException(); |
61 | 61 | } |
62 | 62 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | return $message->getCount(); |
78 | 78 | } |
79 | 79 | |
80 | - public function flushb($collection,$bucket) |
|
80 | + public function flushb($collection, $bucket) |
|
81 | 81 | { |
82 | 82 | $message = $this->send(new FlushBucketCommand($collection, $bucket)); |
83 | 83 | return $message->getCount(); |
@@ -63,4 +63,4 @@ |
||
63 | 63 | return $this->get('count') ?? 0; |
64 | 64 | } |
65 | 65 | } |
66 | - |
|
67 | 66 | \ No newline at end of file |
67 | + |
|
68 | 68 | \ No newline at end of file |
@@ -19,21 +19,21 @@ discard block |
||
19 | 19 | { |
20 | 20 | $this->pieces = explode(" ", $this->message); |
21 | 21 | |
22 | - if(preg_match_all("/buffer\((\d+)\)/", $this->message, $matches)) { |
|
22 | + if (preg_match_all("/buffer\((\d+)\)/", $this->message, $matches)) { |
|
23 | 23 | $this->pieces['bufferSize'] = $matches[1][0]; |
24 | 24 | } |
25 | 25 | |
26 | 26 | $this->pieces['status'] = $this->pieces[0]; |
27 | 27 | unset($this->pieces[0]); |
28 | 28 | |
29 | - if($this->pieces['status'] === 'RESULT') { |
|
29 | + if ($this->pieces['status'] === 'RESULT') { |
|
30 | 30 | $this->pieces['count'] = (int) $this->pieces[1]; |
31 | 31 | unset($this->pieces[1]); |
32 | 32 | } |
33 | 33 | |
34 | - if($this->pieces['status'] === 'EVENT') { |
|
34 | + if ($this->pieces['status'] === 'EVENT') { |
|
35 | 35 | $this->pieces['query_key'] = $this->pieces[2]; |
36 | - $this->results = array_slice($this->pieces, 2, count($this->pieces)-4); |
|
36 | + $this->results = array_slice($this->pieces, 2, count($this->pieces) - 4); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | public function get($key) |
50 | 50 | { |
51 | - if(isset($this->pieces[$key])){ |
|
51 | + if (isset($this->pieces[$key])) { |
|
52 | 52 | return $this->pieces[$key]; |
53 | 53 | } |
54 | 54 | } |