@@ -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 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $config = ConfigProvider::getInstance(); |
| 200 | 200 | |
| 201 | 201 | // used to track when our pagination range ends |
| 202 | - $end = ($this->startPoint + $config->get('app.list.page.amount')); |
|
| 202 | + $end = ($this->startPoint+$config->get('app.list.page.amount')); |
|
| 203 | 203 | |
| 204 | 204 | $body = ''; |
| 205 | 205 | |
@@ -289,14 +289,14 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | $body = ''; |
| 291 | 291 | |
| 292 | - $end = ($this->startPoint + $config->get('app.list.page.amount')); |
|
| 292 | + $end = ($this->startPoint+$config->get('app.list.page.amount')); |
|
| 293 | 293 | |
| 294 | 294 | if ($end > $this->resultCount) { |
| 295 | 295 | $end = $this->resultCount; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | if ($this->resultCount > 0) { |
| 299 | - $body .= '<p align="center">Displaying '.($this->startPoint + 1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>. '; |
|
| 299 | + $body .= '<p align="center">Displaying '.($this->startPoint+1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>. '; |
|
| 300 | 300 | } else { |
| 301 | 301 | if (!empty($this->query)) { |
| 302 | 302 | $body .= View::displayUpdateMessage('There were no search results for your query.'); |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | if ($this->startPoint > 0) { |
| 309 | 309 | // handle secure URLs |
| 310 | 310 | if (isset($params['tk'])) { |
| 311 | - $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint - $config->get('app.list.page.amount'))).'">«</a></li>'; |
|
| 311 | + $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint-$config->get('app.list.page.amount'))).'">«</a></li>'; |
|
| 312 | 312 | } else { |
| 313 | - $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint - $config->get('app.list.page.amount')).'">«</a></li>'; |
|
| 313 | + $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint-$config->get('app.list.page.amount')).'">«</a></li>'; |
|
| 314 | 314 | } |
| 315 | 315 | } elseif ($this->resultCount > $config->get('app.list.page.amount')) { |
| 316 | 316 | $body .= '<li class="disabled"><a href="#">«</a></li>'; |
@@ -336,9 +336,9 @@ discard block |
||
| 336 | 336 | if ($this->resultCount > $end) { |
| 337 | 337 | // handle secure URLs |
| 338 | 338 | if (isset($params['tk'])) { |
| 339 | - $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint + $config->get('app.list.page.amount'))).'">Next->></a></li>'; |
|
| 339 | + $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint+$config->get('app.list.page.amount'))).'">Next->></a></li>'; |
|
| 340 | 340 | } else { |
| 341 | - $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint + $config->get('app.list.page.amount')).'">»</a></li>'; |
|
| 341 | + $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint+$config->get('app.list.page.amount')).'">»</a></li>'; |
|
| 342 | 342 | } |
| 343 | 343 | } elseif ($this->resultCount > $config->get('app.list.page.amount')) { |
| 344 | 344 | $body .= '<li class="disabled"><a href="#">»</a></li>'; |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | $iv |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | - return $iv . $encryptedData; |
|
| 75 | + return $iv.$encryptedData; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Alpha\Util\Config\ConfigProvider; |
| 7 | 7 | use Alpha\Util\Http\Request; |
| 8 | 8 | use Alpha\Util\Http\Response; |
| 9 | -use Alpha\Util\Http\Session\SessionProviderFactory; |
|
| 10 | 9 | use Alpha\View\View; |
| 11 | 10 | use Alpha\Controller\Front\FrontController; |
| 12 | 11 | |
@@ -629,15 +629,15 @@ |
||
| 629 | 629 | $unixTS = $this->getUnixValue(); |
| 630 | 630 | |
| 631 | 631 | if ($now > $unixTS) { |
| 632 | - $difference = $now - $unixTS; |
|
| 632 | + $difference = $now-$unixTS; |
|
| 633 | 633 | $tense = 'ago'; |
| 634 | 634 | } else { |
| 635 | - $difference = $unixTS - $now; |
|
| 635 | + $difference = $unixTS-$now; |
|
| 636 | 636 | $tense = 'from now'; |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | - for ($i = 0; $difference >= $lengths[$i] && $i < count($lengths) - 1; ++$i) { |
|
| 640 | - $difference = round($difference / $lengths[$i]); |
|
| 639 | + for ($i = 0; $difference >= $lengths[$i] && $i < count($lengths)-1; ++$i) { |
|
| 640 | + $difference = round($difference/$lengths[$i]); |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | $difference = round($difference); |
@@ -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 | { |
@@ -509,19 +509,19 @@ discard block |
||
| 509 | 509 | } |
| 510 | 510 | // found the current job |
| 511 | 511 | if ($this->name == $jobs[$i]) { |
| 512 | - if (isset($jobs[$i - 1])) { |
|
| 512 | + if (isset($jobs[$i-1])) { |
|
| 513 | 513 | // set the previous job if it exists |
| 514 | - $this->previousJob = $jobs[$i - 1]; |
|
| 514 | + $this->previousJob = $jobs[$i-1]; |
|
| 515 | 515 | self::$logger->debug('Previous job ['.$this->previousJob.']'); |
| 516 | 516 | } |
| 517 | - if (isset($jobs[$i + 1])) { |
|
| 517 | + if (isset($jobs[$i+1])) { |
|
| 518 | 518 | // set the next job if it exists |
| 519 | - $this->nextJob = $jobs[$i + 1]; |
|
| 519 | + $this->nextJob = $jobs[$i+1]; |
|
| 520 | 520 | self::$logger->debug('Next job ['.$this->nextJob.']'); |
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | // the last job in the sequence |
| 524 | - if ($i == ($numOfJobs - 1)) { |
|
| 524 | + if ($i == ($numOfJobs-1)) { |
|
| 525 | 525 | $this->lastJob = $jobs[$i]; |
| 526 | 526 | } |
| 527 | 527 | } |
@@ -685,9 +685,9 @@ discard block |
||
| 685 | 685 | intval($this->unitEndTime->getYear()) |
| 686 | 686 | ); |
| 687 | 687 | |
| 688 | - self::$logger->debug('<<getUnitDuration ['.($intEndTime - $intStartTime).']'); |
|
| 688 | + self::$logger->debug('<<getUnitDuration ['.($intEndTime-$intStartTime).']'); |
|
| 689 | 689 | |
| 690 | - return $intEndTime - $intStartTime; |
|
| 690 | + return $intEndTime-$intStartTime; |
|
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | /** |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | */ |
| 1154 | 1154 | |
| 1155 | 1155 | // the server hostname + today's date less 1 hour (i.e. yesterday where time is < 1:00AM) |
| 1156 | - $var1 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($host.date('Ymd', (time() - 3600)))), '+/', '-_'), '='); |
|
| 1156 | + $var1 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($host.date('Ymd', (time()-3600)))), '+/', '-_'), '='); |
|
| 1157 | 1157 | // the server's IP plus $var1 |
| 1158 | 1158 | $var2 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($ip.$var1)), '+/', '-_'), '='); |
| 1159 | 1159 | |
@@ -454,7 +454,7 @@ |
||
| 454 | 454 | * Custom version of the check rights method that only checks for a session for the config admin username/password, |
| 455 | 455 | * when the system database is not set-up. |
| 456 | 456 | * |
| 457 | - * @return bool |
|
| 457 | + * @return boolean|null |
|
| 458 | 458 | * |
| 459 | 459 | * @since 1.0 |
| 460 | 460 | */ |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | * A static method that attempts to return a CacheProviderInterface instance |
| 64 | 64 | * based on the name of the provider class supplied. |
| 65 | 65 | * |
| 66 | - * @param $providerName The class name of the provider class (fully qualified). |
|
| 66 | + * @param string $providerName The class name of the provider class (fully qualified). |
|
| 67 | 67 | * |
| 68 | 68 | * @throws \Alpha\Exception\IllegalArguementException |
| 69 | 69 | * |