@@ -32,7 +32,7 @@ |
||
32 | 32 | echo " <td><a href='" . $data['router']->generate('preview', ['guid' => $guid, 'revision' => $number]) . "'>{$revision['version']}</a></td>\n"; |
33 | 33 | echo " <td>" . $formatter->datetime($revision['date']) . "</td>\n"; |
34 | 34 | |
35 | - if ( $revision['user'] |
|
35 | + if ($revision['user'] |
|
36 | 36 | && $user = midcom::get()->auth->get_user($revision['user'])) { |
37 | 37 | $person_label = $user->get_storage()->name; |
38 | 38 | echo " <td>{$person_label}</td>\n"; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | |
18 | 18 | public function form_widget_simple(FormView $view, array $data) |
19 | 19 | { |
20 | - if ( !empty($data['value']) |
|
20 | + if (!empty($data['value']) |
|
21 | 21 | || is_numeric($data['value'])) { |
22 | 22 | return $data['value']; |
23 | 23 | } |
@@ -143,7 +143,7 @@ |
||
143 | 143 | |
144 | 144 | public function form_widget_simple(FormView $view, array $data) |
145 | 145 | { |
146 | - if ( !empty($data['value']) |
|
146 | + if (!empty($data['value']) |
|
147 | 147 | || is_numeric($data['value'])) { |
148 | 148 | return $this->escape($data['value']); |
149 | 149 | } |
@@ -45,7 +45,8 @@ discard block |
||
45 | 45 | $object = self::_load_backend($backend, $params); |
46 | 46 | debug_add('Using backend ' . $backend); |
47 | 47 | return $object; |
48 | - } catch (midcom_error $e) { |
|
48 | + } |
|
49 | + catch (midcom_error $e) { |
|
49 | 50 | debug_add('Failed to load backend ' . $backend . ', message:' . $e->getMessage()); |
50 | 51 | } |
51 | 52 | } |
@@ -80,7 +81,8 @@ discard block |
||
80 | 81 | $ret = $this->mail($message); |
81 | 82 | $this->error = null; |
82 | 83 | return $ret; |
83 | - } catch (Exception $e) { |
|
84 | + } |
|
85 | + catch (Exception $e) { |
|
84 | 86 | $this->error = $e->getMessage(); |
85 | 87 | return false; |
86 | 88 | } |
@@ -33,7 +33,8 @@ |
||
33 | 33 | { |
34 | 34 | try { |
35 | 35 | midcom::get()->cache->invalidate_all(); |
36 | - } catch (\Throwable $e) { |
|
36 | + } |
|
37 | + catch (\Throwable $e) { |
|
37 | 38 | $output->writeln($e->getMessage()); |
38 | 39 | } |
39 | 40 | $fs = new Filesystem; |
@@ -64,7 +64,8 @@ |
||
64 | 64 | try { |
65 | 65 | $this->__object = $this->__midcom_class_name__::get_cached($this->__identifier); |
66 | 66 | return true; |
67 | - } catch (midcom_error $e) { |
|
67 | + } |
|
68 | + catch (midcom_error $e) { |
|
68 | 69 | $e->log(); |
69 | 70 | } |
70 | 71 | return false; |
@@ -73,7 +73,8 @@ |
||
73 | 73 | if (is_a($stat, midcom_services_indexer_client::class)) { |
74 | 74 | try { |
75 | 75 | $stat->reindex(); |
76 | - } catch (RequestException $e) { |
|
76 | + } |
|
77 | + catch (RequestException $e) { |
|
77 | 78 | if ($e->hasResponse()) { |
78 | 79 | $crawler = new Crawler($e->getResponse()->getBody()->getContents()); |
79 | 80 | $body = $crawler->filterXPath('//body')->html(); |
@@ -166,7 +166,7 @@ |
||
166 | 166 | $address = addslashes($address); |
167 | 167 | return preg_replace_callback( |
168 | 168 | '/href="(http:\/\/.*?)"/i', |
169 | - function ($match) use ($address) { |
|
169 | + function($match) use ($address) { |
|
170 | 170 | return 'href="' . str_replace("URL", rawurlencode($match[1]), $address) . '"'; |
171 | 171 | }, |
172 | 172 | $html); |
@@ -148,13 +148,13 @@ |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
151 | - * Inserts a link detector to the given HTML source. All outgoing |
|
152 | - * HTTP links in the source HTML are replaced with the given |
|
153 | - * link detector address so that the token "URL" is replaced with |
|
154 | - * encoded form of the original link. It is expected that the link detector |
|
155 | - * address points to a script that records the passed link and |
|
156 | - * forwards the client to the real link target. |
|
157 | - */ |
|
151 | + * Inserts a link detector to the given HTML source. All outgoing |
|
152 | + * HTTP links in the source HTML are replaced with the given |
|
153 | + * link detector address so that the token "URL" is replaced with |
|
154 | + * encoded form of the original link. It is expected that the link detector |
|
155 | + * address points to a script that records the passed link and |
|
156 | + * forwards the client to the real link target. |
|
157 | + */ |
|
158 | 158 | private function _insert_link_detector(string $html, string $address) : string |
159 | 159 | { |
160 | 160 | $address = addslashes($address); |
@@ -122,7 +122,8 @@ discard block |
||
122 | 122 | try { |
123 | 123 | $creator = new midcom_db_person($view_metadata->get('creator')); |
124 | 124 | $creator_string = "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$creator->guid}/\">$creator->name</a>"; |
125 | - } catch (midcom_error $e) { |
|
125 | + } |
|
126 | + catch (midcom_error $e) { |
|
126 | 127 | $creator_string = $l10n->get('unknown person'); |
127 | 128 | } |
128 | 129 | $created = (int) $view_metadata->get('created'); |
@@ -135,7 +136,8 @@ discard block |
||
135 | 136 | try { |
136 | 137 | $editor = new midcom_db_person($view_metadata->get('revisor')); |
137 | 138 | $editor_string = "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$editor->guid}/\">$editor->name</a>"; |
138 | - } catch (midcom_error $e) { |
|
139 | + } |
|
140 | + catch (midcom_error $e) { |
|
139 | 141 | $editor_string = $l10n->get('unknown person'); |
140 | 142 | } |
141 | 143 |
@@ -127,7 +127,7 @@ |
||
127 | 127 | |
128 | 128 | $edited = (int) $view_metadata->get('revised'); |
129 | 129 | $revision = $view_metadata->get('revision'); |
130 | - if ( $revision > 0 |
|
130 | + if ($revision > 0 |
|
131 | 131 | && $edited != $created) { |
132 | 132 | try { |
133 | 133 | $editor = new midcom_db_person($view_metadata->get('revisor')); |