@@ -205,7 +205,7 @@ |
||
205 | 205 | /** @var $metadata ClassMetadata */ |
206 | 206 | $metadata = $this->metadataFactory->getMetadataForClass($type['name']); |
207 | 207 | |
208 | - if ($metadata->usingExpression && !$this->expressionExclusionStrategy) { |
|
208 | + if ($metadata->usingExpression && ! $this->expressionExclusionStrategy) { |
|
209 | 209 | throw new ExpressionLanguageRequiredException("To use conditional exclude/expose in {$metadata->name} you must configure the expression language."); |
210 | 210 | } |
211 | 211 |
@@ -64,13 +64,13 @@ |
||
64 | 64 | */ |
65 | 65 | public function evaluate($expression, array $data = array()) |
66 | 66 | { |
67 | - if (!is_string($expression)) { |
|
67 | + if ( ! is_string($expression)) { |
|
68 | 68 | return $expression; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $context = $data + $this->context; |
72 | 72 | |
73 | - if (!array_key_exists($expression, $this->cache)) { |
|
73 | + if ( ! array_key_exists($expression, $this->cache)) { |
|
74 | 74 | $this->cache[$expression] = $this->expressionLanguage->parse($expression, array_keys($context)); |
75 | 75 | } |
76 | 76 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | if (false !== stripos($data, '<!doctype')) { |
65 | 65 | $internalSubset = $this->getDomDocumentTypeEntitySubset($data); |
66 | - if (!in_array($internalSubset, $this->doctypeWhitelist, true)) { |
|
66 | + if ( ! in_array($internalSubset, $this->doctypeWhitelist, true)) { |
|
67 | 67 | throw new InvalidArgumentException(sprintf( |
68 | 68 | 'The document type "%s" is not allowed. If it is safe, you may add it to the whitelist configuration.', |
69 | 69 | $internalSubset |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | if ($namespace === null && $this->objectMetadataStack->count()) { |
149 | 149 | $classMetadata = $this->objectMetadataStack->top(); |
150 | - $namespace = isset($classMetadata->xmlNamespaces[''])?$classMetadata->xmlNamespaces['']:$namespace; |
|
150 | + $namespace = isset($classMetadata->xmlNamespaces['']) ? $classMetadata->xmlNamespaces[''] : $namespace; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | if (null !== $namespace) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $nodes = $data->xpath($entryName); |
159 | 159 | } |
160 | 160 | |
161 | - if (!count($nodes)) { |
|
161 | + if ( ! count($nodes)) { |
|
162 | 162 | if (null === $this->result) { |
163 | 163 | return $this->result = array(); |
164 | 164 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | if ($metadata->xmlCollection) { |
251 | 251 | $enclosingElem = $data; |
252 | - if (!$metadata->xmlCollectionInline) { |
|
252 | + if ( ! $metadata->xmlCollectionInline) { |
|
253 | 253 | $enclosingElem = $data->children($metadata->xmlNamespace)->$name; |
254 | 254 | } |
255 | 255 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | |
264 | 264 | if ($metadata->xmlNamespace) { |
265 | 265 | $node = $data->children($metadata->xmlNamespace)->$name; |
266 | - if (!$node->count()) { |
|
266 | + if ( ! $node->count()) { |
|
267 | 267 | return; |
268 | 268 | } |
269 | 269 | } else { |
@@ -273,9 +273,9 @@ discard block |
||
273 | 273 | if (isset($namespaces[''])) { |
274 | 274 | $prefix = uniqid('ns-'); |
275 | 275 | $data->registerXPathNamespace($prefix, $namespaces['']); |
276 | - $nodes = $data->xpath('./'.$prefix. ':'.$name ); |
|
276 | + $nodes = $data->xpath('./'.$prefix.':'.$name); |
|
277 | 277 | } else { |
278 | - $nodes = $data->xpath('./'. $name ); |
|
278 | + $nodes = $data->xpath('./'.$name); |
|
279 | 279 | } |
280 | 280 | if (empty($nodes)) { |
281 | 281 | return; |
@@ -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 | } |
@@ -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 | /** |