@@ -25,7 +25,7 @@ |
||
| 25 | 25 | /** |
| 26 | 26 | * List recent alerts in the last 48 hours |
| 27 | 27 | * |
| 28 | - * @return \League\Route\Http\JsonResponse |
|
| 28 | + * @return Response\Ok |
|
| 29 | 29 | */ |
| 30 | 30 | public function listRecent() |
| 31 | 31 | { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use League\Route\Http\JsonResponse as Response; |
| 6 | 6 | use Ps2alerts\Api\Controller\EndpointBaseController; |
| 7 | -use Ps2alerts\Api\QueryObjects\QueryObject; |
|
| 8 | 7 | use Ps2alerts\Api\Loader\ResultLoader; |
| 9 | 8 | use Symfony\Component\HttpFoundation\Request; |
| 10 | 9 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $query->cols(['*']); |
| 85 | 85 | |
| 86 | 86 | // Setup where statements |
| 87 | - if (! empty($queryObject->getWheres())) { |
|
| 87 | + if (!empty($queryObject->getWheres())) { |
|
| 88 | 88 | foreach ($queryObject->getWheres() as $where) { |
| 89 | 89 | $col = ($where['col'] === 'primary') ? $this->getPrimaryKey() : $where['col']; |
| 90 | 90 | $op = (isset($where['op']) ? $where['op'] : '='); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Set up order statement |
| 96 | - if (! empty($queryObject->getOrderBy())) { |
|
| 96 | + if (!empty($queryObject->getOrderBy())) { |
|
| 97 | 97 | $orderBy = $queryObject->getOrderBy(); |
| 98 | 98 | |
| 99 | 99 | $orderByString = ($orderBy === 'primary') ? $this->getPrimaryKey() : $orderBy; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Builds a new query factory ready for use with the QueryObjects |
| 45 | 45 | * |
| 46 | - * @return \Aura\SqlQuery\QueryFactory |
|
| 46 | + * @return \Aura\SqlQuery\AbstractQuery |
|
| 47 | 47 | */ |
| 48 | 48 | public function newQuery() |
| 49 | 49 | { |
@@ -59,7 +59,6 @@ discard block |
||
| 59 | 59 | * Sets up the resulting query based off properties present in the supplied object. |
| 60 | 60 | * |
| 61 | 61 | * @see \Ps2alerts\Api\QueryObjects\QueryObject |
| 62 | - * @param array $wheres The array of where statements to look for. |
|
| 63 | 62 | * @return array |
| 64 | 63 | */ |
| 65 | 64 | public function read(QueryObject $queryObject) |
@@ -93,7 +92,7 @@ discard block |
||
| 93 | 92 | * Sets up the PDO Object, then executes the query based on dimension. |
| 94 | 93 | * |
| 95 | 94 | * @param string $statement SQL statement that was prepared by read() |
| 96 | - * @param \Aura\SqlQuery\QueryFactory $queryObject Sent QueryObject to read dimension |
|
| 95 | + * @param QueryObject $queryObject Sent QueryObject to read dimension |
|
| 97 | 96 | * |
| 98 | 97 | * @return array The final data |
| 99 | 98 | */ |
@@ -15,27 +15,27 @@ |
||
| 15 | 15 | |
| 16 | 16 | // Inflectors |
| 17 | 17 | $container->inflector('Ps2alerts\Api\Contract\ConfigAwareInterface') |
| 18 | - ->invokeMethod('setConfig', ['config']); |
|
| 18 | + ->invokeMethod('setConfig', ['config']); |
|
| 19 | 19 | $container->inflector('Ps2alerts\Api\Contract\DatabaseAwareInterface') |
| 20 | - ->invokeMethod('setDatabaseDriver', ['Aura\Sql']); |
|
| 20 | + ->invokeMethod('setDatabaseDriver', ['Aura\Sql']); |
|
| 21 | 21 | $container->inflector('Ps2alerts\Api\Contract\TemplateAwareInterface') |
| 22 | - ->invokeMethod('setTemplateDriver', ['Twig_Environment']); |
|
| 22 | + ->invokeMethod('setTemplateDriver', ['Twig_Environment']); |
|
| 23 | 23 | $container->inflector('Ps2alerts\Api\Contract\RedisAwareInterface') |
| 24 | - ->invokeMethod('setRedisDriver', ['redis']); |
|
| 24 | + ->invokeMethod('setRedisDriver', ['redis']); |
|
| 25 | 25 | |
| 26 | 26 | // Repositories |
| 27 | 27 | $container->add('Ps2alerts\Api\Repository\ResultRepository'); |
| 28 | 28 | |
| 29 | 29 | // Loaders |
| 30 | 30 | $container->add('Ps2alerts\Api\Loader\ResultLoader') |
| 31 | - ->withArgument('Ps2alerts\Api\Repository\ResultRepository'); |
|
| 31 | + ->withArgument('Ps2alerts\Api\Repository\ResultRepository'); |
|
| 32 | 32 | |
| 33 | 33 | // Endpoint Injectors |
| 34 | 34 | $container->add('Ps2alerts\Api\Controller\Alerts\ResultsEndpointController') |
| 35 | - ->withArgument('Ps2alerts\Api\Loader\ResultLoader'); |
|
| 35 | + ->withArgument('Ps2alerts\Api\Loader\ResultLoader'); |
|
| 36 | 36 | |
| 37 | 37 | // Container Inflector |
| 38 | 38 | $container->inflector('League\Container\ContainerAwareInterface') |
| 39 | - ->invokeMethod('setContainer', [$container]); |
|
| 39 | + ->invokeMethod('setContainer', [$container]); |
|
| 40 | 40 | |
| 41 | 41 | return $container; |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | $container = new League\Container\Container; |
| 4 | 4 | |
| 5 | 5 | // Register the request object singleton to be used later in the request cyncle |
| 6 | -$container->singleton('Symfony\Component\HttpFoundation\Request', function () { |
|
| 6 | +$container->singleton('Symfony\Component\HttpFoundation\Request', function() { |
|
| 7 | 7 | return Symfony\Component\HttpFoundation\Request::createFromGlobals(); |
| 8 | 8 | }); |
| 9 | 9 | |
@@ -32,13 +32,13 @@ |
||
| 32 | 32 | ]; |
| 33 | 33 | |
| 34 | 34 | // Register the singleton with the container |
| 35 | - $this->getContainer()->singleton('Twig_Environment', function () use ($globals, $config) { |
|
| 35 | + $this->getContainer()->singleton('Twig_Environment', function() use ($globals, $config) { |
|
| 36 | 36 | |
| 37 | 37 | $cache = false; |
| 38 | 38 | $debug = true; |
| 39 | 39 | |
| 40 | 40 | if ($config['environment'] === "production" || $config['environment'] === "staging") { |
| 41 | - $cache = __DIR__ .'/../../cache'; |
|
| 41 | + $cache = __DIR__ . '/../../cache'; |
|
| 42 | 42 | $debug = false; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function register() |
| 21 | 21 | { |
| 22 | - $this->getContainer()->singleton('Aura\Sql', function () { |
|
| 22 | + $this->getContainer()->singleton('Aura\Sql', function() { |
|
| 23 | 23 | $config = $this->getContainer()->get('config')['database']; |
| 24 | 24 | |
| 25 | 25 | $pdo = new ExtendedPdo( |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function register() |
| 20 | 20 | { |
| 21 | - $this->getContainer()->singleton('config', function () { |
|
| 21 | + $this->getContainer()->singleton('config', function() { |
|
| 22 | 22 | return include __DIR__ . '/../../config/config.php'; |
| 23 | 23 | }); |
| 24 | 24 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function register() |
| 25 | 25 | { |
| 26 | - $this->getContainer()->singleton('redis', function () { |
|
| 26 | + $this->getContainer()->singleton('redis', function() { |
|
| 27 | 27 | $redisConfig = $this->getContainer()->get('config')['redis']; |
| 28 | 28 | |
| 29 | 29 | $client = new Client([ |