Completed
Pull Request — master (#22)
by Matthew
01:55
created
src/commands.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@
 block discarded – undo
9 9
 use Ps2alerts\Api\Command\TestCommand;
10 10
 use Symfony\Component\Console\Application;
11 11
 
12
-require __DIR__ . '/../vendor/autoload.php';
12
+require __DIR__.'/../vendor/autoload.php';
13 13
 
14 14
 // ENV loading
15 15
 josegonzalez\Dotenv\Loader::load([
16
-    'filepath' => __DIR__ . '/../.env',
16
+    'filepath' => __DIR__.'/../.env',
17 17
     'toEnv'    => true
18 18
 ]);
19 19
 
20
-include __DIR__ . '/Command/CommandsCommon.php';
20
+include __DIR__.'/Command/CommandsCommon.php';
21 21
 
22 22
 $application = new Application();
23 23
 // List commands here
Please login to merge, or discard this patch.
src/Command/BaseCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
     protected function configure()
13 13
     {
14
-        $container = include __DIR__ . '/../container.php';
14
+        $container = include __DIR__.'/../container.php';
15 15
 
16 16
         $this->container   = $container;
17 17
         $this->auraFactory = $container->get('Ps2alerts\Api\Factory\AuraFactory');
Please login to merge, or discard this patch.
src/Command/LeaderboardOutfitsCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
                         $query->where('playerServer', $server);
78 78
                     }
79 79
 
80
-                    $query->orderBy([$metric . ' DESC']);
80
+                    $query->orderBy([$metric.' DESC']);
81 81
                     $query->limit($limit);
82 82
                     $query->offset($count);
83 83
 
Please login to merge, or discard this patch.
public/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include __DIR__ . '/../vendor/autoload.php';
3
+include __DIR__.'/../vendor/autoload.php';
4 4
 
5 5
 use League\Route\Http\Exception\NotFoundException;
6 6
 
7 7
 // ENV loading
8 8
 josegonzalez\Dotenv\Loader::load([
9
-    'filepath' => __DIR__ . '/../.env',
9
+    'filepath' => __DIR__.'/../.env',
10 10
     'toEnv'    => true
11 11
 ]);
12 12
 
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 }
22 22
 
23 23
 // Container
24
-$container = include __DIR__ . '/../src/container.php';
24
+$container = include __DIR__.'/../src/container.php';
25 25
 
26 26
 // Routes
27
-$router = include __DIR__ . '/../src/routes.php';
27
+$router = include __DIR__.'/../src/routes.php';
28 28
 
29 29
 // FIRE!!!
