@@ -23,8 +23,7 @@ |
||
| 23 | 23 | $this->headers = $data->getHeaders(); |
| 24 | 24 | $this->columns = $data->getColumns(); |
| 25 | 25 | $this->fp = $data->getData(); |
| 26 | - } |
|
| 27 | - else { |
|
| 26 | + } else { |
|
| 28 | 27 | if (is_null($headers) || is_null($columns)) { |
| 29 | 28 | throw new \Exception('Not correct data in Record class'); |
| 30 | 29 | } |
@@ -132,20 +132,17 @@ discard block |
||
| 132 | 132 | if ($this->headers["checks"][0] != 0) { |
| 133 | 133 | $this->error = true; |
| 134 | 134 | $this->error_info = "Not correct DBF file by headers"; |
| 135 | - } |
|
| 136 | - else { |
|
| 135 | + } else { |
|
| 137 | 136 | $this->headers["charset_name"] = "cp".$this->charsets[$this->headers["charset"]]; |
| 138 | 137 | |
| 139 | 138 | if (in_array("dBASE 7", $this->versions[$this->headers["version"]])) { |
| 140 | 139 | $this->dbase7 = true; |
| 141 | 140 | $this->headers["columns"] = ($this->headers["header_length"] - 68) / 48; |
| 142 | - } |
|
| 143 | - elseif (in_array("Visual FoxPro", $this->versions[$this->headers["version"]])) { |
|
| 141 | + } elseif (in_array("Visual FoxPro", $this->versions[$this->headers["version"]])) { |
|
| 144 | 142 | $this->v_foxpro = true; |
| 145 | 143 | $this->headers["memo"] = (in_array($this->headers["mdx_flag"], [2, 3, 6, 7])); |
| 146 | 144 | $this->headers["columns"] = ($this->headers["header_length"] - 296) / 32; |
| 147 | - } |
|
| 148 | - else { |
|
| 145 | + } else { |
|
| 149 | 146 | $this->headers["columns"] = ($this->headers["header_length"] - 33) / 32; |
| 150 | 147 | } |
| 151 | 148 | |
@@ -178,8 +175,7 @@ discard block |
||
| 178 | 175 | "mdx_flag" => unpack("C", $data[37])[1], |
| 179 | 176 | "auto_increment" => unpack("L", substr($data, 40, 4))[1] |
| 180 | 177 | ]; |
| 181 | - } |
|
| 182 | - else { |
|
| 178 | + } else { |
|
| 183 | 179 | $this->columns[$i] = [ |
| 184 | 180 | "name" => strtolower(trim(substr($data, 0, 11))), |
| 185 | 181 | "type" => $data[11], |
@@ -196,8 +192,7 @@ discard block |
||
| 196 | 192 | $this->columns[$i]["auto_increment_next"] = unpack("L", substr($data, 19, 4))[1]; |
| 197 | 193 | $this->columns[$i]["auto_increment_step"] = unpack("C", $data[23])[1]; |
| 198 | 194 | } |
| 199 | - } |
|
| 200 | - else { |
|
| 195 | + } else { |
|
| 201 | 196 | $this->columns[$i]["mdx_flag"] = unpack("C", $data[31])[1]; |
| 202 | 197 | } |
| 203 | 198 | } |