@@ -118,8 +118,7 @@ discard block |
||
118 | 118 | if(Functions::isValidPath($certfile, true)) { |
119 | 119 | return new Certificate($certfile, $tree, $provider); |
120 | 120 | } |
121 | - } |
|
122 | - catch (\Exception $ex) { |
|
121 | + } catch (\Exception $ex) { |
|
123 | 122 | Log::addErrorLog('Certificate module error : > '.$ex->getMessage().' < with data > '.$xref.' <'); |
124 | 123 | } |
125 | 124 | |
@@ -202,7 +201,9 @@ discard block |
||
202 | 201 | */ |
203 | 202 | public function getCity(){ |
204 | 203 | $chunks = explode('/', $this->getFilename(), 2); |
205 | - if(count($chunks) > 1) return $chunks[0]; |
|
204 | + if(count($chunks) > 1) { |
|
205 | + return $chunks[0]; |
|
206 | + } |
|
206 | 207 | return null; |
207 | 208 | } |
208 | 209 | |
@@ -246,8 +247,7 @@ discard block |
||
246 | 247 | |
247 | 248 | if($sid){ |
248 | 249 | $this->source = Source::getInstance($sid, $this->tree); |
249 | - } |
|
250 | - else{ |
|
250 | + } else{ |
|
251 | 251 | $this->fetchALinkedSource(); // the method already attach the source to the Certificate object; |
252 | 252 | } |
253 | 253 | |
@@ -256,7 +256,9 @@ discard block |
||
256 | 256 | $repofact = $this->source->getFirstFact('REPO'); |
257 | 257 | if($repofact) { |
258 | 258 | $repo = $repofact->getTarget(); |
259 | - if($repo && $repo instanceof Repository) $wmtext .= ' '.$repo->getFullName().' - '; |
|
259 | + if($repo && $repo instanceof Repository) { |
|
260 | + $wmtext .= ' '.$repo->getFullName().' - '; |
|
261 | + } |
|
260 | 262 | } |
261 | 263 | $wmtext .= $this->source->getFullName(); |
262 | 264 | } |
@@ -426,7 +428,9 @@ discard block |
||
426 | 428 | } |
427 | 429 | } |
428 | 430 | |
429 | - if($sid) $this->source = Source::getInstance($sid, $this->tree); |
|
431 | + if($sid) { |
|
432 | + $this->source = Source::getInstance($sid, $this->tree); |
|
433 | + } |
|
430 | 434 | |
431 | 435 | return $this->source; |
432 | 436 | } |
@@ -88,7 +88,9 @@ |
||
88 | 88 | global $WT_TREE; |
89 | 89 | |
90 | 90 | $action = Filter::post('action'); |
91 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
91 | + if($action == 'update' && Filter::checkCsrf()) { |
|
92 | + $this->update(); |
|
93 | + } |
|
92 | 94 | |
93 | 95 | Theme::theme(new AdministrationTheme)->init($WT_TREE); |
94 | 96 | $ctrl = new PageController(); |
@@ -40,7 +40,10 @@ discard block |
||
40 | 40 | <input type="hidden" name="ged" value="<?php echo $this->data->get('url_ged');?>"> |
41 | 41 | <select name="city"> |
42 | 42 | <?php foreach ($cities as $city) { ?> |
43 | - <option value="<?php echo Functions::encryptToSafeBase64($city); ?>" <?php if(trim($city) == trim($selected_city)) echo 'selected="selected"'?> ><?php echo $city;?></option> |
|
43 | + <option value="<?php echo Functions::encryptToSafeBase64($city); ?>" <?php if(trim($city) == trim($selected_city)) { |
|
44 | + echo 'selected="selected"'?> ><?php echo $city; |
|
45 | +} |
|
46 | +?></option> |
|
44 | 47 | <?php } ?> |
45 | 48 | </select> |
46 | 49 | <input type="submit" value="<?php echo I18N::translate('Show');?>" /> |
@@ -79,7 +82,9 @@ discard block |
||
79 | 82 | $name = $certificate->getCertificateDetails() ?: ''; |
80 | 83 | $sortname = ""; |
81 | 84 | $ct_names=preg_match("/([A-Z]{2,})/", $name, $match); |
82 | - if($ct_names > 0) $sortname = $match[1].'_'; |
|
85 | + if($ct_names > 0) { |
|
86 | + $sortname = $match[1].'_'; |
|
87 | + } |
|
83 | 88 | $sortname .= $name; |
84 | 89 | ?> |
85 | 90 | <td><?php echo Filter::escapeHtml($sortname); ?></td> |
@@ -50,7 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | if($fetched = File::fetchUrl($url)) { |
52 | 52 | $content = @unserialize($fetched); |
53 | - if(is_numeric($content)) return $content; |
|
53 | + if(is_numeric($content)) { |
|
54 | + return $content; |
|
55 | + } |
|
54 | 56 | } |
55 | 57 | } |
56 | 58 | |
@@ -75,8 +77,7 @@ discard block |
||
75 | 77 | if($block_id){ |
76 | 78 | if(Cache::isCached('piwikCountYear', $this->module)) { |
77 | 79 | $visitCountYear = Cache::get('piwikCountYear', $this->module); |
78 | - } |
|
79 | - else{ |
|
80 | + } else{ |
|
80 | 81 | $visitCountYear = $this->getNumberOfVisitsPiwik($block_id); |
81 | 82 | Cache::save('piwikCountYear', $visitCountYear, $this->module); |
82 | 83 | } |
@@ -29,8 +29,7 @@ |
||
29 | 29 | date('Y'), |
30 | 30 | '<span class="odometer">' . I18N::number($this->data->get('visits_today')) . '</span>' |
31 | 31 | ); |
32 | - } |
|
33 | - else { |
|
32 | + } else { |
|
34 | 33 | $html = I18N::translate('No statistics could be retrieved from Piwik.'); |
35 | 34 | } |
36 | 35 |
@@ -77,8 +77,7 @@ |
||
77 | 77 | $index = str_replace('%', '', $match2); |
78 | 78 | if(is_numeric($index) && $index >0 && $index <= $nbLevels){ |
79 | 79 | $displayPlace = str_replace($match2, $levels[$index-1] , $displayPlace); |
80 | - } |
|
81 | - else{ |
|
80 | + } else{ |
|
82 | 81 | $displayPlace = str_replace($match2, '' , $displayPlace); |
83 | 82 | } |
84 | 83 | } |
@@ -71,12 +71,10 @@ |
||
71 | 71 | && $ctrl = new $ctrl_class($module) ) { |
72 | 72 | if(method_exists($ctrl, $method)) { |
73 | 73 | call_user_func_array(array($ctrl, $method), array()); |
74 | - } |
|
75 | - else { |
|
74 | + } else { |
|
76 | 75 | throw new \Exception('The page requested does not exist'); |
77 | 76 | } |
78 | - } |
|
79 | - else { |
|
77 | + } else { |
|
80 | 78 | throw new \Exception('The page requested does not exist'); |
81 | 79 | } |
82 | 80 | } |
@@ -53,13 +53,21 @@ |
||
53 | 53 | */ |
54 | 54 | public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) |
55 | 55 | { |
56 | - if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined'); |
|
57 | - if(!$ctrl) throw new \Exception('Base Controller not defined'); |
|
58 | - if(!$view_name) throw new \Exception('View not defined'); |
|
56 | + if(!$mvc_ctrl) { |
|
57 | + throw new \Exception('Mvc Controller not defined'); |
|
58 | + } |
|
59 | + if(!$ctrl) { |
|
60 | + throw new \Exception('Base Controller not defined'); |
|
61 | + } |
|
62 | + if(!$view_name) { |
|
63 | + throw new \Exception('View not defined'); |
|
64 | + } |
|
59 | 65 | |
60 | 66 | $mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl); |
61 | 67 | $view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View'; |
62 | - if(!class_exists($view_class)) throw new \Exception('View does not exist'); |
|
68 | + if(!class_exists($view_class)) { |
|
69 | + throw new \Exception('View does not exist'); |
|
70 | + } |
|
63 | 71 | |
64 | 72 | return new $view_class($ctrl, $data); |
65 | 73 | } |
@@ -45,7 +45,9 @@ |
||
45 | 45 | public function render() { |
46 | 46 | global $controller; |
47 | 47 | |
48 | - if(!$this->ctrl) throw new \Exception('Controller not initialised'); |
|
48 | + if(!$this->ctrl) { |
|
49 | + throw new \Exception('Controller not initialised'); |
|
50 | + } |
|
49 | 51 | |
50 | 52 | $controller = $this->ctrl; |
51 | 53 | $this->ctrl->pageHeader(); |