@@ -80,7 +80,7 @@ |
||
| 80 | 80 | $this->classListeners[$eventName][$loweredClass][$format] = $this->initializeListeners($eventName, $loweredClass, $format); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - return !!$this->classListeners[$eventName][$loweredClass][$format]; |
|
| 83 | + return ! ! $this->classListeners[$eventName][$loweredClass][$format]; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | public function dispatch($eventName, $class, $format, Event $event) |
@@ -83,16 +83,16 @@ |
||
| 83 | 83 | $addition = ''; |
| 84 | 84 | |
| 85 | 85 | $lines = explode("\n", $content); |
| 86 | - for ($i=0,$c=count($lines); $i<$c; $i++) { |
|
| 86 | + for ($i = 0, $c = count($lines); $i < $c; $i++) { |
|
| 87 | 87 | if ($this->indentationLevel > 0 |
| 88 | - && !empty($lines[$i]) |
|
| 88 | + && ! empty($lines[$i]) |
|
| 89 | 89 | && ((empty($addition) && "\n" === substr($this->content, -1)) || "\n" === substr($addition, -1))) { |
| 90 | 90 | $addition .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $addition .= $lines[$i]; |
| 94 | 94 | |
| 95 | - if ($i+1 < $c) { |
|
| 95 | + if ($i + 1 < $c) { |
|
| 96 | 96 | $addition .= "\n"; |
| 97 | 97 | } |
| 98 | 98 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $this->document = $this->createDocument(null, null, false); |
| 198 | 198 | if ($metadata->xmlRootName) { |
| 199 | 199 | $rootName = $metadata->xmlRootName; |
| 200 | - $rootNamespace = $metadata->xmlRootNamespace?:$this->getClassDefaultNamespace($metadata); |
|
| 200 | + $rootNamespace = $metadata->xmlRootNamespace ?: $this->getClassDefaultNamespace($metadata); |
|
| 201 | 201 | } else { |
| 202 | 202 | $rootName = $this->defaultRootName; |
| 203 | 203 | $rootNamespace = $this->defaultRootNamespace; |
@@ -444,10 +444,10 @@ discard block |
||
| 444 | 444 | if ($this->currentNode->isDefaultNamespace($namespace)) { |
| 445 | 445 | return $this->document->createElementNS($namespace, $tagName); |
| 446 | 446 | } else { |
| 447 | - if (!$prefix = $this->currentNode->lookupPrefix($namespace)) { |
|
| 448 | - $prefix = 'ns-'. substr(sha1($namespace), 0, 8); |
|
| 447 | + if ( ! $prefix = $this->currentNode->lookupPrefix($namespace)) { |
|
| 448 | + $prefix = 'ns-'.substr(sha1($namespace), 0, 8); |
|
| 449 | 449 | } |
| 450 | - return $this->document->createElementNS($namespace, $prefix . ':' . $tagName); |
|
| 450 | + return $this->document->createElementNS($namespace, $prefix.':'.$tagName); |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | |
@@ -459,8 +459,8 @@ discard block |
||
| 459 | 459 | private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null) |
| 460 | 460 | { |
| 461 | 461 | if (null !== $namespace) { |
| 462 | - if (!$prefix = $node->lookupPrefix($namespace)) { |
|
| 463 | - $prefix = 'ns-'. substr(sha1($namespace), 0, 8); |
|
| 462 | + if ( ! $prefix = $node->lookupPrefix($namespace)) { |
|
| 463 | + $prefix = 'ns-'.substr(sha1($namespace), 0, 8); |
|
| 464 | 464 | } |
| 465 | 465 | $node->setAttributeNS($namespace, $prefix.':'.$name, $value); |
| 466 | 466 | } else { |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | private function getClassDefaultNamespace(ClassMetadata $metadata) |
| 472 | 472 | { |
| 473 | - return (isset($metadata->xmlNamespaces[''])?$metadata->xmlNamespaces['']:null); |
|
| 473 | + return (isset($metadata->xmlNamespaces['']) ? $metadata->xmlNamespaces[''] : null); |
|
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | } |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | $parentStr |
| 156 | 156 | ) = $unserialized; |
| 157 | 157 | |
| 158 | - if (isset($unserialized['xmlEntryNamespace'])){ |
|
| 158 | + if (isset($unserialized['xmlEntryNamespace'])) { |
|
| 159 | 159 | $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace']; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -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,10 +147,10 @@ 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 | - if ( ! isset($data->$entryName) ) { |
|
| 153 | + if ( ! isset($data->$entryName)) { |
|
| 154 | 154 | if (null === $this->result) { |
| 155 | 155 | return $this->result = array(); |
| 156 | 156 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | if ($metadata->xmlCollection) { |
| 244 | 244 | $enclosingElem = $data; |
| 245 | - if (!$metadata->xmlCollectionInline) { |
|
| 245 | + if ( ! $metadata->xmlCollectionInline) { |
|
| 246 | 246 | $enclosingElem = $data->children($metadata->xmlNamespace)->$name; |
| 247 | 247 | } |
| 248 | 248 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | if ($metadata->xmlNamespace) { |
| 258 | 258 | $node = $data->children($metadata->xmlNamespace)->$name; |
| 259 | - if (!$node->count()) { |
|
| 259 | + if ( ! $node->count()) { |
|
| 260 | 260 | return; |
| 261 | 261 | } |
| 262 | 262 | } else { |
@@ -266,13 +266,13 @@ discard block |
||
| 266 | 266 | if (isset($namespaces[''])) { |
| 267 | 267 | $prefix = uniqid('ns-'); |
| 268 | 268 | $data->registerXPathNamespace($prefix, $namespaces['']); |
| 269 | - $nodes = $data->xpath('./'.$prefix. ':'.$name ); |
|
| 269 | + $nodes = $data->xpath('./'.$prefix.':'.$name); |
|
| 270 | 270 | if (empty($nodes)) { |
| 271 | 271 | return; |
| 272 | 272 | } |
| 273 | 273 | $node = reset($nodes); |
| 274 | 274 | } else { |
| 275 | - if (!isset($data->$name)) { |
|
| 275 | + if ( ! isset($data->$name)) { |
|
| 276 | 276 | return; |
| 277 | 277 | } |
| 278 | 278 | $node = $data->$name; |