@@ -112,8 +112,7 @@ discard block |
||
112 | 112 | if (strpos($name, 'metadata_') === 0) |
113 | 113 | { |
114 | 114 | $metadata[substr($name, 9)] = $object->$name; |
115 | - } |
|
116 | - else |
|
115 | + } else |
|
117 | 116 | { |
118 | 117 | $node->addChild($name, self::convert_value($object->$name)); |
119 | 118 | } |
@@ -159,13 +158,11 @@ discard block |
||
159 | 158 | if ($node->getName() == 'midgard_blob') |
160 | 159 | { |
161 | 160 | $ret[] = self::blob_from_xml($node, $force); |
162 | - } |
|
163 | - else |
|
161 | + } else |
|
164 | 162 | { |
165 | 163 | $ret[] = self::object_from_xml($node, $force); |
166 | 164 | } |
167 | - } |
|
168 | - catch (\Exception $e) |
|
165 | + } catch (\Exception $e) |
|
169 | 166 | { |
170 | 167 | connection::log()->warning($e->getMessage()); |
171 | 168 | } |
@@ -240,8 +237,7 @@ discard block |
||
240 | 237 | return false; |
241 | 238 | } |
242 | 239 | $dbobject->metadata_deleted = false; |
243 | - } |
|
244 | - else if ( !$dbobject->metadata->deleted |
|
240 | + } else if ( !$dbobject->metadata->deleted |
|
245 | 241 | && $object->metadata->deleted) |
246 | 242 | { |
247 | 243 | return $dbobject->delete(); |
@@ -284,8 +280,7 @@ discard block |
||
284 | 280 | if ($object instanceof blob) |
285 | 281 | { |
286 | 282 | self::import_blob($object, $force); |
287 | - } |
|
288 | - else |
|
283 | + } else |
|
289 | 284 | { |
290 | 285 | self::import_object($object, $force); |
291 | 286 | } |
@@ -367,8 +362,7 @@ discard block |
||
367 | 362 | try |
368 | 363 | { |
369 | 364 | $value = self::resolve_link_guid($cm, $field, $value); |
370 | - } |
|
371 | - catch (NoResultException $e) |
|
365 | + } catch (NoResultException $e) |
|
372 | 366 | { |
373 | 367 | if (!$force) |
374 | 368 | { |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | try |
16 | 16 | { |
17 | 17 | return parent::add_constraint_with_property($name, $operator, $value); |
18 | - } |
|
19 | - catch (exception $e) |
|
18 | + } catch (exception $e) |
|
20 | 19 | { |
21 | 20 | return false; |
22 | 21 | } |
@@ -27,8 +26,7 @@ discard block |
||
27 | 26 | try |
28 | 27 | { |
29 | 28 | return parent::add_constraint($name, $operator, $value); |
30 | - } |
|
31 | - catch (exception $e) |
|
29 | + } catch (exception $e) |
|
32 | 30 | { |
33 | 31 | return false; |
34 | 32 | } |
@@ -111,8 +111,7 @@ |
||
111 | 111 | { |
112 | 112 | $mapping = $this->cm->getFieldMapping($property); |
113 | 113 | return $mapping['midgard:midgard_type']; |
114 | - } |
|
115 | - else if ($this->cm->hasAssociation($property)) |
|
114 | + } else if ($this->cm->hasAssociation($property)) |
|
116 | 115 | { |
117 | 116 | // for now, only PK fields are supported, which are always IDs, so.. |
118 | 117 | return translator::TYPE_UINT; |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | try |
54 | 54 | { |
55 | 55 | $property_select = $this->build_property_select($property); |
56 | - } |
|
57 | - catch (exception $e) |
|
56 | + } catch (exception $e) |
|
58 | 57 | { |
59 | 58 | return false; |
60 | 59 | } |
@@ -103,8 +102,7 @@ discard block |
||
103 | 102 | try |
104 | 103 | { |
105 | 104 | $properties[] = $this->build_property_select($this->key_property); |
106 | - } |
|
107 | - catch (exception $e) |
|
105 | + } catch (exception $e) |
|
108 | 106 | { |
109 | 107 | throw new exception('Property "' . $this->key_property . '" not found in "' . $this->classname . '"', exception::INVALID_PROPERTY); |
110 | 108 | } |
@@ -24,8 +24,7 @@ discard block |
||
24 | 24 | try |
25 | 25 | { |
26 | 26 | $result = $qb->getQuery()->getSingleResult(); |
27 | - } |
|
28 | - catch (\Doctrine\ORM\NoResultException $e) |
|
27 | + } catch (\Doctrine\ORM\NoResultException $e) |
|
29 | 28 | { |
30 | 29 | $result = null; |
31 | 30 | } |
@@ -67,8 +66,7 @@ discard block |
||
67 | 66 | try |
68 | 67 | { |
69 | 68 | $classname = self::resolve_classname($guid, true); |
70 | - } |
|
71 | - catch (exception $e) |
|
69 | + } catch (exception $e) |
|
72 | 70 | { |
73 | 71 | return false; |
74 | 72 | } |
@@ -95,8 +93,7 @@ discard block |
||
95 | 93 | { |
96 | 94 | $om = new objectmanager(connection::get_em()); |
97 | 95 | $om->undelete($entity); |
98 | - } |
|
99 | - catch (\Exception $e) |
|
96 | + } catch (\Exception $e) |
|
100 | 97 | { |
101 | 98 | exception::internal($e); |
102 | 99 | return false; |
@@ -107,16 +107,14 @@ |
||
107 | 107 | try |
108 | 108 | { |
109 | 109 | return $factory->getMetadataFor($classname); |
110 | - } |
|
111 | - catch (MappingException $e) |
|
110 | + } catch (MappingException $e) |
|
112 | 111 | { |
113 | 112 | // add namespace |
114 | 113 | $classname = $em->getConfiguration()->getEntityNamespace("midgard") . '\\' . $classname; |
115 | 114 | try |
116 | 115 | { |
117 | 116 | return $factory->getMetadataFor($classname); |
118 | - } |
|
119 | - catch (MappingException $e) |
|
117 | + } catch (MappingException $e) |
|
120 | 118 | { |
121 | 119 | // check for merged classes (duplicate tablenames) |
122 | 120 | $classname = get_class(new $classname); |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | if (file_exists(OPENPSA_PROJECT_BASEDIR . 'config/midgard-portable.inc.php')) |
44 | 44 | { |
45 | 45 | $path = OPENPSA_PROJECT_BASEDIR . 'config/midgard-portable.inc.php'; |
46 | - } |
|
47 | - else |
|
46 | + } else |
|
48 | 47 | { |
49 | 48 | $dialog = $this->getHelper('question'); |
50 | 49 | $path = $dialog->ask($input, $output, new Question('<question>Enter path to config file</question>')); |
@@ -96,8 +95,7 @@ discard block |
||
96 | 95 | if (!$em->getConnection()->getSchemaManager()->tablesExist(array($cm->getTableName()))) |
97 | 96 | { |
98 | 97 | $to_create[] = $cm; |
99 | - } |
|
100 | - else |
|
98 | + } else |
|
101 | 99 | { |
102 | 100 | $to_update[] = $cm; |
103 | 101 | } |
@@ -110,14 +108,12 @@ discard block |
||
110 | 108 | try |
111 | 109 | { |
112 | 110 | $tool->createSchema($to_create); |
113 | - } |
|
114 | - catch (\Exception $e) |
|
111 | + } catch (\Exception $e) |
|
115 | 112 | { |
116 | 113 | if (!$force) |
117 | 114 | { |
118 | 115 | throw $e; |
119 | - } |
|
120 | - else |
|
116 | + } else |
|
121 | 117 | { |
122 | 118 | $output->writeln('<error>' . $e->getMessage() . '</error>'); |
123 | 119 | } |
@@ -187,14 +183,12 @@ discard block |
||
187 | 183 | try |
188 | 184 | { |
189 | 185 | $conn->executeQuery($sql_line); |
190 | - } |
|
191 | - catch (\Exception $e) |
|
186 | + } catch (\Exception $e) |
|
192 | 187 | { |
193 | 188 | if (!$force) |
194 | 189 | { |
195 | 190 | throw $e; |
196 | - } |
|
197 | - else |
|
191 | + } else |
|
198 | 192 | { |
199 | 193 | $output->writeln('<error>' . $e->getMessage() . '</error>'); |
200 | 194 | } |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | || $property->link['target'] === $property->get_parent()->name) |
85 | 85 | { |
86 | 86 | $target_class = $property->link['target']; |
87 | - } |
|
88 | - else |
|
87 | + } else |
|
89 | 88 | { |
90 | 89 | if (!array_key_exists($property->link['target'], $this->merged_types)) |
91 | 90 | { |
@@ -233,8 +232,7 @@ discard block |
||
233 | 232 | if (array_key_exists($fqcn, $this->types)) |
234 | 233 | { |
235 | 234 | return $this->types[$fqcn]; |
236 | - } |
|
237 | - else if (array_key_exists($classname, $this->merged_types)) |
|
235 | + } else if (array_key_exists($classname, $this->merged_types)) |
|
238 | 236 | { |
239 | 237 | $fqcn = $this->merged_types[$classname]; |
240 | 238 | if (!empty($this->namespace)) |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | if ($name == 'metadata') |
53 | 53 | { |
54 | 54 | $this->has_metadata = ($value === 'true'); |
55 | - } |
|
56 | - else |
|
55 | + } else |
|
57 | 56 | { |
58 | 57 | $this->$name = (string) $value; |
59 | 58 | } |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | if ($property instanceof mixin) |
71 | 70 | { |
72 | 71 | $this->mixins[$name] = $property; |
73 | - } |
|
74 | - else |
|
72 | + } else |
|
75 | 73 | { |
76 | 74 | if ($property->parentfield) |
77 | 75 | { |
@@ -86,8 +84,7 @@ discard block |
||
86 | 84 | { |
87 | 85 | $this->properties[$name] = $property; |
88 | 86 | $this->dbfields[$property->field] = $property->name; |
89 | - } |
|
90 | - else if (!array_key_exists($property->name, $this->properties)) |
|
87 | + } else if (!array_key_exists($property->name, $this->properties)) |
|
91 | 88 | { |
92 | 89 | $this->field_aliases[$property->name] = $this->dbfields[$property->field]; |
93 | 90 | } |