@@ -5,7 +5,7 @@ |
||
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, |
@@ -106,7 +106,7 @@ |
||
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); |
@@ -6,42 +6,42 @@ |
||
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 |
@@ -16,38 +16,38 @@ |
||
16 | 16 | return new \PhpDraft\Domain\Services\EmailService($app); |
17 | 17 | }; |
18 | 18 | |
19 | -$app['phpdraft.LoginUserService'] = function () use ($app) { |
|
19 | +$app['phpdraft.LoginUserService'] = function() use ($app) { |
|
20 | 20 | return new \PhpDraft\Domain\Services\LoginUserService($app); |
21 | 21 | }; |
22 | 22 | |
23 | -$app['phpdraft.DraftService'] = function () use ($app) { |
|
23 | +$app['phpdraft.DraftService'] = function() use ($app) { |
|
24 | 24 | return new \PhpDraft\Domain\Services\DraftService($app); |
25 | 25 | }; |
26 | 26 | |
27 | -$app['phpdraft.RoundTimeService'] = function () use ($app) { |
|
27 | +$app['phpdraft.RoundTimeService'] = function() use ($app) { |
|
28 | 28 | return new \PhpDraft\Domain\Services\RoundTimeService($app); |
29 | 29 | }; |
30 | 30 | |
31 | -$app['phpdraft.ManagerService'] = function () use ($app) { |
|
31 | +$app['phpdraft.ManagerService'] = function() use ($app) { |
|
32 | 32 | return new \PhpDraft\Domain\Services\ManagerService($app); |
33 | 33 | }; |
34 | 34 | |
35 | -$app['phpdraft.ProPlayerService'] = function () use ($app) { |
|
35 | +$app['phpdraft.ProPlayerService'] = function() use ($app) { |
|
36 | 36 | return new \PhpDraft\Domain\Services\ProPlayerService($app); |
37 | 37 | }; |
38 | 38 | |
39 | -$app['phpdraft.TradeService'] = function () use ($app) { |
|
39 | +$app['phpdraft.TradeService'] = function() use ($app) { |
|
40 | 40 | return new \PhpDraft\Domain\Services\TradeService($app); |
41 | 41 | }; |
42 | 42 | |
43 | -$app['phpdraft.PickService'] = function () use ($app) { |
|
43 | +$app['phpdraft.PickService'] = function() use ($app) { |
|
44 | 44 | return new \PhpDraft\Domain\Services\PickService($app); |
45 | 45 | }; |
46 | 46 | |
47 | -$app['phpdraft.UtilityService'] = function () use ($app) { |
|
47 | +$app['phpdraft.UtilityService'] = function() use ($app) { |
|
48 | 48 | return new \PhpDraft\Domain\Services\UtilityService($app); |
49 | 49 | }; |
50 | 50 | |
51 | -$app['phpdraft.DepthChartPositionService'] = function () use ($app) { |
|
51 | +$app['phpdraft.DepthChartPositionService'] = function() use ($app) { |
|
52 | 52 | return new \PhpDraft\Domain\Services\DepthChartPositionService($app); |
53 | 53 | }; |
54 | 54 | \ No newline at end of file |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | //Validators |
8 | 8 | //Validators are for ensuring that request data is valid, and ensures save data |
9 | 9 | //does not result in corrupt data. |
10 | -$app['phpdraft.LoginUserValidator'] = function () use ($app) { |
|
10 | +$app['phpdraft.LoginUserValidator'] = function() use ($app) { |
|
11 | 11 | return new \PhpDraft\Domain\Validators\LoginUserValidator($app); |
12 | 12 | }; |
13 | 13 | |
@@ -15,30 +15,30 @@ discard block |
||
15 | 15 | return new \PhpDraft\Domain\Validators\DraftValidator($app); |
16 | 16 | }; |
17 | 17 | |
18 | -$app['phpdraft.RoundTimeValidator'] = function () use ($app) { |
|
18 | +$app['phpdraft.RoundTimeValidator'] = function() use ($app) { |
|
19 | 19 | return new \PhpDraft\Domain\Validators\RoundTimeValidator($app); |
20 | 20 | }; |
21 | 21 | |
22 | -$app['phpdraft.ManagerValidator'] = function () use ($app) { |
|
22 | +$app['phpdraft.ManagerValidator'] = function() use ($app) { |
|
23 | 23 | return new \PhpDraft\Domain\Validators\ManagerValidator($app); |
24 | 24 | }; |
25 | 25 | |
26 | -$app['phpdraft.TradeValidator'] = function () use ($app) { |
|
26 | +$app['phpdraft.TradeValidator'] = function() use ($app) { |
|
27 | 27 | return new \PhpDraft\Domain\Validators\TradeValidator($app); |
28 | 28 | }; |
29 | 29 | |
30 | -$app['phpdraft.PickValidator'] = function () use ($app) { |
|
30 | +$app['phpdraft.PickValidator'] = function() use ($app) { |
|
31 | 31 | return new \PhpDraft\Domain\Validators\PickValidator($app); |
32 | 32 | }; |
33 | 33 | |
34 | -$app['phpdraft.ProPlayerValidator'] = function () use ($app) { |
|
34 | +$app['phpdraft.ProPlayerValidator'] = function() use ($app) { |
|
35 | 35 | return new \PhpDraft\Domain\Validators\ProPlayerValidator($app); |
36 | 36 | }; |
37 | 37 | |
38 | -$app['phpdraft.DepthChartPositionValidator'] = function () use ($app) { |
|
38 | +$app['phpdraft.DepthChartPositionValidator'] = function() use ($app) { |
|
39 | 39 | return new \PhpDraft\Domain\Validators\DepthChartPositionValidator($app); |
40 | 40 | }; |
41 | 41 | |
42 | -$app['phpdraft.ObjectCache'] = function () use ($app) { |
|
42 | +$app['phpdraft.ObjectCache'] = function() use ($app) { |
|
43 | 43 | return new \phpFastCache(); |
44 | 44 | }; |
45 | 45 | \ No newline at end of file |
@@ -9,7 +9,7 @@ |
||
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 |
@@ -18,7 +18,7 @@ |
||
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 |
@@ -16,7 +16,7 @@ |
||
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 |
@@ -1,26 +1,26 @@ |
||
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 |