@@ -42,11 +42,11 @@ |
||
| 42 | 42 | if ($setTarget) { |
| 43 | 43 | $this->runner->getSchema()->setTarget( |
| 44 | 44 | $host, |
| 45 | - !empty($port) ? (int)$port : 21, |
|
| 45 | + !empty($port) ? (int) $port : 21, |
|
| 46 | 46 | $this->runner->getTimeout($host) |
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | - $pre = (in_array($into[0], ['.', '\\'])) ? substr($into, 1) : $into ; |
|
| 49 | + $pre = (in_array($into[0], ['.', '\\'])) ? substr($into, 1) : $into; |
|
| 50 | 50 | return $pre; |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $this->lang = $lang; |
| 35 | 35 | $pointer = empty($contextOptions) |
| 36 | 36 | ? ($long ? new RemoteRequest\Sockets\PfSocket($lang) : new RemoteRequest\Sockets\FSocket($lang)) |
| 37 | - : (new RemoteRequest\Sockets\Stream($lang))->setContextOptions($contextOptions) ; |
|
| 37 | + : (new RemoteRequest\Sockets\Stream($lang))->setContextOptions($contextOptions); |
|
| 38 | 38 | $this->processor = new RemoteRequest\Connection\Processor($lang, $pointer); |
| 39 | 39 | $this->target = $this->loadTarget(); |
| 40 | 40 | $this->query = $this->loadQuery(); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | ]); |
| 121 | 121 | } |
| 122 | 122 | // @codeCoverageIgnoreEnd |
| 123 | - if ($checksum != $this->headChecksum ) { |
|
| 123 | + if ($checksum != $this->headChecksum) { |
|
| 124 | 124 | throw new RequestException($this->lang->rrFspInvalidChecksum($checksum, $this->headChecksum)); |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -132,43 +132,43 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | public function getChecksumPacket(): string |
| 134 | 134 | { |
| 135 | - $content = $this->header . $this->content . $this->extra ; |
|
| 135 | + $content = $this->header . $this->content . $this->extra; |
|
| 136 | 136 | $content[1] = chr(0); // null checksum |
| 137 | 137 | return $content; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | public function getCommand(): int |
| 141 | 141 | { |
| 142 | - return (int)$this->headCommand; |
|
| 142 | + return (int) $this->headCommand; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public function getKey(): int |
| 146 | 146 | { |
| 147 | - return (int)$this->headServerKey; |
|
| 147 | + return (int) $this->headServerKey; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | public function getSequence(): int |
| 151 | 151 | { |
| 152 | - return (int)$this->headSequence; |
|
| 152 | + return (int) $this->headSequence; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | public function getDataLength(): int |
| 156 | 156 | { |
| 157 | - return (int)$this->headDataLength; |
|
| 157 | + return (int) $this->headDataLength; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | public function getFilePosition(): int |
| 161 | 161 | { |
| 162 | - return (int)$this->headFilePosition; |
|
| 162 | + return (int) $this->headFilePosition; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | public function getContent(): string |
| 166 | 166 | { |
| 167 | - return (string)$this->content; |
|
| 167 | + return (string) $this->content; |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | public function getExtraData(): string |
| 171 | 171 | { |
| 172 | - return (string)$this->extra; |
|
| 172 | + return (string) $this->extra; |
|
| 173 | 173 | } |
| 174 | 174 | } |
@@ -22,10 +22,10 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $len = strlen($str); |
| 24 | 24 | $char = ($len > 1) ? substr($str, $len - 1) : $str; |
| 25 | - $next = ($len > 1) ? substr($str, 0, $len - 1) : '' ; |
|
| 25 | + $next = ($len > 1) ? substr($str, 0, $len - 1) : ''; |
|
| 26 | 26 | return |
| 27 | - ( (!empty($next)) ? ( static::mb_ord($next) * 256 ) : 0 ) |
|
| 28 | - + ord($char) ; |
|
| 27 | + ((!empty($next)) ? (static::mb_ord($next) * 256) : 0) |
|
| 28 | + + ord($char); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function filler(int $input, int $length): string |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | |
| 51 | 51 | public function hasKey(): bool |
| 52 | 52 | { |
| 53 | - return (empty($this->host))? false : (!empty(static::$key[$this->host])); |
|
| 53 | + return (empty($this->host)) ? false : (!empty(static::$key[$this->host])); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | protected function parseLinkName(): void |
| 56 | 56 | { |
| 57 | 57 | $nlpos = strpos($this->file_name, "\n"); |
| 58 | - $this->link_name = $nlpos ? substr($this->file_name, $nlpos + 1) : '' ; |
|
| 59 | - $this->file_name = $this->link_name && $nlpos ? substr($this->file_name, 0, $nlpos) : $this->file_name ; |
|
| 58 | + $this->link_name = $nlpos ? substr($this->file_name, $nlpos + 1) : ''; |
|
| 59 | + $this->file_name = $this->link_name && $nlpos ? substr($this->file_name, 0, $nlpos) : $this->file_name; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function setPath(string $path): self |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | public function getLinkTarget(): string |
| 173 | 173 | { |
| 174 | - return $this->isLink() ? $this->link_name : '' ; |
|
| 174 | + return $this->isLink() ? $this->link_name : ''; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | #[\ReturnTypeWillChange] |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $newPacket = true; |
| 50 | 50 | do { |
| 51 | 51 | if ($newPacket) { |
| 52 | - $endSeq =+ 12; |
|
| 52 | + $endSeq = + 12; |
|
| 53 | 53 | $newPacket = false; |
| 54 | 54 | } |
| 55 | 55 | $record = substr($data, $startSeq, $endSeq); |
@@ -51,6 +51,6 @@ |
||
| 51 | 51 | |
| 52 | 52 | protected function getExtraData(): string |
| 53 | 53 | { |
| 54 | - return !empty($this->timestamp) ? Fsp\Strings::filler($this->timestamp, 4) : '' ; |
|
| 54 | + return !empty($this->timestamp) ? Fsp\Strings::filler($this->timestamp, 4) : ''; |
|
| 55 | 55 | } |
| 56 | 56 | } |
@@ -55,6 +55,6 @@ |
||
| 55 | 55 | |
| 56 | 56 | protected function getExtraData(): string |
| 57 | 57 | { |
| 58 | - return ($this->limit) ? Fsp\Strings::filler($this->limit, 2) : '' ; |
|
| 58 | + return ($this->limit) ? Fsp\Strings::filler($this->limit, 2) : ''; |
|
| 59 | 59 | } |
| 60 | 60 | } |