@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | \Psr\Log\LogLevel::WARNING, |
13 | 13 | \Psr\Log\LogLevel::NOTICE); |
14 | 14 | |
15 | - public function __construct($params=false) |
|
15 | + public function __construct($params = false) |
|
16 | 16 | { |
17 | 17 | if(isset($params['defaultLogLevels'])) |
18 | 18 | { |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | { |
28 | 28 | // build a replacement array with braces around the context keys |
29 | 29 | $replace = array(); |
30 | - foreach ($context as $key => $val) { |
|
30 | + foreach($context as $key => $val) { |
|
31 | 31 | // check that the value can be casted to string |
32 | - if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { |
|
33 | - $replace['{' . $key . '}'] = $val; |
|
32 | + if(!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { |
|
33 | + $replace['{'.$key.'}'] = $val; |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 |
@@ -27,9 +27,11 @@ |
||
27 | 27 | { |
28 | 28 | // build a replacement array with braces around the context keys |
29 | 29 | $replace = array(); |
30 | - foreach ($context as $key => $val) { |
|
30 | + foreach ($context as $key => $val) |
|
31 | + { |
|
31 | 32 | // check that the value can be casted to string |
32 | - if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { |
|
33 | + if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) |
|
34 | + { |
|
33 | 35 | $replace['{' . $key . '}'] = $val; |
34 | 36 | } |
35 | 37 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | class PHPLog extends \Log\LogService |
5 | 5 | { |
6 | - public function __construct($params=false) |
|
6 | + public function __construct($params = false) |
|
7 | 7 | { |
8 | 8 | parent::__construct($params); |
9 | 9 | } |
@@ -14,8 +14,8 @@ |
||
14 | 14 | /** |
15 | 15 | * This cron script recompiles the Browscap cache |
16 | 16 | */ |
17 | -ini_set('memory_limit','-1'); // turn off memory limit for this script |
|
18 | -set_time_limit(120); // change to 2 minutes for this script |
|
17 | +ini_set('memory_limit', '-1'); // turn off memory limit for this script |
|
18 | +set_time_limit(120); // change to 2 minutes for this script |
|
19 | 19 | |
20 | 20 | require('vendor/autoload.php'); |
21 | 21 |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
92 | 92 | $params = $this->manipulateParameters($request, $odata); |
93 | 93 | $areas = $dataTable->read($odata->filter, $odata->select, $odata->top, |
94 | - $odata->skip, $odata->orderby, $params); |
|
94 | + $odata->skip, $odata->orderby, $params); |
|
95 | 95 | if($areas === false) |
96 | 96 | { |
97 | 97 | $areas = array(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
134 | 134 | $filter = $this->getFilterForPrimaryKey($args['name']); |
135 | 135 | $areas = $dataTable->read($filter, $odata->select, $odata->top, |
136 | - $odata->skip, $odata->orderby); |
|
136 | + $odata->skip, $odata->orderby); |
|
137 | 137 | if(empty($areas)) |
138 | 138 | { |
139 | 139 | return $response->withStatus(404); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** |
16 | 16 | * Create the DataTableAPI for the given DataTable info |
17 | 17 | * |
18 | - * @param string $datSetName The name of the DataSet used in the Settings |
|
18 | + * @param string $dataSetName The name of the DataSet used in the Settings |
|
19 | 19 | * @param string $dataTableName The name of the table in the DataSet |
20 | 20 | * @param string|false $primaryKeyName The table primary key. Must be specified for update/delete capable tables |
21 | 21 | */ |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $settings = array("settings"=>["determineRouteBeforeAppMiddleware"=>true]); |
14 | 14 | parent::__construct($settings); |
15 | 15 | $c = $this->getContainer(); |
16 | - $c['errorHandler'] = function($c) { return new WebErrorHandler();}; |
|
16 | + $c['errorHandler'] = function($c) { return new WebErrorHandler(); }; |
|
17 | 17 | $this->add(new AuthMiddleware()); |
18 | 18 | $this->add(new ODataMiddleware()); |
19 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function registerAPI($uri, $api) |
27 | 27 | { |
28 | - $group = $this->group($uri, function() use($api){$api->setup($this);}); |
|
28 | + $group = $this->group($uri, function() use($api){$api->setup($this); }); |
|
29 | 29 | $group->add(new \Http\Rest\SerializationMiddleware()); |
30 | 30 | $group->add(new \Http\Rest\CORSMiddleware($this->getContainer())); |
31 | 31 | } |
@@ -13,7 +13,9 @@ discard block |
||
13 | 13 | $settings = array("settings"=>["determineRouteBeforeAppMiddleware"=>true]); |
14 | 14 | parent::__construct($settings); |
15 | 15 | $c = $this->getContainer(); |
16 | - $c['errorHandler'] = function($c) { return new WebErrorHandler();}; |
|
16 | + $c['errorHandler'] = function($c) |
|
17 | + { |
|
18 | +return new WebErrorHandler();}; |
|
17 | 19 | $this->add(new AuthMiddleware()); |
18 | 20 | $this->add(new ODataMiddleware()); |
19 | 21 | } |
@@ -25,7 +27,9 @@ discard block |
||
25 | 27 | |
26 | 28 | public function registerAPI($uri, $api) |
27 | 29 | { |
28 | - $group = $this->group($uri, function() use($api){$api->setup($this);}); |
|
30 | + $group = $this->group($uri, function() use($api) |
|
31 | + { |
|
32 | +$api->setup($this);}); |
|
29 | 33 | $group->add(new \Http\Rest\SerializationMiddleware()); |
30 | 34 | $group->add(new \Http\Rest\CORSMiddleware($this->getContainer())); |
31 | 35 | } |
@@ -42,10 +42,13 @@ discard block |
||
42 | 42 | $args = array(); |
43 | 43 | $args['RawMessage'] = array(); |
44 | 44 | $args['RawMessage']['Data'] = $email->getRawMessage(); |
45 | - try { |
|
45 | + try |
|
46 | + { |
|
46 | 47 | $res = $this->ses->sendRawEmail($args); |
47 | 48 | return $res; |
48 | - } catch(\Exception $e) { |
|
49 | + } |
|
50 | + catch(\Exception $e) |
|
51 | + { |
|
49 | 52 | return false; |
50 | 53 | } |
51 | 54 | } |
@@ -66,9 +69,12 @@ discard block |
||
66 | 69 | $args['Message']['Body']['Text']['Data'] = $email->getTextBody(); |
67 | 70 | $args['Message']['Body']['Html']['Data'] = $email->getHtmlBody(); |
68 | 71 | $args['ReplyToAddresses'] = array($email->getReplyTo()); |
69 | - try { |
|
72 | + try |
|
73 | + { |
|
70 | 74 | return $this->ses->sendEmail($args); |
71 | - } catch(\Exception $e) { |
|
75 | + } |
|
76 | + catch(\Exception $e) |
|
77 | + { |
|
72 | 78 | return false; |
73 | 79 | } |
74 | 80 | } |
@@ -89,7 +89,7 @@ |
||
89 | 89 | { |
90 | 90 | $this->addValueByColName($res[0], $tmp, $colName, $row[$colName]); |
91 | 91 | } |
92 | - $tmp = $tmp+array_fill_keys(range(0,max(array_keys($tmp))),false); |
|
92 | + $tmp = $tmp + array_fill_keys(range(0, max(array_keys($tmp))), false); |
|
93 | 93 | ksort($tmp); |
94 | 94 | $res[] = $tmp; |
95 | 95 | } |
@@ -11,6 +11,9 @@ |
||
11 | 11 | $this->setTemplateName('admin.html'); |
12 | 12 | } |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $adminGroup |
|
16 | + */ |
|
14 | 17 | protected function userIsAdmin($adminGroup) |
15 | 18 | { |
16 | 19 | if($this->user === false || $this->user === null) |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->addLink('Home', '..'); |
50 | 50 | if($this->user === false || $this->user === null) |
51 | 51 | { |
52 | - $this->content['body'] = ' |
|
52 | + $this->content['body'] = ' |
|
53 | 53 | <div id="content"> |
54 | 54 | <div class="row"> |
55 | 55 | <div class="col-lg-12"> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | else if($this->isAdmin() === false) |
63 | 63 | { |
64 | - $this->content['body'] = ' |
|
64 | + $this->content['body'] = ' |
|
65 | 65 | <div id="content"> |
66 | 66 | <div class="row"> |
67 | 67 | <div class="col-lg-12"> |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | </div> |
71 | 71 | </div> |
72 | 72 | '; |
73 | - $this->content['header'] = array(); |
|
74 | - $this->content['cards'] = array(); |
|
73 | + $this->content['header'] = array(); |
|
74 | + $this->content['cards'] = array(); |
|
75 | 75 | } |
76 | 76 | return parent::getContent(); |
77 | 77 | } |
@@ -78,6 +78,9 @@ discard block |
||
78 | 78 | $this->loader->addPath($dir, $namespace); |
79 | 79 | } |
80 | 80 | |
81 | + /** |
|
82 | + * @param string $name |
|
83 | + */ |
|
81 | 84 | public function setTemplateName($name) |
82 | 85 | { |
83 | 86 | $this->templateName = $name; |
@@ -112,7 +115,6 @@ discard block |
||
112 | 115 | * Add a JavaScript file from a set of files known to the framework |
113 | 116 | * |
114 | 117 | * @param string $jsFileID the ID of the JS file |
115 | - * @param boolean $async Can the JS file be loaded asynchronously? |
|
116 | 118 | */ |
117 | 119 | public function addWellKnownJS($jsFileID) |
118 | 120 | { |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $this->content['urls']['logoutUrl'] = $this->logoutUrl; |
61 | 61 | |
62 | 62 | if($this->user === false || $this->user === null) |
63 | - { |
|
63 | + { |
|
64 | 64 | if(isset($_SERVER['REQUEST_URI']) && strstr($_SERVER['REQUEST_URI'], 'logout.php') === false) |
65 | 65 | { |
66 | 66 | $this->addLink('Login', $this->loginUrl); |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | |
42 | 42 | $this->aboutUrl = $this->settings->getGlobalSetting('about_url', $this->wwwUrl.'/about'); |
43 | 43 | $this->content['header']['right']['About'] = array( |
44 | - 'url' => $this->aboutUrl, |
|
45 | - 'menu' => $this->settings->getGlobalSetting('about_menu', array( |
|
44 | + 'url' => $this->aboutUrl, |
|
45 | + 'menu' => $this->settings->getGlobalSetting('about_menu', array( |
|
46 | 46 | 'Burning Flipside' => $this->wwwUrl.'/about/event', |
47 | 47 | 'AAR, LLC' => $this->wwwUrl.'/organization/aar', |
48 | 48 | 'Privacy Policy' => $this->wwwUrl.'/about/privacy' |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->content['urls']['loginUrl'] = $this->loginUrl; |
59 | 59 | $this->content['urls']['logoutUrl'] = $this->logoutUrl; |
60 | 60 | |
61 | - if($this->user === false || $this->user === null) |
|
61 | + if($this->user === false || $this->user === null) |
|
62 | 62 | { |
63 | 63 | if(isset($_SERVER['REQUEST_URI']) && strstr($_SERVER['REQUEST_URI'], 'logout.php') === false) |
64 | 64 | { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | { |
182 | 182 | if(!isset($this->content['notifications'])) |
183 | 183 | { |
184 | - $this->content['notifications'] = array(); |
|
184 | + $this->content['notifications'] = array(); |
|
185 | 185 | } |
186 | 186 | array_push($this->content['notifications'], array('msg'=>$message, 'sev'=>$severity, 'dismissible'=>$dismissible)); |
187 | 187 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | { |
195 | 195 | if(!isset($this->content['body'])) |
196 | 196 | { |
197 | - $this->content['body'] = $this->body; |
|
197 | + $this->content['body'] = $this->body; |
|
198 | 198 | } |
199 | 199 | //Add page JS just before rednering so it is after any added by the page explicitly |
200 | 200 | // $this->addJS('js/'.basename($_SERVER['SCRIPT_NAME'], '.php').'.js'); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | public function __construct($title) |
18 | 18 | { |
19 | - \Sentry\init(['dsn' => 'https://[email protected]/4283882' ]); |
|
19 | + \Sentry\init(['dsn' => 'https://[email protected]/4283882']); |
|
20 | 20 | $this->settings = \Settings::getInstance(); |
21 | 21 | $this->loader = new \Twig_Loader_Filesystem(dirname(__FILE__).'/../templates'); |
22 | 22 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $this->content['css'] = array($uri); |
108 | 108 | return; |
109 | 109 | } |
110 | - array_push($this->content['css'],$uri); |
|
110 | + array_push($this->content['css'], $uri); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->content['js'] = array($uri); |
123 | 123 | return; |
124 | 124 | } |
125 | - array_push($this->content['js'],$uri); |
|
125 | + array_push($this->content['js'], $uri); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | $data['menu'] = $submenu; |
177 | 177 | } |
178 | - $this->content['header']['right'] = array($name => $data)+$this->content['header']['right']; |
|
178 | + $this->content['header']['right'] = array($name => $data) + $this->content['header']['right']; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** Notification that is green for success */ |