Passed
Push — master ( 0e4958...46624d )
by Matthew
03:42 queued 01:13
created
api/config/_database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 }
6 6
 
7 7
 $app->register(new Silex\Provider\DoctrineServiceProvider(), array(
8
-    'db.options' => array (
8
+    'db.options' => array(
9 9
         'driver'    => DB_DRIVER,
10 10
         'host'      => DB_HOST,
11 11
         'dbname'    => DB_NAME,
Please login to merge, or discard this patch.
api/config/_router.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 
107 107
 $app->get('/draft/{draft_id}/picks', 'pick.controller:GetAll')->before($draftViewable)->before($draftInProgressOrCompleted);
108 108
 $app->get('/draft/{draft_id}/picks/updated', 'pick.controller:GetUpdated')->before($draftViewable)->before($draftInProgressOrCompleted);
109
-$app->put('/draft/{draft_id}/pick/{pick_id}/depth_chart/{position_id}', 'pick.controller:UpdateDepthChart')->before($draftViewable)->before($draftInProgressOrCompletedTenMinutes);#Give a ten minute grace period to allow edits right at the end
109
+$app->put('/draft/{draft_id}/pick/{pick_id}/depth_chart/{position_id}', 'pick.controller:UpdateDepthChart')->before($draftViewable)->before($draftInProgressOrCompletedTenMinutes); #Give a ten minute grace period to allow edits right at the end
110 110
 $app->get('/draft/{draft_id}/picks/last', 'pick.controller:GetLast')->before($draftViewable)->before($draftInProgressOrCompleted);
111 111
 $app->get('/draft/{draft_id}/picks/next', 'pick.controller:GetNext')->before($draftViewable)->before($draftInProgressOrCompleted);
112 112
 $app->get('/draft/{draft_id}/manager/{manager_id}/picks/all', 'pick.controller:GetAllManagerPicks')->before($draftViewable)->before($draftInProgressOrCompleted);
Please login to merge, or discard this patch.
api/config/_registerRepositories.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,42 +6,42 @@
 block discarded – undo
6 6
 
7 7
 //Repositories
8 8
 //Repositories are classes that are responsible for loading and saving data.
9
-$app['phpdraft.LoginUserRepository'] = function () use ($app) {
9
+$app['phpdraft.LoginUserRepository'] = function() use ($app) {
10 10
   return new \PhpDraft\Domain\Repositories\LoginUserRepository($app);
11 11
 };
12 12
 
13
-$app['phpdraft.DraftRepository'] = function () use ($app) {
13
+$app['phpdraft.DraftRepository'] = function() use ($app) {
14 14
   return new \PhpDraft\Domain\Repositories\DraftRepository($app);
15 15
 };
16 16
 
17
-$app['phpdraft.ManagerRepository'] = function () use ($app) {
17
+$app['phpdraft.ManagerRepository'] = function() use ($app) {
18 18
   return new \PhpDraft\Domain\Repositories\ManagerRepository($app);
19 19
 };
20 20
 
21
-$app['phpdraft.PickRepository'] = function () use ($app) {
21
+$app['phpdraft.PickRepository'] = function() use ($app) {
22 22
   return new \PhpDraft\Domain\Repositories\PickRepository($app);
23 23
 };
24 24
 
25
-$app['phpdraft.TradeRepository'] = function () use ($app) {
25
+$app['phpdraft.TradeRepository'] = function() use ($app) {
26 26
   return new \PhpDraft\Domain\Repositories\TradeRepository($app);
27 27
 };
28 28
 
29
-$app['phpdraft.DraftDataRepository'] = function () use ($app) {
29
+$app['phpdraft.DraftDataRepository'] = function() use ($app) {
30 30
   return new \PhpDraft\Domain\Repositories\DraftDataRepository($app);
31 31
 };
32 32
 
33
-$app['phpdraft.RoundTimeRepository'] = function () use ($app) {
33
+$app['phpdraft.RoundTimeRepository'] = function() use ($app) {
34 34
   return new \PhpDraft\Domain\Repositories\RoundTimeRepository($app);
35 35
 };
36 36
 
37
-$app['phpdraft.ProPlayerRepository'] = function () use ($app) {
37
+$app['phpdraft.ProPlayerRepository'] = function() use ($app) {
38 38
   return new \PhpDraft\Domain\Repositories\ProPlayerRepository($app);
39 39
 };
40 40
 
41
-$app['phpdraft.DraftStatsRepository'] = function () use ($app) {
41
+$app['phpdraft.DraftStatsRepository'] = function() use ($app) {
42 42
   return new \PhpDraft\Domain\Repositories\DraftStatsRepository($app);
43 43
 };
44 44
 
45
-$app['phpdraft.DepthChartPositionRepository'] = function () use ($app) {
45
+$app['phpdraft.DepthChartPositionRepository'] = function() use ($app) {
46 46
   return new \PhpDraft\Domain\Repositories\DepthChartPositionRepository($app);
47 47
 };
48 48
\ No newline at end of file
Please login to merge, or discard this patch.
api/config/_security.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
   throw new Exception('Invalid application setup.');
10 10
 }
11 11
 
12
-$app['users'] = function () use ($app) {
12
+$app['users'] = function() use ($app) {
13 13
   return new UserProvider($app);
14 14
 };
15 15
 
Please login to merge, or discard this patch.
api/config/Security/AuthenticationEntryPoint.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
   {
19 19
       $array = array('success' => false);
20 20
       
21
-      if($authException) {
21
+      if ($authException) {
22 22
         $array['error'] = $authException;
23 23
       }
24 24
 
Please login to merge, or discard this patch.
api/config/_registerFactories.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
   };
17 17
 });
18 18
 
19
-$app['phpdraft.EmailValidator'] = $app->factory(function () {
19
+$app['phpdraft.EmailValidator'] = $app->factory(function() {
20 20
   return new EmailValidator();
21 21
 });
22 22
 
Please login to merge, or discard this patch.
api/config/_app.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3
-require_once __DIR__.'/../../vendor/autoload.php';
3
+require_once __DIR__ . '/../../vendor/autoload.php';
4 4
 
5 5
 $app = new Silex\Application();
6 6
 
7 7
 //Handles settings users can define
8 8
 //Please see README.md for instructions on how to setup
9
-require_once __DIR__.'/../../appsettings.php';
9
+require_once __DIR__ . '/../../appsettings.php';
10 10
 
11 11
 $app['debug'] = DEBUG_MODE;
12 12
 
13
-require_once __DIR__.'/_database.php';      //Sets up database connections
14
-require_once __DIR__.'/_log.php';           //Sets up logging
13
+require_once __DIR__ . '/_database.php'; //Sets up database connections
14
+require_once __DIR__ . '/_log.php'; //Sets up logging
15 15
 
16 16
 //Registrations with Pimple DI
17
-require_once __DIR__.'/_registerServices.php';
18
-require_once __DIR__.'/_registerRepositories.php';
19
-require_once __DIR__.'/_registerValidators.php';
20
-require_once __DIR__.'/_registerFactories.php';
21
-
22
-require_once __DIR__.'/_middlewares.php';   //Defines middleware handlers for shared logic, like ensuring a draft is editable
23
-require_once __DIR__.'/_router.php';        //Sets up controller routing
24
-require_once __DIR__.'/_security.php';      //Sets up Symfony-based security & user authentication
17
+require_once __DIR__ . '/_registerServices.php';
18
+require_once __DIR__ . '/_registerRepositories.php';
19
+require_once __DIR__ . '/_registerValidators.php';
20
+require_once __DIR__ . '/_registerFactories.php';
21
+
22
+require_once __DIR__ . '/_middlewares.php'; //Defines middleware handlers for shared logic, like ensuring a draft is editable
23
+require_once __DIR__ . '/_router.php'; //Sets up controller routing
24
+require_once __DIR__ . '/_security.php'; //Sets up Symfony-based security & user authentication
25 25
 
26 26
 return $app;
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
api/config/_log.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
   throw new Exception('Invalid application setup.');
5 5
 }
6 6
 
7
-if($app['debug'] == true) {
7
+if ($app['debug'] == true) {
8 8
   $app->register(new Silex\Provider\MonologServiceProvider(), array(
9
-      'monolog.logfile' => __DIR__.'/logs/' . LOGFILE_NAME,
9
+      'monolog.logfile' => __DIR__ . '/logs/' . LOGFILE_NAME,
10 10
   ));
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
api/config/_middlewares.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
   throw new Exception('Invalid application setup.');
12 12
 }
13 13
 
14
-$app->error(function (\Exception $e, $code) use($app) {
14
+$app->error(function(\Exception $e, $code) use($app) {
15 15
   return $app->json(array("error" => $e->getMessage()), Response::HTTP_INTERNAL_SERVER_ERROR);
16 16
 });
17 17
 
18 18
 //If we get application/json, decode the data so controllers can use it
19
-$app->before(function (Request $request) {
19
+$app->before(function(Request $request) {
20 20
   if (0 === strpos($request->headers->get('Content-Type'), 'application/json')) {
21 21
     $data = json_decode($request->getContent(), true);
22 22
     $request->request->replace(is_array($data) ? $data : array());
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
   $viewable = $app['phpdraft.DraftValidator']->IsDraftViewableForUser($draft_id, $request);
31 31
 
32
-  if(!$viewable) {
32
+  if (!$viewable) {
33 33
     $response = new PhpDraftResponse(false, array());
34 34
     $response->errors[] = "Draft marked as private.";
35 35
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
   $setting_up = $app['phpdraft.DraftValidator']->IsDraftSettingUpOrInProgress($draft);
45 45
 
46
-  if(!$setting_up->success) {
46
+  if (!$setting_up->success) {
47 47
     return $app->json(array($setting_up), $setting_up->responseType());
48 48
   }
49 49
 };
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
   $in_progress = $app['phpdraft.DraftValidator']->IsDraftInProgress($draft);
56 56
 
57
-  if(!$in_progress->success) {
57
+  if (!$in_progress->success) {
58 58
     return $app->json(array($in_progress), $in_progress->responseType());
59 59
   }
60 60
 };
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
   $in_progress = $app['phpdraft.DraftValidator']->IsDraftInProgressOrComplete($draft);
67 67
 
68
-  if(!$in_progress->success) {
68
+  if (!$in_progress->success) {
69 69
     return $app->json(array($in_progress), $in_progress->responseType());
70 70
   }
71 71
 };
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
   $grace_period = $app['phpdraft.DraftValidator']->IsDraftInProgressOrCompletedInLessThanTen($draft);
79 79
 
80
-  if(!$grace_period->success) {
80
+  if (!$grace_period->success) {
81 81
     return $app->json(array($grace_period), $grace_period->responseType());
82 82
   }
83 83
 };
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
   $completed = $app['phpdraft.DraftValidator']->IsDraftComplete($draft);
90 90
 
91
-  if(!$completed->success) {
91
+  if (!$completed->success) {
92 92
     return $app->json(array($completed), $completed->responseType());
93 93
   }
94 94
 };
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
   $editable = $app['phpdraft.DraftValidator']->IsDraftEditableForUser($draft, $current_user);
103 103
 
104
-  if(!$editable) {
104
+  if (!$editable) {
105 105
     $response = new PhpDraft\Domain\Models\PhpDraftResponse(false, array());
106 106
     $response->errors[] = "You do not have permission to this draft.";
107 107
 
Please login to merge, or discard this patch.