@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | private function _find_suspects_event(midcom_core_dbaobject $object, org_openpsa_relatedto_dba $defaults, array &$links_array) |
| 55 | 55 | { |
| 56 | - if ( !is_array($object->participants) |
|
| 56 | + if (!is_array($object->participants) |
|
| 57 | 57 | || count($object->participants) < 1) { |
| 58 | 58 | //We have invalid list or zero participants, abort |
| 59 | 59 | return; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Skip components beginning with midcom or midgard |
| 53 | - if ( preg_match('/^(midcom|midgard)\./', $manifest->name) |
|
| 53 | + if (preg_match('/^(midcom|midgard)\./', $manifest->name) |
|
| 54 | 54 | && $manifest->name != 'midcom.helper.search') { |
| 55 | 55 | continue; |
| 56 | 56 | } |
@@ -196,7 +196,8 @@ discard block |
||
| 196 | 196 | foreach ($guids as $guid) { |
| 197 | 197 | try { |
| 198 | 198 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 199 | - } catch (midcom_error $e) { |
|
| 199 | + } |
|
| 200 | + catch (midcom_error $e) { |
|
| 200 | 201 | continue; |
| 201 | 202 | } |
| 202 | 203 | |
@@ -211,7 +212,8 @@ discard block |
||
| 211 | 212 | foreach ($guids as $guid) { |
| 212 | 213 | try { |
| 213 | 214 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 214 | - } catch (midcom_error $e) { |
|
| 215 | + } |
|
| 216 | + catch (midcom_error $e) { |
|
| 215 | 217 | continue; |
| 216 | 218 | } |
| 217 | 219 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | // List installed MgdSchema types and convert to DBA classes |
| 25 | 25 | foreach ($this->_request_data['schema_types'] as $schema_type) { |
| 26 | - if ( $type !== null |
|
| 26 | + if ($type !== null |
|
| 27 | 27 | && $schema_type != $type) { |
| 28 | 28 | // Skip |
| 29 | 29 | continue; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $qb = call_user_func($qb_callback); |
| 46 | 46 | $qb->add_constraint('metadata.revised', '>=', $since); |
| 47 | 47 | |
| 48 | - if ( $only_mine |
|
| 48 | + if ($only_mine |
|
| 49 | 49 | && midcom::get()->auth->user) { |
| 50 | 50 | $qb->add_constraint('metadata.authors', 'LIKE', '|' . midcom::get()->auth->user->guid . '|'); |
| 51 | 51 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | continue; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - if ( $object->can_do('midgard:update') |
|
| 218 | + if ($object->can_do('midgard:update') |
|
| 219 | 219 | && $object->can_do('midcom:approve')) { |
| 220 | 220 | $object->metadata->approve(); |
| 221 | 221 | midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.asgard'), sprintf($this->_l10n->get('object %s approved'), $object->guid)); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | { |
| 18 | 18 | public function setTargetUrl($url) |
| 19 | 19 | { |
| 20 | - if ( substr($url, 0, 1) != "/" |
|
| 20 | + if (substr($url, 0, 1) != "/" |
|
| 21 | 21 | && !preg_match('|^https?://|', $url)) { |
| 22 | 22 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
| 23 | 23 | if ($prefix == '') { |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | $option = strtoupper($option); |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | - $question .= ' [' . implode('|', $options). ']</question> '; |
|
| 107 | + $question .= ' [' . implode('|', $options) . ']</question> '; |
|
| 108 | 108 | $question = new ConfirmationQuestion($question, $default); |
| 109 | 109 | $dialog = $this->getHelperSet()->get('question'); |
| 110 | 110 | return $dialog->ask($input, $output, $question); |
@@ -40,7 +40,8 @@ |
||
| 40 | 40 | { |
| 41 | 41 | try { |
| 42 | 42 | $this->db = connection::get_em()->getConnection()->getWrappedConnection(); |
| 43 | - } catch (\Exception $e) { |
|
| 43 | + } |
|
| 44 | + catch (\Exception $e) { |
|
| 44 | 45 | $this->db = $this->create_connection($input, $output); |
| 45 | 46 | } |
| 46 | 47 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | echo " <td><span style=\"display: none;\">{$revision['date']}</span>" . strftime('%x %X Z', $revision['date']) . "</td>\n"; |
| 40 | 40 | echo " <td>"; |
| 41 | 41 | |
| 42 | - if ( $revision['user'] |
|
| 42 | + if ($revision['user'] |
|
| 43 | 43 | && $user = midcom::get()->auth->get_user($revision['user'])) { |
| 44 | 44 | echo $user->get_storage()->name; |
| 45 | 45 | } elseif ($revision['ip']) { |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | echo " <td><a href='" . $data['router']->generate('preview', ['guid' => $guid, 'revision' => $number]) . "'>{$number}</a></td>\n"; |
| 32 | 32 | echo " <td>" . $formatter->datetime($revision['date']) . "</td>\n"; |
| 33 | 33 | |
| 34 | - if ( $revision['user'] |
|
| 34 | + if ($revision['user'] |
|
| 35 | 35 | && $user = midcom::get()->auth->get_user($revision['user'])) { |
| 36 | 36 | $person_label = $user->get_storage()->name; |
| 37 | 37 | echo " <td>{$person_label}</td>\n"; |
@@ -134,7 +134,8 @@ discard block |
||
| 134 | 134 | ]; |
| 135 | 135 | try { |
| 136 | 136 | $to_arr['other_obj'] = midcom::get()->dbfactory->get_object_by_guid($mc->get_subkey($guid, $object_prefix . 'Guid')); |
| 137 | - } catch (midcom_error $e) { |
|
| 137 | + } |
|
| 138 | + catch (midcom_error $e) { |
|
| 138 | 139 | continue; |
| 139 | 140 | } |
| 140 | 141 | |
@@ -438,7 +439,8 @@ discard block |
||
| 438 | 439 | if (!($this->_object instanceof org_openpsa_relatedto_dba)) { |
| 439 | 440 | $response->status = "method requires guid of a link object as an argument"; |
| 440 | 441 | } |
| 441 | - } catch (midcom_error $e) { |
|
| 442 | + } |
|
| 443 | + catch (midcom_error $e) { |
|
| 442 | 444 | $response->status = "error: " . $e->getMessage(); |
| 443 | 445 | } |
| 444 | 446 | |
@@ -464,7 +466,8 @@ discard block |
||
| 464 | 466 | $relation = new org_openpsa_relatedto_dba($guid); |
| 465 | 467 | $response->result = $relation->delete(); |
| 466 | 468 | $response->status = 'Last message: ' . midcom_connection::get_error_string(); |
| 467 | - } catch (midcom_error $e) { |
|
| 469 | + } |
|
| 470 | + catch (midcom_error $e) { |
|
| 468 | 471 | $response->result = false; |
| 469 | 472 | $response->status = "Object '{$guid}' could not be loaded, error:" . $e->getMessage(); |
| 470 | 473 | } |
@@ -216,7 +216,7 @@ |
||
| 216 | 216 | private function _render_line(array $link, &$other_obj) |
| 217 | 217 | { |
| 218 | 218 | $this->_request_data['link'] = $link; |
| 219 | - $this->_request_data['other_obj'] =& $other_obj; |
|
| 219 | + $this->_request_data['other_obj'] = & $other_obj; |
|
| 220 | 220 | |
| 221 | 221 | $ref = midcom_helper_reflector::get($link['class']); |
| 222 | 222 | |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | while ($bt) { |
| 150 | 150 | $caller = array_shift($bt); |
| 151 | - if ( !array_key_exists('class', $caller) |
|
| 151 | + if (!array_key_exists('class', $caller) |
|
| 152 | 152 | || $caller['class'] != midcom_debug::class) { |
| 153 | - if ( !array_key_exists('function', $bt[0]) |
|
| 153 | + if (!array_key_exists('function', $bt[0]) |
|
| 154 | 154 | || $bt[0]['function'] != 'require') { |
| 155 | 155 | $caller = array_shift($bt); |
| 156 | 156 | } |
@@ -162,11 +162,11 @@ discard block |
||
| 162 | 162 | if (array_key_exists('class', $caller)) { |
| 163 | 163 | $return .= $caller['class'] . '::'; |
| 164 | 164 | } |
| 165 | - if ( array_key_exists('function', $caller) |
|
| 165 | + if (array_key_exists('function', $caller) |
|
| 166 | 166 | && substr($caller['function'], 0, 6) != 'debug_') { |
| 167 | 167 | $return .= $caller['function'] . ': '; |
| 168 | 168 | } else { |
| 169 | - $return .= $caller['file'] . ' (' . $caller['line']. '): '; |
|
| 169 | + $return .= $caller['file'] . ' (' . $caller['line'] . '): '; |
|
| 170 | 170 | } |
| 171 | 171 | return $return; |
| 172 | 172 | } |