@@ -84,6 +84,10 @@ |
||
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | + /** |
|
88 | + * @param string $buffer |
|
89 | + * @param FixedTextDefinition[] $fieldDefinition |
|
90 | + */ |
|
87 | 91 | protected function processBuffer($buffer, $fieldDefinition) |
88 | 92 | { |
89 | 93 | $cntDef = count($fieldDefinition); |
@@ -103,7 +103,7 @@ |
||
103 | 103 | $fields[$fieldDef->fieldName] = substr($buffer, $fieldDef->startPos, $fieldDef->length); |
104 | 104 | if (!empty($fieldDef->requiredValue) |
105 | 105 | && ( |
106 | - !preg_match("/^[" . $fieldDef->requiredValue . "]$/", $fields[$fieldDef->fieldName]) |
|
106 | + !preg_match("/^[".$fieldDef->requiredValue."]$/", $fields[$fieldDef->fieldName]) |
|
107 | 107 | ) |
108 | 108 | ) { |
109 | 109 | throw new IteratorException( |
@@ -27,7 +27,9 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | if ($path != "") { |
30 | - if ($path[0] == "/") $path = substr($path, 1); |
|
30 | + if ($path[0] == "/") { |
|
31 | + $path = substr($path, 1); |
|
32 | + } |
|
31 | 33 | |
32 | 34 | $pathAr = explode("/", $path); |
33 | 35 | |
@@ -44,7 +46,9 @@ discard block |
||
44 | 46 | } |
45 | 47 | } |
46 | 48 | $this->_jsonObject = $newjsonObject; |
47 | - } else $this->_jsonObject = $jsonObject; |
|
49 | + } else { |
|
50 | + $this->_jsonObject = $jsonObject; |
|
51 | + } |
|
48 | 52 | |
49 | 53 | $this->_current = 0; |
50 | 54 | } |
@@ -33,7 +33,9 @@ |
||
33 | 33 | if (($buffer !== false) && (trim($buffer) != "")) { |
34 | 34 | $this->_current++; |
35 | 35 | $this->_currentBuffer = $buffer; |
36 | - } else $this->readNextLine(); |
|
36 | + } else { |
|
37 | + $this->readNextLine(); |
|
38 | + } |
|
37 | 39 | } |
38 | 40 | } |
39 | 41 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | public function __construct(ConnectionManagement $connMngt) |
12 | 12 | { |
13 | - $strcnn = $connMngt->getDriver() . ":" . $connMngt->getServer(); |
|
13 | + $strcnn = $connMngt->getDriver().":".$connMngt->getServer(); |
|
14 | 14 | |
15 | 15 | parent::__construct($connMngt, $strcnn, [], []); |
16 | 16 | } |
@@ -54,8 +54,8 @@ |
||
54 | 54 | if (!$handle) { |
55 | 55 | throw new DatasetException("Socket error: $errstr ($errno)"); |
56 | 56 | } else { |
57 | - $out = "GET " . $this->_path . " HTTP/1.1\r\n"; |
|
58 | - $out .= "Host: " . $this->_server . "\r\n"; |
|
57 | + $out = "GET ".$this->_path." HTTP/1.1\r\n"; |
|
58 | + $out .= "Host: ".$this->_server."\r\n"; |
|
59 | 59 | $out .= "Connection: Close\r\n\r\n"; |
60 | 60 | |
61 | 61 | fwrite($handle, $out); |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_rows = array(); |
45 | - $rowsaux = preg_split("/" . $this->_rowsep . "/", $linha); |
|
45 | + $rowsaux = preg_split("/".$this->_rowsep."/", $linha); |
|
46 | 46 | sort($rowsaux); |
47 | 47 | foreach ($rowsaux as $key => $value) { |
48 | - $colsaux = preg_split("/" . $this->_colsep . "/", $value); |
|
48 | + $colsaux = preg_split("/".$this->_colsep."/", $value); |
|
49 | 49 | if (sizeof($colsaux) == sizeof($fieldnames)) { |
50 | 50 | $this->_rows[] = $value; |
51 | 51 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function moveNext() |
80 | 80 | { |
81 | - $cols = preg_split("/" . $this->_colsep . "/", $this->_rows[$this->_current]); |
|
81 | + $cols = preg_split("/".$this->_colsep."/", $this->_rows[$this->_current]); |
|
82 | 82 | $this->_current++; |
83 | 83 | |
84 | 84 | $sr = new SingleRow(); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | if ($lastError != JSON_ERROR_NONE) { |
50 | - throw new DatasetException("Invalid JSON string: " . $lastErrorDesc); |
|
50 | + throw new DatasetException("Invalid JSON string: ".$lastErrorDesc); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 |
@@ -23,27 +23,27 @@ |
||
23 | 23 | |
24 | 24 | $lastError = json_last_error(); |
25 | 25 | switch ($lastError) { |
26 | - case JSON_ERROR_NONE: |
|
27 | - $lastErrorDesc = 'No errors'; |
|
28 | - break; |
|
29 | - case JSON_ERROR_DEPTH: |
|
30 | - $lastErrorDesc = 'Maximum stack depth exceeded'; |
|
31 | - break; |
|
32 | - case JSON_ERROR_STATE_MISMATCH: |
|
33 | - $lastErrorDesc = 'Underflow or the modes mismatch'; |
|
34 | - break; |
|
35 | - case JSON_ERROR_CTRL_CHAR: |
|
36 | - $lastErrorDesc = 'Unexpected control character found'; |
|
37 | - break; |
|
38 | - case JSON_ERROR_SYNTAX: |
|
39 | - $lastErrorDesc = 'Syntax error, malformed JSON'; |
|
40 | - break; |
|
41 | - case JSON_ERROR_UTF8: |
|
42 | - $lastErrorDesc = 'Malformed UTF-8 characters, possibly incorrectly encoded'; |
|
43 | - break; |
|
44 | - default: |
|
45 | - $lastErrorDesc = 'Unknown error'; |
|
46 | - break; |
|
26 | + case JSON_ERROR_NONE: |
|
27 | + $lastErrorDesc = 'No errors'; |
|
28 | + break; |
|
29 | + case JSON_ERROR_DEPTH: |
|
30 | + $lastErrorDesc = 'Maximum stack depth exceeded'; |
|
31 | + break; |
|
32 | + case JSON_ERROR_STATE_MISMATCH: |
|
33 | + $lastErrorDesc = 'Underflow or the modes mismatch'; |
|
34 | + break; |
|
35 | + case JSON_ERROR_CTRL_CHAR: |
|
36 | + $lastErrorDesc = 'Unexpected control character found'; |
|
37 | + break; |
|
38 | + case JSON_ERROR_SYNTAX: |
|
39 | + $lastErrorDesc = 'Syntax error, malformed JSON'; |
|
40 | + break; |
|
41 | + case JSON_ERROR_UTF8: |
|
42 | + $lastErrorDesc = 'Malformed UTF-8 characters, possibly incorrectly encoded'; |
|
43 | + break; |
|
44 | + default: |
|
45 | + $lastErrorDesc = 'Unknown error'; |
|
46 | + break; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | if ($lastError != JSON_ERROR_NONE) { |
@@ -218,7 +218,7 @@ |
||
218 | 218 | if (is_array($this->_row)) { |
219 | 219 | return json_decode(json_encode($this->_row)); |
220 | 220 | } else { |
221 | - throw new UnexpectedValueException('I expected that getRawFormat is array() but ' . gettype($this->_row) . ' was given'); |
|
221 | + throw new UnexpectedValueException('I expected that getRawFormat is array() but '.gettype($this->_row).' was given'); |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | if (function_exists('dba_open')) { |
30 | - $cache = sys_get_temp_dir() . "/caps.db"; |
|
30 | + $cache = sys_get_temp_dir()."/caps.db"; |
|
31 | 31 | $this->_db->capabilityCache($cache); |
32 | 32 | } |
33 | 33 | } |