@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $item->title = $data['article']->title; |
19 | 19 | |
20 | -if ( $data['config']->get('link_to_external_url') |
|
20 | +if ($data['config']->get('link_to_external_url') |
|
21 | 21 | && !empty($data['article']->url)) { |
22 | 22 | $item->link = $data['article']->url; |
23 | 23 | } else { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $item->description .= '<div class="abstract">' . $view['abstract'] . '</div>'; |
34 | 34 | } |
35 | 35 | |
36 | -if ( array_key_exists('image', $view) |
|
36 | +if (array_key_exists('image', $view) |
|
37 | 37 | && $data['config']->get('rss_use_image')) { |
38 | 38 | $item->description .= "\n<div class=\"image\">" . $view['image'] . '</div>'; |
39 | 39 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | $data['query'] = new org_openpsa_reports_query_dba($guid); |
76 | 76 | $data['query']->require_do('midgard:update'); |
77 | 77 | } else { |
78 | - $data['query']= new org_openpsa_reports_query_dba(); |
|
78 | + $data['query'] = new org_openpsa_reports_query_dba(); |
|
79 | 79 | $data['query']->component = $this->_component; |
80 | 80 | } |
81 | 81 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | // Catch first the configuration option for showing editing interface instead |
36 | 36 | // of redirecting administrators |
37 | - if ( $this->_topic->can_do('net.nemein.redirector:noredirect') |
|
37 | + if ($this->_topic->can_do('net.nemein.redirector:noredirect') |
|
38 | 38 | && !$this->_config->get('admin_redirection')) { |
39 | 39 | return new midcom_response_relocate($this->router->generate('edit', ['tinyurl' => $tinyurl])); |
40 | 40 | } |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | { |
69 | 69 | $data['url'] = net_nemein_redirector_viewer::topic_links_to($this->_config); |
70 | 70 | |
71 | - if ( $this->_config->get('redirection_type') !== null |
|
72 | - && ( !$this->_topic->can_do('net.nemein.redirector:noredirect') |
|
71 | + if ($this->_config->get('redirection_type') !== null |
|
72 | + && (!$this->_topic->can_do('net.nemein.redirector:noredirect') |
|
73 | 73 | || $this->_config->get('admin_redirection'))) { |
74 | 74 | return $this->redirect($data['url']); |
75 | 75 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | - if ( $this->_topic->can_do('midgard:update') |
|
57 | + if ($this->_topic->can_do('midgard:update') |
|
58 | 58 | && $this->_topic->can_do('midcom:component_config')) { |
59 | 59 | $buttons[] = $workflow->get_button($this->router->generate('config'), [ |
60 | 60 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | ]); |
41 | 41 | } |
42 | 42 | |
43 | - if ( $this->_article->topic === $this->_topic->id |
|
43 | + if ($this->_article->topic === $this->_topic->id |
|
44 | 44 | && $this->_article->can_do('midgard:delete')) { |
45 | 45 | $delete = $this->get_workflow('delete', ['object' => $this->_article]); |
46 | 46 | $buttons[] = $delete->get_button($this->router->generate('delete', ['guid' => $this->_article->guid])); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $this->_datamanager->set_storage($this->_article); |
82 | 82 | |
83 | 83 | $arg = $this->_article->name ?: $this->_article->guid; |
84 | - if ( $arg != 'index' |
|
84 | + if ($arg != 'index' |
|
85 | 85 | && $this->_config->get('hide_navigation')) { |
86 | 86 | $this->add_breadcrumb("{$arg}/", $this->_article->title); |
87 | 87 | } |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | midcom::get()->metadata->set_request_metadata($this->_article->metadata->revised, $this->_article->guid); |
92 | 92 | $this->bind_view_to_object($this->_article, $this->_datamanager->get_schema()->get_name()); |
93 | 93 | |
94 | - if ( $this->_config->get('indexinnav') |
|
94 | + if ($this->_config->get('indexinnav') |
|
95 | 95 | || $this->_config->get('autoindex') |
96 | 96 | || $this->_article->name != 'index') { |
97 | 97 | $this->set_active_leaf($this->_article->id); |
98 | 98 | } |
99 | 99 | |
100 | - if ( $this->_config->get('folder_in_title') |
|
100 | + if ($this->_config->get('folder_in_title') |
|
101 | 101 | && $this->_topic->extra != $this->_article->title) { |
102 | 102 | midcom::get()->head->set_pagetitle("{$this->_topic->extra}: {$this->_article->title}"); |
103 | 103 | } else { |
@@ -112,7 +112,8 @@ |
||
112 | 112 | foreach ($qb->execute() as $article) { |
113 | 113 | try { |
114 | 114 | $datamanager->set_storage($article); |
115 | - } catch (midcom_error $e) { |
|
115 | + } |
|
116 | + catch (midcom_error $e) { |
|
116 | 117 | $e->log(); |
117 | 118 | continue; |
118 | 119 | } |
@@ -46,7 +46,8 @@ |
||
46 | 46 | $customer_html = '<a href="' . $contacts_url . '/group/' . $customer->guid . '/">' . $customer_html . "</a>\n"; |
47 | 47 | } |
48 | 48 | echo $customer_html; |
49 | - } catch (midcom_error) { |
|
49 | + } |
|
50 | + catch (midcom_error) { |
|
50 | 51 | } |
51 | 52 | |
52 | 53 | if ($project->manager) { |
@@ -102,7 +102,7 @@ |
||
102 | 102 | $this->_user_id = midcom::get()->auth->acl->get_user_id(); |
103 | 103 | } |
104 | 104 | |
105 | - if ( $this->hide_invisible |
|
105 | + if ($this->hide_invisible |
|
106 | 106 | && !$this->_visibility_checks_added) { |
107 | 107 | if (!midcom::get()->config->get('show_hidden_objects')) { |
108 | 108 | $this->add_constraint('metadata.hidden', '=', false); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return []; |
55 | 55 | } |
56 | 56 | $results = explode($this->multiple_separator, substr($input, 1, -1)); |
57 | - if ( !empty($this->config['widget_config']['id_field']) |
|
57 | + if (!empty($this->config['widget_config']['id_field']) |
|
58 | 58 | && $this->config['widget_config']['id_field'] == 'id') { |
59 | 59 | $results = array_map(intval(...), $results); |
60 | 60 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | public function reverseTransform(mixed $array) : mixed |
69 | 69 | { |
70 | - if (!is_array($array) ) { |
|
70 | + if (!is_array($array)) { |
|
71 | 71 | throw new TransformationFailedException('Expected an array.'); |
72 | 72 | } |
73 | 73 |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $password_length = mb_strlen($password); |
271 | 271 | |
272 | 272 | if ($password_length < $this->_config->get('min_password_length')) { |
273 | - if ($show_ui_message){ |
|
273 | + if ($show_ui_message) { |
|
274 | 274 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password too short'), 'error'); |
275 | 275 | } |
276 | 276 | return false; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | if ($score < $this->_config->get('min_password_score')) { |
291 | - if ($show_ui_message){ |
|
291 | + if ($show_ui_message) { |
|
292 | 292 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password weak'), 'error'); |
293 | 293 | } |
294 | 294 | return false; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $account = $this->get_account(); |
152 | 152 | if (!empty($new_password)) { |
153 | 153 | //check if the new encrypted password was already used |
154 | - if ( !$this->check_password_reuse($new_password, true) |
|
154 | + if (!$this->check_password_reuse($new_password, true) |
|
155 | 155 | || !$this->check_password_strength($new_password, true)) { |
156 | 156 | $this->errstr = "password strength too low"; |
157 | 157 | return false; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $password_length = mb_strlen($password); |
271 | 271 | |
272 | 272 | if ($password_length < $this->_config->get('min_password_length')) { |
273 | - if ($show_ui_message){ |
|
273 | + if ($show_ui_message) { |
|
274 | 274 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password too short'), 'error'); |
275 | 275 | } |
276 | 276 | return false; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | if ($score < $this->_config->get('min_password_score')) { |
291 | - if ($show_ui_message){ |
|
291 | + if ($show_ui_message) { |
|
292 | 292 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), $this->_l10n->get('password weak'), 'error'); |
293 | 293 | } |
294 | 294 | return false; |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | |
433 | 433 | public static function get_person_by_formdata(array $data) : ?midcom_db_person |
434 | 434 | { |
435 | - if ( empty($data['username']) |
|
435 | + if (empty($data['username']) |
|
436 | 436 | || empty($data['password'])) { |
437 | 437 | return null; |
438 | 438 | } |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | * If the maximum number of attempts is reached and the oldest attempt |
482 | 482 | * on the stack is within our defined timeframe, we block the account |
483 | 483 | */ |
484 | - if ( count($attempts) >= $max_attempts |
|
484 | + if (count($attempts) >= $max_attempts |
|
485 | 485 | && $attempts[$max_attempts - 1] >= (time() - ($timeframe * 60))) { |
486 | 486 | $this->disable_account(); |
487 | 487 | $stat = false; |