@@ -1,5 +1,4 @@ |
||
1 | 1 | <?php |
2 | -use Silex\Application; |
|
3 | 2 | use Kineo\Controller\VoteController; |
4 | 3 | |
5 | 4 | $app['vote.controller'] = $app->share(function() use ($app) { |
@@ -1,5 +1,4 @@ |
||
1 | 1 | <?php |
2 | -use Silex\Application; |
|
3 | 2 | use Kineo\Controller\VoteController; |
4 | 3 | |
5 | 4 | $app['vote.controller'] = $app->share(function() use ($app) { |
@@ -1,5 +1,4 @@ |
||
1 | 1 | <?php |
2 | -use Silex\Application; |
|
3 | 2 | use Kineo\Controller\VoteController; |
4 | 3 | |
5 | 4 | $app['vote.controller'] = $app->share(function() use ($app) { |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
24 | 24 | |
25 | - if(is_array($result) && !empty($result)) { |
|
25 | + if (is_array($result) && !empty($result)) { |
|
26 | 26 | $this->constituencies = $result; |
27 | 27 | |
28 | 28 | return $this->constituencies; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
24 | 24 | |
25 | - if(is_array($result) && !empty($result)) { |
|
25 | + if (is_array($result) && !empty($result)) { |
|
26 | 26 | $this->constituencies = $result; |
27 | 27 | |
28 | 28 | return $this->constituencies; |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . '/application/bootstrap.php'; |
|
2 | +require_once __DIR__.'/application/bootstrap.php'; |
|
3 | 3 | |
4 | 4 | $app->run(); |
5 | 5 | \ No newline at end of file |
@@ -1,2 +1,2 @@ |
||
1 | 1 | <?php |
2 | -require $_SERVER['APP_DIR'] . '/application/app.php'; |
|
3 | 2 | \ No newline at end of file |
3 | +require $_SERVER['APP_DIR'].'/application/app.php'; |
|
4 | 4 | \ No newline at end of file |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | $this->db = $db; |
25 | 25 | |
26 | - if(isset($email)) { |
|
26 | + if (isset($email)) { |
|
27 | 27 | $this->loadUserByEmail($email); |
28 | 28 | } |
29 | 29 | } |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
45 | 45 | |
46 | 46 | // Hydrate model |
47 | - if(isset($result[0])) { |
|
48 | - foreach($result[0] as $key => $val) { |
|
47 | + if (isset($result[0])) { |
|
48 | + foreach ($result[0] as $key => $val) { |
|
49 | 49 | $this->{$key} = $val; |
50 | 50 | } |
51 | 51 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $stmt->bindValue(':voting', $voting, \PDO::PARAM_BOOL); |
74 | 74 | $stmt->execute(); |
75 | 75 | |
76 | - if(!$voting) { |
|
76 | + if (!$voting) { |
|
77 | 77 | $this->db->commit(); |
78 | 78 | return; |
79 | 79 | } |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | $this->db->commit(); |
94 | 94 | |
95 | 95 | return $userId; |
96 | - } catch(\PDOException $e) { |
|
96 | + } catch (\PDOException $e) { |
|
97 | 97 | $this->db->rollback(); |
98 | 98 | |
99 | - throw new \Exception('There was a problem saving this user: ' . $e->getMessage()); |
|
99 | + throw new \Exception('There was a problem saving this user: '.$e->getMessage()); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | } |
103 | 103 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public static function generateAssets() |
10 | 10 | { |
11 | - switch(APP_ENV) { |
|
11 | + switch (APP_ENV) { |
|
12 | 12 | case 'DEVELOPMENT': |
13 | 13 | $env = '.dev'; |
14 | 14 | break; |
@@ -22,6 +22,6 @@ discard block |
||
22 | 22 | break; |
23 | 23 | } |
24 | 24 | |
25 | - return file_get_contents(__DIR__ . '/../../../assets/spa/index'.$env.'.html'); |
|
25 | + return file_get_contents(__DIR__.'/../../../assets/spa/index'.$env.'.html'); |
|
26 | 26 | } |
27 | 27 | } |