@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | throw new midcom_error_midgard($e, $guid); |
| 49 | 49 | } |
| 50 | 50 | $person_class = midcom::get()->config->get('person_class'); |
| 51 | - if ( get_class($tmp) == 'midgard_person' |
|
| 51 | + if (get_class($tmp) == 'midgard_person' |
|
| 52 | 52 | && $person_class != 'midgard_person') { |
| 53 | 53 | $tmp = new $person_class($guid); |
| 54 | 54 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | $object = new $classname($src); |
| 80 | 80 | $cache[$classname][$object->guid] = $object; |
| 81 | - $cache[$classname][$object->id] =& $cache[$classname][$object->guid]; |
|
| 81 | + $cache[$classname][$object->id] = & $cache[$classname][$object->guid]; |
|
| 82 | 82 | return $cache[$classname][$object->guid]; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -136,14 +136,14 @@ discard block |
||
| 136 | 136 | return true; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if ( isset($object->__object) |
|
| 139 | + if (isset($object->__object) |
|
| 140 | 140 | && is_object($object->__object) |
| 141 | 141 | && $object->__object instanceof $class) { |
| 142 | 142 | // Decorator whose MgdSchema object matches |
| 143 | 143 | return true; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - if ( isset($object->__mgdschema_class_name__) |
|
| 146 | + if (isset($object->__mgdschema_class_name__) |
|
| 147 | 147 | && $object->__mgdschema_class_name__ == $class) { |
| 148 | 148 | // Decorator without object instantiated, check class match |
| 149 | 149 | return true; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | return $this->_get_parent_guid_uncached($object); |
| 166 | 166 | }); |
| 167 | 167 | |
| 168 | - if ( empty($parent_guid) |
|
| 168 | + if (empty($parent_guid) |
|
| 169 | 169 | || $parent_guid === $object->guid) { |
| 170 | 170 | return null; |
| 171 | 171 | } |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | ]; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - if ( $parent_property |
|
| 336 | + if ($parent_property |
|
| 337 | 337 | && $reflector->get_link_target($parent_property)) { |
| 338 | 338 | $target_class = $reflector->get_link_name($parent_property); |
| 339 | 339 | if ($target_class == 'midgard_person') { |
@@ -42,7 +42,8 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | try { |
| 44 | 44 | $tmp = midgard_object_class::get_object_by_guid($guid); |
| 45 | - } catch (mgd_exception $e) { |
|
| 45 | + } |
|
| 46 | + catch (mgd_exception $e) { |
|
| 46 | 47 | debug_add('Loading object by GUID ' . $guid . ' failed, reason: ' . $e->getMessage(), MIDCOM_LOG_INFO); |
| 47 | 48 | |
| 48 | 49 | throw new midcom_error_midgard($e, $guid); |
@@ -175,7 +176,8 @@ discard block |
||
| 175 | 176 | try { |
| 176 | 177 | $parent = $this->get_object_by_guid($parent_guid); |
| 177 | 178 | $parent_data = [$parent->__midcom_class_name__, $parent_guid]; |
| 178 | - } catch (midcom_error $e) { |
|
| 179 | + } |
|
| 180 | + catch (midcom_error $e) { |
|
| 179 | 181 | $parent_data = ['', null]; |
| 180 | 182 | $parent = null; |
| 181 | 183 | } |
@@ -187,7 +189,8 @@ discard block |
||
| 187 | 189 | |
| 188 | 190 | try { |
| 189 | 191 | return $this->get_cached($classname, $parent_guid); |
| 190 | - } catch (midcom_error $e) { |
|
| 192 | + } |
|
| 193 | + catch (midcom_error $e) { |
|
| 191 | 194 | return null; |
| 192 | 195 | } |
| 193 | 196 | } |