Completed
Push — master ( a91f17...e1c233 )
by Maik
01:59
created
src/Generics/Socket/ClientSocket.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $this->handle = $clientHandle;
37 37
         $this->conntected = false;
38 38
         
39
-        if (! is_resource($clientHandle)) {
39
+        if (!is_resource($clientHandle)) {
40 40
             parent::__construct($endpoint);
41 41
         }
42 42
     }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         if (!is_resource($this->handle)) {
52 52
             throw new SocketException("Socket is not available");
53 53
         }
54
-        if (! @socket_connect($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
54
+        if (!@socket_connect($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
55 55
             $code = socket_last_error($this->handle);
56 56
             throw new SocketException(socket_strerror($code), array(), $code);
57 57
         }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function disconnect()
67 67
     {
68
-        if (! $this->conntected) {
68
+        if (!$this->conntected) {
69 69
             throw new SocketException("Socket is not connected");
70 70
         }
71 71
         
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function isWriteable():bool
101 101
     {
102
-        if (! $this->isConnected()) {
102
+        if (!$this->isConnected()) {
103 103
             return false;
104 104
         }
105 105
         
Please login to merge, or discard this patch.
src/Generics/Socket/SecureClientSocket.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->handle = $clientHandle;
36 36
         $this->conntected = false;
37 37
         
38
-        if (! is_resource($clientHandle)) {
38
+        if (!is_resource($clientHandle)) {
39 39
             parent::__construct($endpoint);
40 40
         }
41 41
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function disconnect()
59 59
     {
60
-        if (! $this->conntected) {
60
+        if (!$this->conntected) {
61 61
             throw new SocketException("Socket is not connected");
62 62
         }
63 63
         
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function isWriteable(): bool
93 93
     {
94
-        if (! $this->isConnected()) {
94
+        if (!$this->isConnected()) {
95 95
             return false;
96 96
         }
97 97
         
Please login to merge, or discard this patch.
src/Generics/Socket/SecureSocket.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function read($length = 1, $offset = null): string
62 62
     {
63
-        return stream_get_contents($this->handle, $length, $offset === null ? - 1 : intval($offset));
63
+        return stream_get_contents($this->handle, $length, $offset === null ? -1 : intval($offset));
64 64
     }
65 65
 
66 66
     /**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function isOpen(): bool
72 72
     {
73
-        return is_resource($this->handle) && ! feof($this->handle);
73
+        return is_resource($this->handle) && !feof($this->handle);
74 74
     }
75 75
 
76 76
     /**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function ready(): bool
92 92
     {
93
-        if (! is_resource($this->handle)) {
93
+        if (!is_resource($this->handle)) {
94 94
             return false;
95 95
         }
96 96
         
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             return false;
111 111
         }
112 112
         
113
-        if (! in_array($this->handle, $read)) {
113
+        if (!in_array($this->handle, $read)) {
114 114
             return false;
115 115
         }
116 116
         
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      */
170 170
     public function write($buffer)
171 171
     {
172
-        if(!$this->isWriteable()) {
172
+        if (!$this->isWriteable()) {
173 173
             throw new SocketException("Stream is not ready for writing");
174 174
         }
175 175
         $len = strlen($buffer);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public function isWriteable(): bool
195 195
     {
196
-        if (! is_resource($this->handle)) {
196
+        if (!is_resource($this->handle)) {
197 197
             return false;
198 198
         }
199 199
         
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             return false;
214 214
         }
215 215
         
216
-        if (! in_array($this->handle, $write)) {
216
+        if (!in_array($this->handle, $write)) {
217 217
             return false;
218 218
         }
219 219
         
Please login to merge, or discard this patch.
src/Generics/Socket/Socket.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $this->handle = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
56 56
         
57
-        if (! is_resource($this->handle)) {
57
+        if (!is_resource($this->handle)) {
58 58
             $code = socket_last_error();
59 59
             throw new SocketException(socket_strerror($code), array(), $code);
60 60
         }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function ready(): bool
90 90
     {
91
-        if (! is_resource($this->handle)) {
91
+        if (!is_resource($this->handle)) {
92 92
             return false;
93 93
         }
94 94
         
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             return false;
110 110
         }
111 111
         
112
-        if (! in_array($this->handle, $read)) {
112
+        if (!in_array($this->handle, $read)) {
113 113
             return false;
114 114
         }
115 115
         
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public function isWriteable(): bool
125 125
     {
126
-        if (! is_resource($this->handle)) {
126
+        if (!is_resource($this->handle)) {
127 127
             return false;
128 128
         }
129 129
         
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             return false;
145 145
         }
146 146
         
147
-        if (! in_array($this->handle, $write)) {
147
+        if (!in_array($this->handle, $write)) {
148 148
             return false;
149 149
         }
150 150
         
Please login to merge, or discard this patch.
src/Generics/Client/Session.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
      */
69 69
     public function get($key)
70 70
     {
71
-        if (! isset($this->sessionContainer[$key])) {
71
+        if (!isset($this->sessionContainer[$key])) {
72 72
             return null;
73 73
         }
74 74
         
Please login to merge, or discard this patch.
src/Generics/Client/HttpHeadersTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,23 +74,23 @@
 block discarded – undo
74 74
      */
75 75
     private function adjustHeaders($requestType)
76 76
     {
77
-        if (! array_key_exists('Accept', $this->headers) && $requestType != 'HEAD') {
77
+        if (!array_key_exists('Accept', $this->headers) && $requestType != 'HEAD') {
78 78
             $this->setHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
79 79
         }
80 80
         
81
-        if (! array_key_exists('Accept-Language', $this->headers) && $requestType != 'HEAD') {
81
+        if (!array_key_exists('Accept-Language', $this->headers) && $requestType != 'HEAD') {
82 82
             $this->setHeader('Accept-Language', 'en-US;q=0.7,en;q=0.3');
83 83
         }
84 84
         
85
-        if (! array_key_exists('User-Agent', $this->headers) && $requestType != 'HEAD') {
85
+        if (!array_key_exists('User-Agent', $this->headers) && $requestType != 'HEAD') {
86 86
             $this->setHeader('User-Agent', 'phpGenerics 1.0');
87 87
         }
88 88
         
89
-        if (! array_key_exists('Connection', $this->headers) || strlen($this->headers['Connection']) == 0) {
89
+        if (!array_key_exists('Connection', $this->headers) || strlen($this->headers['Connection']) == 0) {
90 90
             $this->adjustConnectionHeader($requestType);
91 91
         }
92 92
         
93
-        if (! array_key_exists('Accept-Encoding', $this->headers)) {
93
+        if (!array_key_exists('Accept-Encoding', $this->headers)) {
94 94
             if (function_exists('gzinflate')) {
95 95
                 $encoding = 'gzip, deflate';
96 96
             } else {
Please login to merge, or discard this patch.
src/Generics/Streams/Interceptor/StreamInterceptor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      * @param bool $closing
24 24
      * @return int
25 25
      */
26
-    public function filter($in, $out, int &$consumed, bool $closing): int;
26
+    public function filter($in, $out, int & $consumed, bool $closing): int;
27 27
 
28 28
     /**
29 29
      * Called when closing the filter
Please login to merge, or discard this patch.
src/Generics/Streams/Interceptor/CachedStreamInterceptor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      * {@inheritdoc}
34 34
      * @see \Generics\Streams\Interceptor\StreamInterceptor::filter()
35 35
      */
36
-    public function filter($in, $out, int &$consumed, bool $closing): int
36
+    public function filter($in, $out, int & $consumed, bool $closing): int
37 37
     {
38 38
         if ($closing) {
39 39
             return PSFS_FEED_ME;
Please login to merge, or discard this patch.
src/Generics/Client/HttpClientTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             'rqtype' => $requestType,
142 142
             'path' => $this->path,
143 143
             'proto' => $this->protocol,
144
-            'query' => (strlen($this->queryString) ? '?' . $this->queryString : '')
144
+            'query' => (strlen($this->queryString) ? '?'.$this->queryString : '')
145 145
         ));
146 146
         
147 147
         // Add the host part
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         $numBytes = 1;
197 197
         $start = time();
198 198
         while (true) {
199
-            if (! $this->checkConnection($start)) {
199
+            if (!$this->checkConnection($start)) {
200 200
                 continue;
201 201
             }
202 202
             
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $start = time(); // we have readen something => adjust timeout start point
210 210
             $tmp .= $c;
211 211
             
212
-            if (! $delimiterFound) {
212
+            if (!$delimiterFound) {
213 213
                 $this->handleHeader($delimiterFound, $numBytes, $tmp);
214 214
             }
215 215
             
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         }
231 231
         
232 232
         $size = $this->payload->count();
233
-        if($size == 0) {
233
+        if ($size == 0) {
234 234
             return;
235 235
         }
236 236
         // Set pointer to start
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         
322 322
         $ms = $this->appendPayloadToRequest($ms);
323 323
         
324
-        if (! $this->isConnected()) {
324
+        if (!$this->isConnected()) {
325 325
             $this->connect();
326 326
         }
327 327
         
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
      */
347 347
     private function checkConnection($start): bool
348 348
     {
349
-        if (! $this->ready()) {
349
+        if (!$this->ready()) {
350 350
             if (time() - $start > $this->timeout) {
351 351
                 $this->disconnect();
352 352
                 throw new HttpException("Connection timed out!");
Please login to merge, or discard this patch.