30 30
 try {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     if ($_ENV['ENV'] === 'development') {
50 50
         trigger_error($e->getMessage());
51 51
     } else {
52
-        $logger->addError(":warning: Exception IN API: \n\n" . $e->getMessage());
52
+        $logger->addError(":warning: Exception IN API: \n\n".$e->getMessage());
53 53
         $response = $container->get('Zend\Diactoros\Response');
54 54
 
55 55
         $response->getBody()->write(
Please login to merge, or discard this patch.
src/Controller/Endpoint/AbstractEndpointController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
             // Format into strings comma separated for SQL
101 101
             if (in_array($type, $strings)) {
102
-                $queryString = "'" . implode("','", $values) . "'";
102
+                $queryString = "'".implode("','", $values)."'";
103 103
             }
104 104
 
105 105
             return $queryString;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         $return = implode(',', $filters);
119 119
 
120 120
         if (in_array($type, $strings)) {
121
-            $return = "'" . implode("','", $filters) . "'";
121
+            $return = "'".implode("','", $filters)."'";
122 122
         }
123 123
 
124 124
         return $return;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function addDateRangeWhereClause($dates, AbstractQuery $query, $raw = false)
137 137
     {
138
-        if (! is_array($dates)) {
138
+        if (!is_array($dates)) {
139 139
             $dates = str_replace('\'', '', $dates); // Remove escaping quotes
140 140
             $dates = explode(',', $dates);
141 141
         }
Please login to merge, or discard this patch.
Controller/Endpoint/Leaderboards/LeaderboardWeaponEndpointController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             $field = $this->getField($_GET['field']);
41 41
         }
42 42
 
43
-        if (! isset($field)) {
43
+        if (!isset($field)) {
44 44
             return $this->respondWithError('Field wasn\'t provided and is required.', self::CODE_WRONG_ARGS);
45 45
         }
46 46
 
Please login to merge, or discard this patch.
Controller/Endpoint/Leaderboards/LeaderboardPlayerEndpointController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $field = $this->getField($_GET['field']);
53 53
         }
54 54
 
55
-        if (! isset($field)) {
55
+        if (!isset($field)) {
56 56
             return $this->respondWithError('Field wasn\'t provided and is required.', self::CODE_WRONG_ARGS);
57 57
         }
58 58
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         // Gets outfit details
83 83
         for ($i = 0; $i < $count; $i++) {
84
-            if (! empty($players[$i]['playerOutfit'])) {
84
+            if (!empty($players[$i]['playerOutfit'])) {
85 85
                 // Gets outfit details
86 86
                 try {
87 87
                     $outfit = $this->dataEndpoint->getOutfit($players[$i]['playerOutfit']);
Please login to merge, or discard this patch.
Controller/Endpoint/Leaderboards/AbstractLeaderboardEndpointController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,19 +18,19 @@  discard block
 block discarded – undo
18 18
     public function validateRequestVars()
19 19
     {
20 20
         try {
21
-            if (! empty($_GET['field'])) {
21
+            if (!empty($_GET['field'])) {
22 22
                 $this->parseField($_GET['field']);
23 23
             }
24 24
 
25
-            if (! empty($_GET['server'])) {
25
+            if (!empty($_GET['server'])) {
26 26
                 $this->parseServer($_GET['server']);
27 27
             }
28 28
 
29
-            if (! empty($_GET['limit'])) {
29
+            if (!empty($_GET['limit'])) {
30 30
                 $this->parseOffset($_GET['limit']);
31 31
             }
32 32
 
33
-            if (! empty($_GET['offset'])) {
33
+            if (!empty($_GET['offset'])) {
34 34
                 $this->parseOffset($_GET['offset']);
35 35
             }
36 36
         } catch (InvalidArgumentException $e) {
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             'captures'
57 57
         ];
58 58
 
59
-        if (! empty($field) && in_array($field, $validFields)) {
59
+        if (!empty($field) && in_array($field, $validFields)) {
60 60
             return $field;
61 61
         }
62 62
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             unset($validServers[$key]);
78 78
         }
79 79
 
80
-        if (! empty($server) && in_array($server, $validServers)) {
80
+        if (!empty($server) && in_array($server, $validServers)) {
81 81
             return $server;
82 82
         }
83 83
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function parseLimit($limit)
93 93
     {
94
-        if (! isset($limit) && ! is_numeric($limit)) {
94
+        if (!isset($limit) && !is_numeric($limit)) {
95 95
             throw new InvalidArgumentException("Limit needs to be in numerical format.");
96 96
         }
97 97
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function parseOffset($offset)
105 105
     {
106
-        if (! isset($offset) && ! is_numeric($offset)) {
106
+        if (!isset($offset) && !is_numeric($offset)) {
107 107
             throw new InvalidArgumentException("Offset needs to be in numerical format.");
108 108
         }
109 109
 
Please login to merge, or discard this patch.
src/Controller/Endpoint/Alerts/AlertEndpointController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
         $limit  = (int) $_GET['limit'];
94 94
 
95 95
         // Set defaults if not supplied
96
-        if (empty($offset) || ! is_numeric($offset)) {
96
+        if (empty($offset) || !is_numeric($offset)) {
97 97
             $offset = 0;
98 98
         }
99 99
 
100
-        if (empty($limit) || ! is_numeric($limit)) {
100
+        if (empty($limit) || !is_numeric($limit)) {
101 101
             $limit = 50;
102 102
         }
103 103
 
104 104
         // Check the date difference between two dates. we don't want to run queries for ALL OF ZE ALERTS NOW do we?!
105
-        if (! empty($dates)) {
105
+        if (!empty($dates)) {
106 106
             try {
107 107
                 $this->getDateValidationUtility()->validateTimeDifference($dates, 180); // Allow half a year
108 108
             } catch (InvalidArgumentException $e) {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $query->where('ResultWinner IN (?)', $this->convertStringToArrayForAuraBinds($factions));
124 124
         $query->where('ResultTimeType IN (?)', $brackets);
125 125
 
126
-        if (! empty($dates)) {
126
+        if (!empty($dates)) {
127 127
             $this->addDateRangeWhereClause($dates, $query);
128 128
         }
129 129
 
Please login to merge, or discard this patch.