@@ -94,9 +94,9 @@ |
||
94 | 94 | |
95 | 95 | try { |
96 | 96 | if (mb_strpos($file, '/tk/') !== false) { |
97 | - $start = mb_strpos($file, '/tk/') + 3; |
|
97 | + $start = mb_strpos($file, '/tk/')+3; |
|
98 | 98 | $end = mb_strlen($file); |
99 | - $tk = mb_substr($file, $start + 1, $end - ($start + 1)); |
|
99 | + $tk = mb_substr($file, $start+1, $end-($start+1)); |
|
100 | 100 | $decoded = FrontController::getDecodeQueryParams($tk); |
101 | 101 | |
102 | 102 | parent::Image($decoded['source'], $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $leftSibling = $node->getLeftSibling(); |
213 | 213 | |
214 | 214 | if (isset($leftSibling)) { |
215 | - $node->setOffset($leftSibling->getOffset() + $leftSibling->getWidth() + $this->colSpace); |
|
215 | + $node->setOffset($leftSibling->getOffset()+$leftSibling->getWidth()+$this->colSpace); |
|
216 | 216 | } else { |
217 | 217 | $node->setOffset(0); |
218 | 218 | } |
@@ -220,16 +220,16 @@ discard block |
||
220 | 220 | $childCount = $node->childCount(); |
221 | 221 | |
222 | 222 | for ($i = 0; $i < $childCount; ++$i) { |
223 | - $this->firstPass($node->getChildAt($i), $level + 1); |
|
223 | + $this->firstPass($node->getChildAt($i), $level+1); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | $midPoint = $node->getChildrenCenter(); |
227 | - $midPoint -= $node->getWidth() / 2; |
|
227 | + $midPoint -= $node->getWidth()/2; |
|
228 | 228 | $leftSibling = $node->getLeftSibling(); |
229 | 229 | |
230 | 230 | if (isset($leftSibling)) { |
231 | - $node->setOffset($leftSibling->getOffset() + $leftSibling->getWidth() + $this->colSpace); |
|
232 | - $node->setModifier($node->getOffset() - $midPoint); |
|
231 | + $node->setOffset($leftSibling->getOffset()+$leftSibling->getWidth()+$this->colSpace); |
|
232 | + $node->setModifier($node->getOffset()-$midPoint); |
|
233 | 233 | |
234 | 234 | $this->layout($node, $level); |
235 | 235 | } else { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | - self::$logger->debug('Memory usage at first scan ['.((memory_get_usage(true) / 1024) / 1024).' MB]'); |
|
240 | + self::$logger->debug('Memory usage at first scan ['.((memory_get_usage(true)/1024)/1024).' MB]'); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -252,17 +252,17 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function secondPass($node, $level, $x = 0, $y = 0) |
254 | 254 | { |
255 | - $nodeX = $node->getOffset() + $x; |
|
255 | + $nodeX = $node->getOffset()+$x; |
|
256 | 256 | $nodeY = $y; |
257 | 257 | |
258 | 258 | $node->setX($nodeX); |
259 | 259 | $node->setY($nodeY); |
260 | 260 | |
261 | - $this->height = ($this->height > $node->getY() + $node->getWidth()) ? $this->height : $node->getY() + $node->getWidth(); |
|
262 | - $this->width = ($this->width > $nodeX + $node->getWidth()) ? $this->width : $nodeX + $node->getWidth() + 10; |
|
261 | + $this->height = ($this->height > $node->getY()+$node->getWidth()) ? $this->height : $node->getY()+$node->getWidth(); |
|
262 | + $this->width = ($this->width > $nodeX+$node->getWidth()) ? $this->width : $nodeX+$node->getWidth()+10; |
|
263 | 263 | |
264 | 264 | if ($node->childCount() > 0) { |
265 | - $this->secondPass($node->getChildAt(0), $level + 1, $x + $node->getModifier(), $y + $node->getHeight() + $this->rowSpace); |
|
265 | + $this->secondPass($node->getChildAt(0), $level+1, $x+$node->getModifier(), $y+$node->getHeight()+$this->rowSpace); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | $rightSibling = $node->getRightSibling(); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $this->secondPass($rightSibling, $level, $x, $y); |
272 | 272 | } |
273 | 273 | |
274 | - self::$logger->debug('Memory usage at second scan ['.((memory_get_usage(true) / 1024) / 1024).' MB]'); |
|
274 | + self::$logger->debug('Memory usage at second scan ['.((memory_get_usage(true)/1024)/1024).' MB]'); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $modifierSumLeft += $leftAncestor->getModifier(); |
301 | 301 | } |
302 | 302 | |
303 | - $totalGap = ($firstChildLeftNeighbour->getOffset() + $modifierSumLeft + $firstChildLeftNeighbour->getWidth() + $this->branchSpace) - ($firstChild->getOffset() + $modifierSumRight); |
|
303 | + $totalGap = ($firstChildLeftNeighbour->getOffset()+$modifierSumLeft+$firstChildLeftNeighbour->getWidth()+$this->branchSpace)-($firstChild->getOffset()+$modifierSumRight); |
|
304 | 304 | |
305 | 305 | if ($totalGap > 0) { |
306 | 306 | $subTree = $node; |
@@ -312,14 +312,14 @@ discard block |
||
312 | 312 | } |
313 | 313 | |
314 | 314 | $subTreeMove = $node; |
315 | - $singleGap = $totalGap / $subTreesCount; |
|
315 | + $singleGap = $totalGap/$subTreesCount; |
|
316 | 316 | |
317 | 317 | while (isset($subTreeMove) && $subTreeMove !== $leftAncestor) { |
318 | 318 | $subTreeMove = $subTreeMove->getLeftSibling(); |
319 | 319 | |
320 | 320 | if (isset($subTreeMove)) { |
321 | - $subTreeMove->setOffset($subTreeMove->getOffset() + $totalGap); |
|
322 | - $subTreeMove->setModifier($subTreeMove->getModifier() + $totalGap); |
|
321 | + $subTreeMove->setOffset($subTreeMove->getOffset()+$totalGap); |
|
322 | + $subTreeMove->setModifier($subTreeMove->getModifier()+$totalGap); |
|
323 | 323 | $totalGap -= $singleGap; |
324 | 324 | } |
325 | 325 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | for ($i = 0; $i < $childCount; ++$i) { |
384 | 384 | $child = $node->getChildAt($i); |
385 | 385 | |
386 | - $leftmostDescendant = $this->getLeftmost($child, $level + 1, $maxlevel); |
|
386 | + $leftmostDescendant = $this->getLeftmost($child, $level+1, $maxlevel); |
|
387 | 387 | |
388 | 388 | if (isset($leftmostDescendant)) { |
389 | 389 | return $leftmostDescendant; |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $this->render(); |
452 | 452 | } |
453 | 453 | |
454 | - if (isset($this->nodes[$this->position + 1])) { |
|
454 | + if (isset($this->nodes[$this->position+1])) { |
|
455 | 455 | ++$this->position; |
456 | 456 | |
457 | 457 | return $this->nodes[$this->position]; |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | */ |
470 | 470 | public function hasNext() |
471 | 471 | { |
472 | - if (isset($this->nodes[$this->position + 1])) { |
|
472 | + if (isset($this->nodes[$this->position+1])) { |
|
473 | 473 | return true; |
474 | 474 | } else { |
475 | 475 | return false; |
@@ -97,7 +97,7 @@ |
||
97 | 97 | // Execute the command and store the process ID |
98 | 98 | $output = array(); |
99 | 99 | exec($command, $output); |
100 | - $pid = (int) $output[0]; |
|
100 | + $pid = (int)$output[0]; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if (!isset($pid)) { |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | } else { |
1034 | 1034 | // there has been an error, so decrement the version number back |
1035 | 1035 | $temp = $this->BO->getVersionNumber()->getValue(); |
1036 | - $this->BO->set('version_num', $temp - 1); |
|
1036 | + $this->BO->set('version_num', $temp-1); |
|
1037 | 1037 | |
1038 | 1038 | // check for unique violations |
1039 | 1039 | if (self::getConnection()->errno == '1062') { |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | $this->BO->setLastQuery($sqlQuery); |
1066 | 1066 | $stmt = self::getConnection()->stmt_init(); |
1067 | 1067 | |
1068 | - $newVersionNumber = $this->BO->getVersionNumber()->getValue() + 1; |
|
1068 | + $newVersionNumber = $this->BO->getVersionNumber()->getValue()+1; |
|
1069 | 1069 | |
1070 | 1070 | if ($stmt->prepare($sqlQuery)) { |
1071 | 1071 | if ($this->BO->getPropObject($attribute) instanceof Integer) { |
@@ -2441,7 +2441,7 @@ discard block |
||
2441 | 2441 | |
2442 | 2442 | if ($propName == 'version_num') { |
2443 | 2443 | $temp = $this->BO->getVersionNumber()->getValue(); |
2444 | - $this->BO->set('version_num', $temp + 1); |
|
2444 | + $this->BO->set('version_num', $temp+1); |
|
2445 | 2445 | $bindingsTypes .= 'i'; |
2446 | 2446 | array_push($params, $this->BO->getVersionNumber()->getValue()); |
2447 | 2447 | } |
@@ -2542,7 +2542,7 @@ discard block |
||
2542 | 2542 | $singleQuote1 = mb_strpos($error, "'"); |
2543 | 2543 | $singleQuote2 = mb_strrpos($error, "'"); |
2544 | 2544 | |
2545 | - $value = mb_substr($error, $singleQuote1, ($singleQuote2 - $singleQuote1) + 1); |
|
2545 | + $value = mb_substr($error, $singleQuote1, ($singleQuote2-$singleQuote1)+1); |
|
2546 | 2546 | self::$logger->debug('<<findOffendingValue ['.$value.'])'); |
2547 | 2547 | |
2548 | 2548 | return $value; |
@@ -2363,11 +2363,11 @@ |
||
2363 | 2363 | * parameters. If arrays of attribute names and values are provided, only those will be bound to |
2364 | 2364 | * the supplied statement. |
2365 | 2365 | * |
2366 | - * @param mysqli_stmt $stmt The SQL statement to bind to. |
|
2366 | + * @param \mysqli_stmt $stmt The SQL statement to bind to. |
|
2367 | 2367 | * @param array Optional array of BO attributes. |
2368 | 2368 | * @param array Optional array of BO values. |
2369 | 2369 | * |
2370 | - * @return mysqli_stmt |
|
2370 | + * @return \mysqli_stmt |
|
2371 | 2371 | * |
2372 | 2372 | * @since 1.1 |
2373 | 2373 | */ |
@@ -981,8 +981,8 @@ discard block |
||
981 | 981 | $stmt->bindValue(':OID', $this->BO->getOID(), SQLITE3_INTEGER); |
982 | 982 | |
983 | 983 | $temp = $this->BO->getVersionNumber()->getValue(); |
984 | - $this->BO->set('version_num', $temp + 1); |
|
985 | - $stmt->bindValue(':version_num', $temp + 1, SQLITE3_INTEGER); |
|
984 | + $this->BO->set('version_num', $temp+1); |
|
985 | + $stmt->bindValue(':version_num', $temp+1, SQLITE3_INTEGER); |
|
986 | 986 | |
987 | 987 | $stmt->execute(); |
988 | 988 | } else { |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | } else { |
1066 | 1066 | // there has been an error, so decrement the version number back |
1067 | 1067 | $temp = $this->BO->getVersionNumber()->getValue(); |
1068 | - $this->BO->set('version_num', $temp - 1); |
|
1068 | + $this->BO->set('version_num', $temp-1); |
|
1069 | 1069 | |
1070 | 1070 | throw new FailedSaveException('Failed to save object, SQLite error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']'); |
1071 | 1071 | } |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | $this->BO->setLastQuery($sqlQuery); |
1091 | 1091 | $stmt = self::getConnection()->prepare($sqlQuery); |
1092 | 1092 | |
1093 | - $newVersionNumber = $this->BO->getVersionNumber()->getValue() + 1; |
|
1093 | + $newVersionNumber = $this->BO->getVersionNumber()->getValue()+1; |
|
1094 | 1094 | |
1095 | 1095 | if ($stmt instanceof SQLite3Stmt) { |
1096 | 1096 | if ($this->BO->getPropObject($attribute) instanceof Integer) { |
@@ -174,7 +174,7 @@ |
||
174 | 174 | $this->set('sequence', 0); |
175 | 175 | } |
176 | 176 | |
177 | - $this->set('sequence', $this->get('sequence') + 1); |
|
177 | + $this->set('sequence', $this->get('sequence')+1); |
|
178 | 178 | $this->save(); |
179 | 179 | } |
180 | 180 |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | $URI = mb_substr($this->URI, 0, mb_strpos($this->URI, '?')); |
629 | 629 | |
630 | 630 | // let's take this opportunity to pass query string params to $this->params |
631 | - $queryString = mb_substr($this->URI, (mb_strpos($this->URI, '?') + 1)); |
|
631 | + $queryString = mb_substr($this->URI, (mb_strpos($this->URI, '?')+1)); |
|
632 | 632 | $this->queryString = $queryString; |
633 | 633 | parse_str($queryString, $this->params); |
634 | 634 | } else { |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | $name = $paramNames[$i]; |
643 | 643 | |
644 | 644 | if (!isset($this->params[trim($name, '{}')])) { |
645 | - if (isset($paramValues[$i]) && substr($name, 0, 1) == '{' && substr($name, strlen($name) - 1, 1) == '}') { |
|
645 | + if (isset($paramValues[$i]) && substr($name, 0, 1) == '{' && substr($name, strlen($name)-1, 1) == '}') { |
|
646 | 646 | $this->params[trim($name, '{}')] = $paramValues[$i]; |
647 | 647 | } |
648 | 648 | if (!isset($paramValues[$i]) && isset($defaultParams[trim($name, '{}')])) { |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | * @param string $key The key to search for |
301 | 301 | * @param mixed $default If key is not found, return this instead |
302 | 302 | * |
303 | - * @return mixed |
|
303 | + * @return string |
|
304 | 304 | * |
305 | 305 | * @since 2.0 |
306 | 306 | */ |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | * @param string $key The key to search for |
392 | 392 | * @param mixed $default If key is not found, return this instead |
393 | 393 | * |
394 | - * @return mixed |
|
394 | + * @return string |
|
395 | 395 | * |
396 | 396 | * @since 2.0 |
397 | 397 | */ |
@@ -207,7 +207,7 @@ |
||
207 | 207 | |
208 | 208 | if (isset($params['clearCache']) && $params['clearCache'] == 'true') { |
209 | 209 | try { |
210 | - FileUtils::deleteDirectoryContents($this->dataDir, array('.htaccess','html','images','pdf','xls')); |
|
210 | + FileUtils::deleteDirectoryContents($this->dataDir, array('.htaccess', 'html', 'images', 'pdf', 'xls')); |
|
211 | 211 | |
212 | 212 | $this->setStatusMessage(View::displayUpdateMessage('Cache contents deleted successfully.')); |
213 | 213 |
@@ -511,19 +511,19 @@ discard block |
||
511 | 511 | } |
512 | 512 | // found the current job |
513 | 513 | if ($this->name == $jobs[$i]) { |
514 | - if (isset($jobs[$i - 1])) { |
|
514 | + if (isset($jobs[$i-1])) { |
|
515 | 515 | // set the previous job if it exists |
516 | - $this->previousJob = $jobs[$i - 1]; |
|
516 | + $this->previousJob = $jobs[$i-1]; |
|
517 | 517 | self::$logger->debug('Previous job ['.$this->previousJob.']'); |
518 | 518 | } |
519 | - if (isset($jobs[$i + 1])) { |
|
519 | + if (isset($jobs[$i+1])) { |
|
520 | 520 | // set the next job if it exists |
521 | - $this->nextJob = $jobs[$i + 1]; |
|
521 | + $this->nextJob = $jobs[$i+1]; |
|
522 | 522 | self::$logger->debug('Next job ['.$this->nextJob.']'); |
523 | 523 | } |
524 | 524 | } |
525 | 525 | // the last job in the sequence |
526 | - if ($i == ($numOfJobs - 1)) { |
|
526 | + if ($i == ($numOfJobs-1)) { |
|
527 | 527 | $this->lastJob = $jobs[$i]; |
528 | 528 | } |
529 | 529 | } |
@@ -687,9 +687,9 @@ discard block |
||
687 | 687 | $this->unitEndTime->getYear() |
688 | 688 | ); |
689 | 689 | |
690 | - self::$logger->debug('<<getUnitDuration ['.$intEndTime - $intStartTime.']'); |
|
690 | + self::$logger->debug('<<getUnitDuration ['.$intEndTime-$intStartTime.']'); |
|
691 | 691 | |
692 | - return $intEndTime - $intStartTime; |
|
692 | + return $intEndTime-$intStartTime; |
|
693 | 693 | } |
694 | 694 | |
695 | 695 | /** |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | */ |
1160 | 1160 | |
1161 | 1161 | // the server hostname + today's date less 1 hour (i.e. yesterday where time is < 1:00AM) |
1162 | - $var1 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($host.date('Ymd', (time() - 3600)))), '+/', '-_'), '='); |
|
1162 | + $var1 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($host.date('Ymd', (time()-3600)))), '+/', '-_'), '='); |
|
1163 | 1163 | // the server's IP plus $var1 |
1164 | 1164 | $var2 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($ip.$var1)), '+/', '-_'), '='); |
1165 | 1165 |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | /** |
298 | 298 | * Get the record for this controller (if any). |
299 | 299 | * |
300 | - * @return mixed |
|
300 | + * @return ActiveRecord |
|
301 | 301 | * |
302 | 302 | * @since 1.0 |
303 | 303 | */ |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | /** |
633 | 633 | * Getter for the unit of work MAX duration. |
634 | 634 | * |
635 | - * @return int |
|
635 | + * @return Integer |
|
636 | 636 | * |
637 | 637 | * @since 1.0 |
638 | 638 | */ |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | /** |
1180 | 1180 | * Generates the two security fields to prevent remote form processing. |
1181 | 1181 | * |
1182 | - * @return array An array containing the two fields |
|
1182 | + * @return string[] An array containing the two fields |
|
1183 | 1183 | * |
1184 | 1184 | * @since 1.0 |
1185 | 1185 | */ |
@@ -1432,6 +1432,7 @@ discard block |
||
1432 | 1432 | * @since 2.0 |
1433 | 1433 | * |
1434 | 1434 | * @throws \Alpha\Exception\NotImplementedException |
1435 | + * @param Request $request |
|
1435 | 1436 | */ |
1436 | 1437 | public function doHEAD($request) |
1437 | 1438 | { |
@@ -1444,6 +1445,7 @@ discard block |
||
1444 | 1445 | * @since 2.0 |
1445 | 1446 | * |
1446 | 1447 | * @throws \Alpha\Exception\NotImplementedException |
1448 | + * @param Request $request |
|
1447 | 1449 | */ |
1448 | 1450 | public function doGET($request) |
1449 | 1451 | { |
@@ -1456,6 +1458,7 @@ discard block |
||
1456 | 1458 | * @since 2.0 |
1457 | 1459 | * |
1458 | 1460 | * @throws \Alpha\Exception\NotImplementedException |
1461 | + * @param Request $request |
|
1459 | 1462 | */ |
1460 | 1463 | public function doPOST($request) |
1461 | 1464 | { |
@@ -1468,6 +1471,7 @@ discard block |
||
1468 | 1471 | * @since 2.0 |
1469 | 1472 | * |
1470 | 1473 | * @throws \Alpha\Exception\NotImplementedException |
1474 | + * @param Request $request |
|
1471 | 1475 | */ |
1472 | 1476 | public function doPUT($request) |
1473 | 1477 | { |
@@ -1480,6 +1484,7 @@ discard block |
||
1480 | 1484 | * @since 2.0 |
1481 | 1485 | * |
1482 | 1486 | * @throws \Alpha\Exception\NotImplementedException |
1487 | + * @param Request $request |
|
1483 | 1488 | */ |
1484 | 1489 | public function doPATCH($request) |
1485 | 1490 | { |
@@ -1492,6 +1497,7 @@ discard block |
||
1492 | 1497 | * @since 2.0 |
1493 | 1498 | * |
1494 | 1499 | * @throws \Alpha\Exception\NotImplementedException |
1500 | + * @param Request $request |
|
1495 | 1501 | */ |
1496 | 1502 | public function doDELETE($request) |
1497 | 1503 | { |
@@ -1502,6 +1508,7 @@ discard block |
||
1502 | 1508 | * {@inheritdoc} |
1503 | 1509 | * |
1504 | 1510 | * @since 2.0 |
1511 | + * @param Request $request |
|
1505 | 1512 | */ |
1506 | 1513 | public function doOPTIONS($request) |
1507 | 1514 | { |
@@ -1529,6 +1536,7 @@ discard block |
||
1529 | 1536 | * {@inheritdoc} |
1530 | 1537 | * |
1531 | 1538 | * @since 2.0.2 |
1539 | + * @param Request $request |
|
1532 | 1540 | */ |
1533 | 1541 | public function doTRACE($request) |
1534 | 1542 | { |