Completed
Push — master ( 6812a4...1fb4f2 )
by Maik
01:39
created
src/Generics/Streams/FileInputStream.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function __construct($file)
52 52
     {
53
-        if (! file_exists($file)) {
53
+        if (!file_exists($file)) {
54 54
             throw new FileNotFoundException("File {file} could not be found", array(
55 55
                 'file' => $file
56 56
             ));
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         $this->handle = fopen($file, "rb");
60 60
 
61
-        if (! $this->ready()) {
61
+        if (!$this->ready()) {
62 62
             throw new StreamException("Could not open {file} for reading", array(
63 63
                 'file' => $file
64 64
             ));
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function ready()
103 103
     {
104
-        return is_resource($this->handle) && ! feof($this->handle);
104
+        return is_resource($this->handle) && !feof($this->handle);
105 105
     }
106 106
 
107 107
     /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function read($length = 1, $offset = null)
113 113
     {
114
-        if (! $this->ready()) {
114
+        if (!$this->ready()) {
115 115
             throw new StreamException("Stream is not ready!");
116 116
         }
117 117
 
Please login to merge, or discard this patch.
src/Generics/Streams/FileOutputStream.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,16 +58,16 @@  discard block
 block discarded – undo
58 58
         $mode = "wb";
59 59
 
60 60
         if (file_exists($file)) {
61
-            if (! $append) {
61
+            if (!$append) {
62 62
                 throw new FileExistsException("File $file already exists!");
63 63
             }
64 64
 
65
-            if (! is_writable($file)) {
65
+            if (!is_writable($file)) {
66 66
                 throw new NoAccessException("Cannot write to file $file");
67 67
             }
68 68
             $mode = "ab";
69 69
         } else {
70
-            if (! is_writable(dirname($file))) {
70
+            if (!is_writable(dirname($file))) {
71 71
                 throw new NoAccessException("Cannot write to file {file}", array(
72 72
                     'file' => $file
73 73
                 ));
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         $this->handle = fopen($file, $mode);
78 78
 
79
-        if (! $this->ready()) {
79
+        if (!$this->ready()) {
80 80
             throw new StreamException("Could not open {file} for writing", array(
81 81
                 'file' => $file
82 82
             ));
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function write($buffer)
118 118
     {
119
-        if (! $this->ready()) {
119
+        if (!$this->ready()) {
120 120
             throw new StreamException("Stream is not open!");
121 121
         }
122 122
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function count()
160 160
     {
161
-        if (! $this->ready()) {
161
+        if (!$this->ready()) {
162 162
             throw new StreamException("Stream is not open!");
163 163
         }
164 164
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function flush()
194 194
     {
195
-        if (! $this->ready()) {
195
+        if (!$this->ready()) {
196 196
             throw new StreamException("Stream is not open!");
197 197
         }
198 198
 
Please login to merge, or discard this patch.
src/Generics/Socket/ServerSocket.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function __construct(Endpoint $endpoint)
33 33
     {
34 34
         parent::__construct($endpoint);
35
-        if (! @socket_set_option($this->handle, SOL_SOCKET, SO_REUSEADDR, 1)) {
35
+        if (!@socket_set_option($this->handle, SOL_SOCKET, SO_REUSEADDR, 1)) {
36 36
             $code = socket_last_error($this->handle);
37 37
             throw new SocketException(socket_strerror($code), $code);
38 38
         }
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
         while ($runOn) {
55 55
             $clientHandle = @socket_accept($this->handle);
56 56
 
57
-            if (! is_resource($clientHandle)) {
57
+            if (!is_resource($clientHandle)) {
58 58
                 $code = socket_last_error($this->handle);
59 59
                 throw new SocketException(socket_strerror($code), $code);
60 60
             }
61 61
 
62 62
             $address = null;
63 63
             $port = 0;
64
-            if (! @socket_getpeername($clientHandle, $address, $port)) {
64
+            if (!@socket_getpeername($clientHandle, $address, $port)) {
65 65
                 $code = socket_last_error($clientHandle);
66 66
                 throw new SocketException(socket_strerror($code), $code);
67 67
             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     private function bind()
81 81
     {
82
-        if (! @socket_bind($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
82
+        if (!@socket_bind($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
83 83
             $code = socket_last_error($this->handle);
84 84
             throw new SocketException(socket_strerror($code), $code);
85 85
         }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     private function listen()
94 94
     {
95
-        if (! @socket_listen($this->handle, 5)) {
95
+        if (!@socket_listen($this->handle, 5)) {
96 96
             $code = socket_last_error($this->handle);
97 97
             throw new SocketException(socket_strerror($code), $code);
98 98
         }
Please login to merge, or discard this patch.
src/Generics/Socket/ClientSocket.php 1 patch
Spacing   +3 added lines, -3 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
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function connect()
50 50
     {
51
-        if (! @socket_connect($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
51
+        if (!@socket_connect($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
52 52
             $code = socket_last_error($this->handle);
53 53
             throw new SocketException(socket_strerror($code), $code);
54 54
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function disconnect()
64 64
     {
65
-        if (! $this->conntected) {
65
+        if (!$this->conntected) {
66 66
             throw new SocketException("Socket is not connected");
67 67
         }
68 68
 
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
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $this->endpoint = $endpoint;
43 43
         $this->handle = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
44 44
 
45
-        if (! is_resource($this->handle)) {
45
+        if (!is_resource($this->handle)) {
46 46
             $code = socket_last_error();
47 47
             throw new SocketException(socket_strerror($code), $code);
48 48
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function ready()
78 78
     {
79
-        if (! is_resource($this->handle)) {
79
+        if (!is_resource($this->handle)) {
80 80
             return false;
81 81
         }
82 82
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             return false;
98 98
         }
99 99
 
100
-        if (! in_array($this->handle, $read)) {
100
+        if (!in_array($this->handle, $read)) {
101 101
             return false;
102 102
         }
103 103
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function isWriteable()
113 113
     {
114
-        if (! is_resource($this->handle)) {
114
+        if (!is_resource($this->handle)) {
115 115
             return false;
116 116
         }
117 117
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             return false;
133 133
         }
134 134
 
135
-        if (! in_array($this->handle, $write)) {
135
+        if (!in_array($this->handle, $write)) {
136 136
             return false;
137 137
         }
138 138
 
Please login to merge, or discard this patch.
src/Generics/Logger/SimpleLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
     {
89 89
         clearstatcache();
90 90
 
91
-        if (! file_exists($this->file)) {
91
+        if (!file_exists($this->file)) {
92 92
             return false;
93 93
         }
94 94
 
Please login to merge, or discard this patch.
src/Generics/Client/HttpClient.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
         $ms = $this->appendPayloadToRequest($ms);
199 199
 
200
-        if (! $this->isConnected()) {
200
+        if (!$this->isConnected()) {
201 201
             $this->connect();
202 202
         }
203 203
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      */
222 222
     private function checkConnection($start)
223 223
     {
224
-        if (! $this->ready()) {
224
+        if (!$this->ready()) {
225 225
             if (time() - $start > $this->timeout) {
226 226
                 $this->disconnect();
227 227
                 throw new HttpException("Connection timed out!");
Please login to merge, or discard this patch.
src/Generics/Util/UrlParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
     {
30 30
         $parts = parse_url($url);
31 31
 
32
-        if (! isset($parts['host']) || strlen($parts['host']) == 0) {
32
+        if (!isset($parts['host']) || strlen($parts['host']) == 0) {
33 33
             throw new InvalidUrlException('This URL does not contain a host part');
34 34
         }
35
-        if (! isset($parts['scheme']) || strlen($parts['scheme']) == 0) {
35
+        if (!isset($parts['scheme']) || strlen($parts['scheme']) == 0) {
36 36
             throw new InvalidUrlException('This URL does not contain a scheme part');
37 37
         }
38 38
 
Please login to merge, or discard this patch.
src/Generics/Util/RandomString.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
             setlocale(LC_ALL, "C");
53 53
         }
54 54
 
55
-        for ($i = 32; $i < 256; $i ++) {
56
-            if (($allowed == RandomString::ASCII && ! ctype_alnum(chr($i))) || (! ctype_print(chr($i)))) {
55
+        for ($i = 32; $i < 256; $i++) {
56
+            if (($allowed == RandomString::ASCII && !ctype_alnum(chr($i))) || (!ctype_print(chr($i)))) {
57 57
                 continue;
58 58
             }
59 59
             $allowedChars[] = $i;
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
         $i = $length;
68 68
         while ($i > 0) {
69 69
             $index = mt_rand(0, count($allowedChars) - 1);
70
-            if (! $repeatable && in_array($index, $used)) {
70
+            if (!$repeatable && in_array($index, $used)) {
71 71
                 continue;
72 72
             }
73 73
             $string .= chr($allowedChars[$index]);
74 74
             $used[] = $i;
75
-            $i --;
75
+            $i--;
76 76
         }
77 77
 
78 78
         return $string;
Please login to merge, or discard this patch.