@@ -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([ |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $query->cols(['*']); |
| 68 | 68 | |
| 69 | 69 | // Workarounds :-/ |
| 70 | - if (! empty($queryObject->getFlags())) { |
|
| 70 | + if (!empty($queryObject->getFlags())) { |
|
| 71 | 71 | if ($queryObject->getFlags() === 'outfitIDs') { |
| 72 | 72 | // Prevent the VS, NC and TR "no outfit" workaround |
| 73 | 73 | $queryObject->addWhere([ |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Setup where statements |
| 82 | - if (! empty($queryObject->getWheres())) { |
|
| 82 | + if (!empty($queryObject->getWheres())) { |
|
| 83 | 83 | foreach ($queryObject->getWheres() as $where) { |
| 84 | 84 | if ($where['col'] === 'primary') { |
| 85 | 85 | $col = $this->getPrimaryKey(); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // Set up order statement |
| 98 | - if (! empty($queryObject->getOrderBy())) { |
|
| 98 | + if (!empty($queryObject->getOrderBy())) { |
|
| 99 | 99 | $orderBy = $queryObject->getOrderBy(); |
| 100 | 100 | if ($orderBy === 'primary') { |
| 101 | 101 | $orderBy = $this->getPrimaryKey(); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | ]); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - if (! empty($queryObject->getLimit())) { |
|
| 111 | + if (!empty($queryObject->getLimit())) { |
|
| 112 | 112 | $query->limit($queryObject->getLimit()); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'value' => date('U', strtotime('-48 hours')) |
| 42 | 42 | ]); |
| 43 | 43 | |
| 44 | - if (! empty($args['serverID'])) { |
|
| 44 | + if (!empty($args['serverID'])) { |
|
| 45 | 45 | $redisKey .= ":{$args['serverID']}"; |
| 46 | 46 | $queryObject->addWhere([ |
| 47 | 47 | 'col' => 'ResultServer', |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | ]); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if (! empty($args['limit'])) { |
|
| 52 | + if (!empty($args['limit'])) { |
|
| 53 | 53 | if ($args['limit'] > 50) { |
| 54 | 54 | $args['limit'] = 50; |
| 55 | 55 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | 'value' => 1 |
| 82 | 82 | ]); |
| 83 | 83 | |
| 84 | - if (! empty($args['serverID'])) { |
|
| 84 | + if (!empty($args['serverID'])) { |
|
| 85 | 85 | $queryObject->addWhere([ |
| 86 | 86 | 'col' => 'ResultServer', |
| 87 | 87 | 'value' => $args['serverID'] |
@@ -26,22 +26,22 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function appendRedisKey($post, $redisKey) |
| 28 | 28 | { |
| 29 | - if (! empty($post['wheres'])) { |
|
| 29 | + if (!empty($post['wheres'])) { |
|
| 30 | 30 | $whereMD5 = md5($post['wheres']); |
| 31 | 31 | $redisKey .= "/{$whereMD5}"; |
| 32 | 32 | } |
| 33 | - if (! empty($post['orderBy'])) { |
|
| 33 | + if (!empty($post['orderBy'])) { |
|
| 34 | 34 | $orderMD5 = md5($post['orderBy']); |
| 35 | 35 | $redisKey .= "/{$orderMD5}"; |
| 36 | 36 | } |
| 37 | - if (! empty($post['limit'])) { |
|
| 37 | + if (!empty($post['limit'])) { |
|
| 38 | 38 | // Enforce a max limit |
| 39 | 39 | if ($post['limit'] > 50) { |
| 40 | 40 | $post['limit'] = 50; |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if (empty($post['limit']) || ! isset($post['limit'])) { |
|
| 44 | + if (empty($post['limit']) || !isset($post['limit'])) { |
|
| 45 | 45 | $post['limit'] = 10; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -52,15 +52,15 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function processPostVars($post) |
| 54 | 54 | { |
| 55 | - if (! empty($post['wheres'])) { |
|
| 55 | + if (!empty($post['wheres'])) { |
|
| 56 | 56 | $return['wheres'] = json_decode($post['wheres'], true); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (! empty($post['orderBy'])) { |
|
| 59 | + if (!empty($post['orderBy'])) { |
|
| 60 | 60 | $return['orderBy'] = json_decode($post['orderBy'], true); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if (empty($post['limit']) || ! isset($post['limit'])) { |
|
| 63 | + if (empty($post['limit']) || !isset($post['limit'])) { |
|
| 64 | 64 | $post['limit'] = 10; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | ]); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if (! empty($post['orderBy'])) { |
|
| 100 | + if (!empty($post['orderBy'])) { |
|
| 101 | 101 | $queryObject->setOrderBy(array_keys($post['orderBy'])[0]); |
| 102 | 102 | $queryObject->setOrderByDirection(array_values($post['orderBy'])[0]); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $queryObject->setLimit($post['limit']); |
| 106 | 106 | |
| 107 | - if (! empty($this->getFlags())) { |
|
| 107 | + if (!empty($this->getFlags())) { |
|
| 108 | 108 | // If there are some funky things we have to do, set them. |
| 109 | 109 | $queryObject->setFlags($this->getFlags()); |
| 110 | 110 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $redisKey = "{$this->getCacheNamespace()}{$id}:{$this->getType()}"; |
| 27 | 27 | |
| 28 | - if (! empty($this->getMetrics())) { |
|
| 28 | + if (!empty($this->getMetrics())) { |
|
| 29 | 29 | foreach ($this->getMetrics() as $metric) { |
| 30 | 30 | $redisKey .= ":{$metric['col']}{$op}{$metric['value']}"; |
| 31 | 31 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'value' => $id |
| 42 | 42 | ]); |
| 43 | 43 | |
| 44 | - if (! empty($this->getMetrics())) { |
|
| 44 | + if (!empty($this->getMetrics())) { |
|
| 45 | 45 | foreach ($this->getMetrics() as $metric) { |
| 46 | 46 | $op = (isset($metric['op']) ? $metric['op'] : '='); |
| 47 | 47 | $queryObject->addWhere([ |
@@ -65,10 +65,10 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function setMetrics($metric) |
| 67 | 67 | { |
| 68 | - if (! empty($metric)) { |
|
| 68 | + if (!empty($metric)) { |
|
| 69 | 69 | // Don't allow setting if the proper data isn't there. |
| 70 | 70 | // Prevents and kind of errors later on. |
| 71 | - if (! empty($metric['col']) && ! empty($metric['value'])) { |
|
| 71 | + if (!empty($metric['col']) && !empty($metric['value'])) { |
|
| 72 | 72 | $this->metrics[] = $metric; |
| 73 | 73 | } |
| 74 | 74 | } |