@@ -38,7 +38,7 @@ |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | foreach ($data as $key => $value) { |
41 | - if (!property_exists(__CLASS__, $key)) { |
|
41 | + if ( ! property_exists(__CLASS__, $key)) { |
|
42 | 42 | throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__)); |
43 | 43 | } |
44 | 44 | $this->{$key} = $value; |
@@ -76,7 +76,7 @@ |
||
76 | 76 | |
77 | 77 | $groups = $this->groups; |
78 | 78 | foreach ($paths as $index => $path) { |
79 | - if (!array_key_exists($path, $groups)) { |
|
79 | + if ( ! array_key_exists($path, $groups)) { |
|
80 | 80 | if ($index > 0) { |
81 | 81 | $groups = array(self::DEFAULT_GROUP); |
82 | 82 | } |
@@ -83,8 +83,7 @@ |
||
83 | 83 | EventDispatcherInterface $dispatcher = null, |
84 | 84 | TypeParser $typeParser = null, |
85 | 85 | ExpressionEvaluatorInterface $expressionEvaluator = null |
86 | - ) |
|
87 | - { |
|
86 | + ) { |
|
88 | 87 | $this->factory = $factory; |
89 | 88 | $this->handlerRegistry = $handlerRegistry; |
90 | 89 | $this->objectConstructor = $objectConstructor; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $this->document = $this->createDocument(null, null, false); |
207 | 207 | if ($metadata->xmlRootName) { |
208 | 208 | $rootName = $metadata->xmlRootName; |
209 | - $rootNamespace = $metadata->xmlRootNamespace?:$this->getClassDefaultNamespace($metadata); |
|
209 | + $rootNamespace = $metadata->xmlRootNamespace ?: $this->getClassDefaultNamespace($metadata); |
|
210 | 210 | } else { |
211 | 211 | $rootName = $this->defaultRootName; |
212 | 212 | $rootNamespace = $this->defaultRootNamespace; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | return; |
290 | 290 | } |
291 | 291 | |
292 | - if ($addEnclosingElement = !$this->isInLineCollection($metadata) && ! $metadata->inline) { |
|
292 | + if ($addEnclosingElement = ! $this->isInLineCollection($metadata) && ! $metadata->inline) { |
|
293 | 293 | $elementName = $this->namingStrategy->translateName($metadata); |
294 | 294 | |
295 | 295 | $namespace = null !== $metadata->xmlNamespace |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | private function isElementEmpty(\DOMElement $element) |
334 | 334 | { |
335 | - return !$element->hasChildNodes() && !$element->hasAttributes(); |
|
335 | + return ! $element->hasChildNodes() && ! $element->hasAttributes(); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context) |
@@ -470,17 +470,17 @@ discard block |
||
470 | 470 | if ($this->currentNode->isDefaultNamespace($namespace)) { |
471 | 471 | return $this->document->createElementNS($namespace, $tagName); |
472 | 472 | } |
473 | - if (!($prefix = $this->currentNode->lookupPrefix($namespace)) && !($prefix = $this->document->lookupPrefix($namespace))) { |
|
474 | - $prefix = 'ns-'. substr(sha1($namespace), 0, 8); |
|
473 | + if ( ! ($prefix = $this->currentNode->lookupPrefix($namespace)) && ! ($prefix = $this->document->lookupPrefix($namespace))) { |
|
474 | + $prefix = 'ns-'.substr(sha1($namespace), 0, 8); |
|
475 | 475 | } |
476 | - return $this->document->createElementNS($namespace, $prefix . ':' . $tagName); |
|
476 | + return $this->document->createElementNS($namespace, $prefix.':'.$tagName); |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null) |
480 | 480 | { |
481 | 481 | if (null !== $namespace) { |
482 | - if (!$prefix = $node->lookupPrefix($namespace)) { |
|
483 | - $prefix = 'ns-'. substr(sha1($namespace), 0, 8); |
|
482 | + if ( ! $prefix = $node->lookupPrefix($namespace)) { |
|
483 | + $prefix = 'ns-'.substr(sha1($namespace), 0, 8); |
|
484 | 484 | } |
485 | 485 | $node->setAttributeNS($namespace, $prefix.':'.$name, $value); |
486 | 486 | } else { |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | |
491 | 491 | private function getClassDefaultNamespace(ClassMetadata $metadata) |
492 | 492 | { |
493 | - return (isset($metadata->xmlNamespaces[''])?$metadata->xmlNamespaces['']:null); |
|
493 | + return (isset($metadata->xmlNamespaces['']) ? $metadata->xmlNamespaces[''] : null); |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | /** |
@@ -132,6 +132,9 @@ discard block |
||
132 | 132 | return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data); |
133 | 133 | } |
134 | 134 | |
135 | + /** |
|
136 | + * @param string $data |
|
137 | + */ |
|
135 | 138 | public function visitSimpleString($data, array $type, Context $context) |
136 | 139 | { |
137 | 140 | if (null === $this->document) { |
@@ -478,6 +481,9 @@ discard block |
||
478 | 481 | return $this->document->createElementNS($namespace, $prefix . ':' . $tagName); |
479 | 482 | } |
480 | 483 | |
484 | + /** |
|
485 | + * @param string $value |
|
486 | + */ |
|
481 | 487 | private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null) |
482 | 488 | { |
483 | 489 | if (null !== $namespace) { |