@@ -32,8 +32,9 @@ |
||
32 | 32 | 'id_usuario' => $this->getIdUser(), |
33 | 33 | ); |
34 | 34 | |
35 | - if (isset($id_cliente)) |
|
36 | - $conditions['id'] = $id_cliente; |
|
35 | + if (isset($id_cliente)) { |
|
36 | + $conditions['id'] = $id_cliente; |
|
37 | + } |
|
37 | 38 | |
38 | 39 | |
39 | 40 | $cliente = $this->Cliente->find('all', |
@@ -70,8 +70,7 @@ |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | return true; |
73 | - } |
|
74 | - catch (Exception $e) |
|
73 | + } catch (Exception $e) |
|
75 | 74 | { |
76 | 75 | throw new Exception("Error Processing Request", 1); |
77 | 76 | } |
@@ -63,8 +63,9 @@ discard block |
||
63 | 63 | if (!empty($image['name'])) { |
64 | 64 | $retorno = $this->uploadImage($image); |
65 | 65 | |
66 | - if (!$retorno['status']) |
|
67 | - $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
66 | + if (!$retorno['status']) { |
|
67 | + $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
68 | + } |
|
68 | 69 | |
69 | 70 | $dados['imagem'] = $retorno['nome']; |
70 | 71 | } |
@@ -91,8 +92,9 @@ discard block |
||
91 | 92 | |
92 | 93 | $retorno = $this->uploadImage($image); |
93 | 94 | |
94 | - if (!$retorno['status']) |
|
95 | - $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
95 | + if (!$retorno['status']) { |
|
96 | + $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
97 | + } |
|
96 | 98 | |
97 | 99 | $dados['src'] = $retorno['nome']; |
98 | 100 | $dados['usuario_id'] = $this->instancia; |
@@ -114,8 +116,9 @@ discard block |
||
114 | 116 | |
115 | 117 | $returnUpload = move_uploaded_file($image['tmp_name'], $dir . $nameImage); |
116 | 118 | |
117 | - if (!$returnUpload) |
|
118 | - return array('nome' => null, 'status' => false); |
|
119 | + if (!$returnUpload) { |
|
120 | + return array('nome' => null, 'status' => false); |
|
121 | + } |
|
119 | 122 | |
120 | 123 | return array('nome' => $nameImage, 'status' => true); |
121 | 124 | } |
@@ -39,8 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | $retorno = $this->uploadImage($image); |
41 | 41 | |
42 | - if (!$retorno['status']) |
|
43 | - $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
42 | + if (!$retorno['status']) { |
|
43 | + $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
44 | + } |
|
44 | 45 | |
45 | 46 | $dados['imagem'] = $retorno['nome']; |
46 | 47 | $dados['id_usuario'] = $this->instancia; |
@@ -115,8 +116,9 @@ discard block |
||
115 | 116 | if (!empty($image['name'])) { |
116 | 117 | $retorno = $this->uploadImage($image); |
117 | 118 | |
118 | - if (!$retorno['status']) |
|
119 | - $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
119 | + if (!$retorno['status']) { |
|
120 | + $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
|
121 | + } |
|
120 | 122 | |
121 | 123 | $dados['imagem'] = $retorno['nome']; |
122 | 124 | } |
@@ -224,8 +226,9 @@ discard block |
||
224 | 226 | |
225 | 227 | $returnUpload = move_uploaded_file($image['tmp_name'], $dir . $nameImage); |
226 | 228 | |
227 | - if (!$returnUpload) |
|
228 | - return array('nome' => null, 'status' => false); |
|
229 | + if (!$returnUpload) { |
|
230 | + return array('nome' => null, 'status' => false); |
|
231 | + } |
|
229 | 232 | |
230 | 233 | return array('nome' => $nameImage, 'status' => true); |
231 | 234 | } |
@@ -89,7 +89,7 @@ |
||
89 | 89 | |
90 | 90 | if($resposta >= 1){ |
91 | 91 | return true; |
92 | - }else{ |
|
92 | + } else{ |
|
93 | 93 | return false; |
94 | 94 | } |
95 | 95 | } |
@@ -60,8 +60,9 @@ discard block |
||
60 | 60 | if ($this->_currentCellIsDirty) { |
61 | 61 | $this->_currentObject->detach(); |
62 | 62 | |
63 | - if (!$this->_DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES('".$this->_currentObjectID."','".sqlite_escape_string(serialize($this->_currentObject))."')")) |
|
64 | - throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
63 | + if (!$this->_DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES('".$this->_currentObjectID."','".sqlite_escape_string(serialize($this->_currentObject))."')")) { |
|
64 | + throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
65 | + } |
|
65 | 66 | $this->_currentCellIsDirty = false; |
66 | 67 | } |
67 | 68 | $this->_currentObjectID = $this->_currentObject = null; |
@@ -162,8 +163,9 @@ discard block |
||
162 | 163 | |
163 | 164 | // Check if the requested entry exists in the cache |
164 | 165 | $query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; |
165 | - if (!$this->_DBHandle->queryExec($query)) |
|
166 | - throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
166 | + if (!$this->_DBHandle->queryExec($query)) { |
|
167 | + throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
168 | + } |
|
167 | 169 | |
168 | 170 | $this->_currentCellIsDirty = false; |
169 | 171 | } // function deleteCacheData() |
@@ -177,8 +179,9 @@ discard block |
||
177 | 179 | public function getCellList() { |
178 | 180 | $query = "SELECT id FROM kvp_".$this->_TableName; |
179 | 181 | $cellIdsResult = $this->_DBHandle->unbufferedQuery($query,SQLITE_ASSOC); |
180 | - if ($cellIdsResult === false) |
|
181 | - throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
182 | + if ($cellIdsResult === false) { |
|
183 | + throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
184 | + } |
|
182 | 185 | |
183 | 186 | $cellKeys = array(); |
184 | 187 | foreach($cellIdsResult as $row) { |
@@ -199,8 +202,9 @@ discard block |
||
199 | 202 | // Get a new id for the new table name |
200 | 203 | $tableName = str_replace('.','_',$this->_getUniqueID()); |
201 | 204 | if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) |
202 | - AS SELECT * FROM kvp_'.$this->_TableName)) |
|
203 | - throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
205 | + AS SELECT * FROM kvp_'.$this->_TableName)) { |
|
206 | + throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
207 | + } |
|
204 | 208 | |
205 | 209 | // Copy the existing cell cache file |
206 | 210 | $this->_TableName = $tableName; |
@@ -237,10 +241,12 @@ discard block |
||
237 | 241 | $_DBName = ':memory:'; |
238 | 242 | |
239 | 243 | $this->_DBHandle = new SQLiteDatabase($_DBName); |
240 | - if ($this->_DBHandle === false) |
|
241 | - throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
242 | - if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) |
|
243 | - throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
244 | + if ($this->_DBHandle === false) { |
|
245 | + throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
246 | + } |
|
247 | + if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { |
|
248 | + throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); |
|
249 | + } |
|
244 | 250 | } |
245 | 251 | } // function __construct() |
246 | 252 |
@@ -64,8 +64,9 @@ discard block |
||
64 | 64 | $query->bindValue('id',$this->_currentObjectID,SQLITE3_TEXT); |
65 | 65 | $query->bindValue('data',serialize($this->_currentObject),SQLITE3_BLOB); |
66 | 66 | $result = $query->execute(); |
67 | - if ($result === false) |
|
68 | - throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
67 | + if ($result === false) { |
|
68 | + throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
69 | + } |
|
69 | 70 | $this->_currentCellIsDirty = false; |
70 | 71 | } |
71 | 72 | $this->_currentObjectID = $this->_currentObject = null; |
@@ -166,8 +167,9 @@ discard block |
||
166 | 167 | // Check if the requested entry exists in the cache |
167 | 168 | $query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; |
168 | 169 | $result = $this->_DBHandle->exec($query); |
169 | - if ($result === false) |
|
170 | - throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
170 | + if ($result === false) { |
|
171 | + throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
172 | + } |
|
171 | 173 | |
172 | 174 | $this->_currentCellIsDirty = false; |
173 | 175 | } // function deleteCacheData() |
@@ -181,8 +183,9 @@ discard block |
||
181 | 183 | public function getCellList() { |
182 | 184 | $query = "SELECT id FROM kvp_".$this->_TableName; |
183 | 185 | $cellIdsResult = $this->_DBHandle->query($query); |
184 | - if ($cellIdsResult === false) |
|
185 | - throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
186 | + if ($cellIdsResult === false) { |
|
187 | + throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
188 | + } |
|
186 | 189 | |
187 | 190 | $cellKeys = array(); |
188 | 191 | while ($row = $cellIdsResult->fetchArray(SQLITE3_ASSOC)) { |
@@ -203,8 +206,9 @@ discard block |
||
203 | 206 | // Get a new id for the new table name |
204 | 207 | $tableName = str_replace('.','_',$this->_getUniqueID()); |
205 | 208 | if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) |
206 | - AS SELECT * FROM kvp_'.$this->_TableName)) |
|
207 | - throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
209 | + AS SELECT * FROM kvp_'.$this->_TableName)) { |
|
210 | + throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
211 | + } |
|
208 | 212 | |
209 | 213 | // Copy the existing cell cache file |
210 | 214 | $this->_TableName = $tableName; |
@@ -241,10 +245,12 @@ discard block |
||
241 | 245 | $_DBName = ':memory:'; |
242 | 246 | |
243 | 247 | $this->_DBHandle = new SQLite3($_DBName); |
244 | - if ($this->_DBHandle === false) |
|
245 | - throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
246 | - if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) |
|
247 | - throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
248 | + if ($this->_DBHandle === false) { |
|
249 | + throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
250 | + } |
|
251 | + if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { |
|
252 | + throw new Exception($this->_DBHandle->lastErrorMsg()); |
|
253 | + } |
|
248 | 254 | } |
249 | 255 | } // function __construct() |
250 | 256 |
@@ -2208,9 +2208,13 @@ discard block |
||
2208 | 2208 | // Basic validation that this is indeed a formula |
2209 | 2209 | // We return an empty array if not |
2210 | 2210 | $formula = trim($formula); |
2211 | - if ((!isset($formula{0})) || ($formula{0} != '=')) return array(); |
|
2211 | + if ((!isset($formula{0})) || ($formula{0} != '=')) { |
|
2212 | + return array(); |
|
2213 | + } |
|
2212 | 2214 | $formula = ltrim(substr($formula,1)); |
2213 | - if (!isset($formula{0})) return array(); |
|
2215 | + if (!isset($formula{0})) { |
|
2216 | + return array(); |
|
2217 | + } |
|
2214 | 2218 | |
2215 | 2219 | // Parse the formula and return the token stack |
2216 | 2220 | return $this->_parseFormula($formula); |
@@ -2263,9 +2267,13 @@ discard block |
||
2263 | 2267 | // Basic validation that this is indeed a formula |
2264 | 2268 | // We simply return the "cell value" (formula) if not |
2265 | 2269 | $formula = trim($formula); |
2266 | - if ($formula{0} != '=') return self::_wrapResult($formula); |
|
2270 | + if ($formula{0} != '=') { |
|
2271 | + return self::_wrapResult($formula); |
|
2272 | + } |
|
2267 | 2273 | $formula = ltrim(substr($formula,1)); |
2268 | - if (!isset($formula{0})) return self::_wrapResult($formula); |
|
2274 | + if (!isset($formula{0})) { |
|
2275 | + return self::_wrapResult($formula); |
|
2276 | + } |
|
2269 | 2277 | |
2270 | 2278 | $wsTitle = "\x00Wrk"; |
2271 | 2279 | if ($pCell !== NULL) { |
@@ -2715,8 +2723,11 @@ discard block |
||
2715 | 2723 | // echo 'Element is a Closing bracket<br />'; |
2716 | 2724 | $expectingOperand = false; |
2717 | 2725 | while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last ( |
2718 | - if ($o2 === NULL) return $this->_raiseFormulaError('Formula Error: Unexpected closing brace ")"'); |
|
2719 | - else $output[] = $o2; |
|
2726 | + if ($o2 === NULL) { |
|
2727 | + return $this->_raiseFormulaError('Formula Error: Unexpected closing brace ")"'); |
|
2728 | + } else { |
|
2729 | + $output[] = $o2; |
|
2730 | + } |
|
2720 | 2731 | } |
2721 | 2732 | $d = $stack->last(2); |
2722 | 2733 | if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { // Did this parenthesis just close a function? |
@@ -2794,8 +2805,12 @@ discard block |
||
2794 | 2805 | } elseif ($opCharacter == ',') { // Is this the separator for function arguments? |
2795 | 2806 | // echo 'Element is a Function argument separator<br />'; |
2796 | 2807 | while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last ( |
2797 | - if ($o2 === NULL) return $this->_raiseFormulaError("Formula Error: Unexpected ,"); |
|
2798 | - else $output[] = $o2; // pop the argument expression stuff and push onto the output |
|
2808 | + if ($o2 === NULL) { |
|
2809 | + return $this->_raiseFormulaError("Formula Error: Unexpected ,"); |
|
2810 | + } else { |
|
2811 | + $output[] = $o2; |
|
2812 | + } |
|
2813 | + // pop the argument expression stuff and push onto the output |
|
2799 | 2814 | } |
2800 | 2815 | // If we've a comma when we're expecting an operand, then what we actually have is a null operand; |
2801 | 2816 | // so push a null onto the stack |
@@ -2804,8 +2819,9 @@ discard block |
||
2804 | 2819 | } |
2805 | 2820 | // make sure there was a function |
2806 | 2821 | $d = $stack->last(2); |
2807 | - if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) |
|
2808 | - return $this->_raiseFormulaError("Formula Error: Unexpected ,"); |
|
2822 | + if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { |
|
2823 | + return $this->_raiseFormulaError("Formula Error: Unexpected ,"); |
|
2824 | + } |
|
2809 | 2825 | $d = $stack->pop(); |
2810 | 2826 | $stack->push($d['type'],++$d['value'],$d['reference']); // increment the argument count |
2811 | 2827 | $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again |
@@ -2876,12 +2892,16 @@ discard block |
||
2876 | 2892 | if (strpos('!',$startRowColRef) !== false) { |
2877 | 2893 | list($rangeWS1,$startRowColRef) = explode('!',$startRowColRef); |
2878 | 2894 | } |
2879 | - if ($rangeWS1 != '') $rangeWS1 .= '!'; |
|
2895 | + if ($rangeWS1 != '') { |
|
2896 | + $rangeWS1 .= '!'; |
|
2897 | + } |
|
2880 | 2898 | $rangeWS2 = $rangeWS1; |
2881 | 2899 | if (strpos('!',$val) !== false) { |
2882 | 2900 | list($rangeWS2,$val) = explode('!',$val); |
2883 | 2901 | } |
2884 | - if ($rangeWS2 != '') $rangeWS2 .= '!'; |
|
2902 | + if ($rangeWS2 != '') { |
|
2903 | + $rangeWS2 .= '!'; |
|
2904 | + } |
|
2885 | 2905 | if ((is_integer($startRowColRef)) && (ctype_digit($val)) && |
2886 | 2906 | ($startRowColRef <= 1048576) && ($val <= 1048576)) { |
2887 | 2907 | // Row range |
@@ -2977,8 +2997,10 @@ discard block |
||
2977 | 2997 | } |
2978 | 2998 | |
2979 | 2999 | while (($op = $stack->pop()) !== NULL) { // pop everything off the stack and push onto output |
2980 | - if ((is_array($opCharacter) && $opCharacter['value'] == '(') || ($opCharacter === '(')) |
|
2981 | - return $this->_raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced |
|
3000 | + if ((is_array($opCharacter) && $opCharacter['value'] == '(') || ($opCharacter === '(')) { |
|
3001 | + return $this->_raiseFormulaError("Formula Error: Expecting ')'"); |
|
3002 | + } |
|
3003 | + // if there are any opening braces on the stack, then braces were unbalanced |
|
2982 | 3004 | $output[] = $op; |
2983 | 3005 | } |
2984 | 3006 | return $output; |
@@ -3002,7 +3024,9 @@ discard block |
||
3002 | 3024 | |
3003 | 3025 | // evaluate postfix notation |
3004 | 3026 | private function _processTokenStack($tokens, $cellID = null, PHPExcel_Cell $pCell = null) { |
3005 | - if ($tokens == false) return false; |
|
3027 | + if ($tokens == false) { |
|
3028 | + return false; |
|
3029 | + } |
|
3006 | 3030 | |
3007 | 3031 | // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet), |
3008 | 3032 | // so we store the parent worksheet so that we can re-attach it when necessary |
@@ -3019,8 +3043,12 @@ discard block |
||
3019 | 3043 | if (isset(self::$_binaryOperators[$token])) { |
3020 | 3044 | // echo 'Token is a binary operator<br />'; |
3021 | 3045 | // We must have two operands, error if we don't |
3022 | - if (($operand2Data = $stack->pop()) === NULL) return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); |
|
3023 | - if (($operand1Data = $stack->pop()) === NULL) return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); |
|
3046 | + if (($operand2Data = $stack->pop()) === NULL) { |
|
3047 | + return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); |
|
3048 | + } |
|
3049 | + if (($operand1Data = $stack->pop()) === NULL) { |
|
3050 | + return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); |
|
3051 | + } |
|
3024 | 3052 | |
3025 | 3053 | $operand1 = self::_dataTestReference($operand1Data); |
3026 | 3054 | $operand2 = self::_dataTestReference($operand2Data); |
@@ -3158,7 +3186,9 @@ discard block |
||
3158 | 3186 | // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on |
3159 | 3187 | } elseif (($token === '~') || ($token === '%')) { |
3160 | 3188 | // echo 'Token is a unary operator<br />'; |
3161 | - if (($arg = $stack->pop()) === NULL) return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); |
|
3189 | + if (($arg = $stack->pop()) === NULL) { |
|
3190 | + return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); |
|
3191 | + } |
|
3162 | 3192 | $arg = $arg['value']; |
3163 | 3193 | if ($token === '~') { |
3164 | 3194 | // echo 'Token is a negation operator<br />'; |
@@ -3388,7 +3418,9 @@ discard block |
||
3388 | 3418 | } |
3389 | 3419 | } |
3390 | 3420 | // when we're out of tokens, the stack should have a single element, the final result |
3391 | - if ($stack->count() != 1) return $this->_raiseFormulaError("internal error"); |
|
3421 | + if ($stack->count() != 1) { |
|
3422 | + return $this->_raiseFormulaError("internal error"); |
|
3423 | + } |
|
3392 | 3424 | $output = $stack->pop(); |
3393 | 3425 | $output = $output['value']; |
3394 | 3426 | |
@@ -3502,8 +3534,12 @@ discard block |
||
3502 | 3534 | |
3503 | 3535 | private function _executeNumericBinaryOperation($cellID,$operand1,$operand2,$operation,$matrixFunction,&$stack) { |
3504 | 3536 | // Validate the two operands |
3505 | - if (!$this->_validateBinaryOperand($cellID,$operand1,$stack)) return false; |
|
3506 | - if (!$this->_validateBinaryOperand($cellID,$operand2,$stack)) return false; |
|
3537 | + if (!$this->_validateBinaryOperand($cellID,$operand1,$stack)) { |
|
3538 | + return false; |
|
3539 | + } |
|
3540 | + if (!$this->_validateBinaryOperand($cellID,$operand2,$stack)) { |
|
3541 | + return false; |
|
3542 | + } |
|
3507 | 3543 | |
3508 | 3544 | $executeMatrixOperation = false; |
3509 | 3545 | // If either of the operands is a matrix, we need to treat them both as matrices |
@@ -3595,7 +3631,9 @@ discard block |
||
3595 | 3631 | protected function _raiseFormulaError($errorMessage) { |
3596 | 3632 | $this->formulaError = $errorMessage; |
3597 | 3633 | $this->debugLogStack = array(); |
3598 | - if (!$this->suppressFormulaErrors) throw new Exception($errorMessage); |
|
3634 | + if (!$this->suppressFormulaErrors) { |
|
3635 | + throw new Exception($errorMessage); |
|
3636 | + } |
|
3599 | 3637 | trigger_error($errorMessage, E_USER_ERROR); |
3600 | 3638 | } // function _raiseFormulaError() |
3601 | 3639 |
@@ -515,8 +515,9 @@ discard block |
||
515 | 515 | if (($PHPDateArray !== False) && ($PHPDateArray['error_count'] == 0)) { |
516 | 516 | // Execute function |
517 | 517 | if ($PHPDateArray['year'] == '') { $PHPDateArray['year'] = strftime('%Y'); } |
518 | - if ($PHPDateArray['year'] < 1900) |
|
519 | - return PHPExcel_Calculation_Functions::VALUE(); |
|
518 | + if ($PHPDateArray['year'] < 1900) { |
|
519 | + return PHPExcel_Calculation_Functions::VALUE(); |
|
520 | + } |
|
520 | 521 | if ($PHPDateArray['month'] == '') { $PHPDateArray['month'] = strftime('%m'); } |
521 | 522 | if ($PHPDateArray['day'] == '') { $PHPDateArray['day'] = strftime('%d'); } |
522 | 523 | $excelDateValue = floor(PHPExcel_Shared_Date::FormattedPHPToExcel($PHPDateArray['year'],$PHPDateArray['month'],$PHPDateArray['day'],$PHPDateArray['hour'],$PHPDateArray['minute'],$PHPDateArray['second'])); |
@@ -656,7 +657,9 @@ discard block |
||
656 | 657 | break; |
657 | 658 | case 'YM': |
658 | 659 | $retVal = intval($endMonths - $startMonths); |
659 | - if ($retVal < 0) $retVal = 12 + $retVal; |
|
660 | + if ($retVal < 0) { |
|
661 | + $retVal = 12 + $retVal; |
|
662 | + } |
|
660 | 663 | // We're only interested in full months |
661 | 664 | if ($endDays < $startDays) { |
662 | 665 | --$retVal; |