@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function startVisiting($object): void |
| 54 | 54 | { |
| 55 | - if (!\is_object($object)) { |
|
| 55 | + if ( ! \is_object($object)) { |
|
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | $this->visitingSet->attach($object); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function stopVisiting($object): void |
| 63 | 63 | { |
| 64 | - if (!\is_object($object)) { |
|
| 64 | + if ( ! \is_object($object)) { |
|
| 65 | 65 | return; |
| 66 | 66 | } |
| 67 | 67 | $this->visitingSet->detach($object); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | public function isVisiting($object): bool |
| 76 | 76 | { |
| 77 | - if (!\is_object($object)) { |
|
| 77 | + if ( ! \is_object($object)) { |
|
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $path[] = \get_class($obj); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - if (!$path) { |
|
| 91 | + if ( ! $path) { |
|
| 92 | 92 | return null; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | public function getObject() |
| 109 | 109 | { |
| 110 | - return !$this->visitingStack->isEmpty() ? $this->visitingStack->top() : null; |
|
| 110 | + return ! $this->visitingStack->isEmpty() ? $this->visitingStack->top() : null; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | public function getVisitingStack() |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function createRoot(ClassMetadata $metadata = null, $rootName = null, $rootNamespace = null) |
| 90 | 90 | { |
| 91 | - if ($metadata !== null && !empty($metadata->xmlRootName)) { |
|
| 91 | + if ($metadata !== null && ! empty($metadata->xmlRootName)) { |
|
| 92 | 92 | $rootName = $metadata->xmlRootName; |
| 93 | 93 | $rootNamespace = $metadata->xmlRootNamespace ?: $this->getClassDefaultNamespace($metadata); |
| 94 | 94 | } else { |
@@ -121,12 +121,12 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $doCData = null !== $this->currentMetadata ? $this->currentMetadata->xmlElementCData : true; |
| 123 | 123 | |
| 124 | - return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string)$data); |
|
| 124 | + return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | public function visitSimpleString($data, array $type) |
| 128 | 128 | { |
| 129 | - return $this->document->createTextNode((string)$data); |
|
| 129 | + return $this->document->createTextNode((string) $data); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | public function visitBoolean(bool $data, array $type) |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | public function visitInteger(int $data, array $type) |
| 138 | 138 | { |
| 139 | - return $this->document->createTextNode((string)$data); |
|
| 139 | + return $this->document->createTextNode((string) $data); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | public function visitDouble(float $data, array $type) |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if (floor($data) === $data) { |
| 145 | 145 | return $this->document->createTextNode($data.".0"); |
| 146 | 146 | } else { |
| 147 | - return $this->document->createTextNode((string)$data); |
|
| 147 | + return $this->document->createTextNode((string) $data); |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $this->setCurrentNode($entryNode); |
| 173 | 173 | |
| 174 | 174 | if (null !== $keyAttributeName) { |
| 175 | - $entryNode->setAttribute($keyAttributeName, (string)$k); |
|
| 175 | + $entryNode->setAttribute($keyAttributeName, (string) $k); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | try { |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $node = $this->navigator->accept($v, $metadata->type, $this->context); |
| 214 | 214 | $this->revertCurrentMetadata(); |
| 215 | 215 | |
| 216 | - if (!$node instanceof \DOMCharacterData) { |
|
| 216 | + if ( ! $node instanceof \DOMCharacterData) { |
|
| 217 | 217 | throw new RuntimeException(sprintf('Unsupported value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encode($v))); |
| 218 | 218 | } |
| 219 | 219 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | if (($metadata->xmlValue && $this->currentNode->childNodes->length > 0) |
| 226 | - || (!$metadata->xmlValue && $this->hasValue) |
|
| 226 | + || ( ! $metadata->xmlValue && $this->hasValue) |
|
| 227 | 227 | ) { |
| 228 | 228 | throw new RuntimeException(sprintf('If you make use of @XmlValue, all other properties in the class must have the @XmlAttribute annotation. Invalid usage detected in class %s.', $metadata->class)); |
| 229 | 229 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $node = $this->navigator->accept($v, $metadata->type, $this->context); |
| 236 | 236 | $this->revertCurrentMetadata(); |
| 237 | 237 | |
| 238 | - if (!$node instanceof \DOMCharacterData) { |
|
| 238 | + if ( ! $node instanceof \DOMCharacterData) { |
|
| 239 | 239 | throw new RuntimeException(sprintf('Unsupported value for property %s::$%s. Expected character data, but got %s.', $metadata->reflection->class, $metadata->reflection->name, \is_object($node) ? \get_class($node) : \gettype($node))); |
| 240 | 240 | } |
| 241 | 241 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | if ($metadata->xmlAttributeMap) { |
| 248 | - if (!\is_array($v)) { |
|
| 248 | + if ( ! \is_array($v)) { |
|
| 249 | 249 | throw new RuntimeException(sprintf('Unsupported value type for XML attribute map. Expected array but got %s.', \gettype($v))); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $node = $this->navigator->accept($value, null, $this->context); |
| 255 | 255 | $this->revertCurrentMetadata(); |
| 256 | 256 | |
| 257 | - if (!$node instanceof \DOMCharacterData) { |
|
| 257 | + if ( ! $node instanceof \DOMCharacterData) { |
|
| 258 | 258 | throw new RuntimeException(sprintf('Unsupported value for a XML attribute map value. Expected character data, but got %s.', json_encode($v))); |
| 259 | 259 | } |
| 260 | 260 | |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | return; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - if ($addEnclosingElement = !$this->isInLineCollection($metadata) && !$metadata->inline) { |
|
| 267 | + if ($addEnclosingElement = ! $this->isInLineCollection($metadata) && ! $metadata->inline) { |
|
| 268 | 268 | |
| 269 | 269 | $namespace = null !== $metadata->xmlNamespace |
| 270 | 270 | ? $metadata->xmlNamespace |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | private function isSkippableEmptyObject($node, PropertyMetadata $metadata) |
| 316 | 316 | { |
| 317 | - return $node === null && !$metadata->xmlCollection && $metadata->skipWhenEmpty; |
|
| 317 | + return $node === null && ! $metadata->xmlCollection && $metadata->skipWhenEmpty; |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | private function isSkippableCollection(PropertyMetadata $metadata) |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | |
| 325 | 325 | private function isElementEmpty(\DOMElement $element) |
| 326 | 326 | { |
| 327 | - return !$element->hasChildNodes() && !$element->hasAttributes(); |
|
| 327 | + return ! $element->hasChildNodes() && ! $element->hasAttributes(); |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | public function endVisitingObject(ClassMetadata $metadata, object $data, array $type) |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | foreach ($metadata->xmlNamespaces as $prefix => $uri) { |
| 432 | 432 | $attribute = 'xmlns'; |
| 433 | 433 | if ($prefix !== '') { |
| 434 | - $attribute .= ':' . $prefix; |
|
| 434 | + $attribute .= ':'.$prefix; |
|
| 435 | 435 | } elseif ($element->namespaceURI === $uri) { |
| 436 | 436 | continue; |
| 437 | 437 | } |
@@ -447,19 +447,19 @@ discard block |
||
| 447 | 447 | if ($this->currentNode->isDefaultNamespace($namespace)) { |
| 448 | 448 | return $this->document->createElementNS($namespace, $tagName); |
| 449 | 449 | } |
| 450 | - if (!($prefix = $this->currentNode->lookupPrefix($namespace)) && !($prefix = $this->document->lookupPrefix($namespace))) { |
|
| 451 | - $prefix = 'ns-' . substr(sha1($namespace), 0, 8); |
|
| 450 | + if ( ! ($prefix = $this->currentNode->lookupPrefix($namespace)) && ! ($prefix = $this->document->lookupPrefix($namespace))) { |
|
| 451 | + $prefix = 'ns-'.substr(sha1($namespace), 0, 8); |
|
| 452 | 452 | } |
| 453 | - return $this->document->createElementNS($namespace, $prefix . ':' . $tagName); |
|
| 453 | + return $this->document->createElementNS($namespace, $prefix.':'.$tagName); |
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null) |
| 457 | 457 | { |
| 458 | 458 | if (null !== $namespace) { |
| 459 | - if (!$prefix = $node->lookupPrefix($namespace)) { |
|
| 460 | - $prefix = 'ns-' . substr(sha1($namespace), 0, 8); |
|
| 459 | + if ( ! $prefix = $node->lookupPrefix($namespace)) { |
|
| 460 | + $prefix = 'ns-'.substr(sha1($namespace), 0, 8); |
|
| 461 | 461 | } |
| 462 | - $node->setAttributeNS($namespace, $prefix . ':' . $name, $value); |
|
| 462 | + $node->setAttributeNS($namespace, $prefix.':'.$name, $value); |
|
| 463 | 463 | } else { |
| 464 | 464 | $node->setAttribute($name, $value); |
| 465 | 465 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $context = $this->serializationContextFactory->createSerializationContext(); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - if (!isset($this->serializationVisitors[$format])) { |
|
| 153 | + if ( ! isset($this->serializationVisitors[$format])) { |
|
| 154 | 154 | throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for serialization.', $format)); |
| 155 | 155 | } |
| 156 | 156 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $context = $this->deserializationContextFactory->createDeserializationContext(); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - if (!isset($this->deserializationVisitors[$format])) { |
|
| 172 | + if ( ! isset($this->deserializationVisitors[$format])) { |
|
| 173 | 173 | throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for deserialization.', $format)); |
| 174 | 174 | } |
| 175 | 175 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $context = $this->serializationContextFactory->createSerializationContext(); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - if (!isset($this->serializationVisitors['json'])) { |
|
| 192 | + if ( ! isset($this->serializationVisitors['json'])) { |
|
| 193 | 193 | throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for fromArray.', 'json')); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $result = $this->visit($this->serializationNavigator, $visitor, $context, $preparedData, 'json', $type); |
| 202 | 202 | $result = $this->convertArrayObjects($result); |
| 203 | 203 | |
| 204 | - if (!\is_array($result)) { |
|
| 204 | + if ( ! \is_array($result)) { |
|
| 205 | 205 | throw new RuntimeException(sprintf( |
| 206 | 206 | 'The input data of type "%s" did not convert to an array, but got a result of type "%s".', |
| 207 | 207 | \is_object($data) ? \get_class($data) : \gettype($data), |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $context = $this->deserializationContextFactory->createDeserializationContext(); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | - if (!isset($this->deserializationVisitors['json'])) { |
|
| 224 | + if ( ! isset($this->deserializationVisitors['json'])) { |
|
| 225 | 225 | throw new UnsupportedFormatException(sprintf('The format "%s" is not supported for fromArray.', 'json')); |
| 226 | 226 | } |
| 227 | 227 | $visitor = $this->deserializationVisitors['json']->getVisitor($this->deserializationNavigator, $this->accessorStrategy, $context); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | private function convertArrayObjects($data) |
| 245 | 245 | { |
| 246 | 246 | if ($data instanceof \ArrayObject || $data instanceof \stdClass) { |
| 247 | - $data = (array)$data; |
|
| 247 | + $data = (array) $data; |
|
| 248 | 248 | } |
| 249 | 249 | if (\is_array($data)) { |
| 250 | 250 | foreach ($data as $k => $v) { |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function translateName(PropertyMetadata $property):string |
| 43 | 43 | { |
| 44 | - $name = preg_replace('/[A-Z]+/', $this->separator . '\\0', $property->name); |
|
| 44 | + $name = preg_replace('/[A-Z]+/', $this->separator.'\\0', $property->name); |
|
| 45 | 45 | |
| 46 | 46 | if ($this->lowerCase) { |
| 47 | 47 | return strtolower($name); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $classMetadata = $context->getMetadataFactory()->getMetadataForClass('stdClass'); |
| 51 | 51 | $visitor->startVisitingObject($classMetadata, $stdClass, array('name' => 'stdClass'), $context); |
| 52 | 52 | |
| 53 | - foreach ((array)$stdClass as $name => $value) { |
|
| 53 | + foreach ((array) $stdClass as $name => $value) { |
|
| 54 | 54 | $metadata = new StaticPropertyMetadata('stdClass', $name, $value); |
| 55 | 55 | $visitor->visitProperty($metadata, $value); |
| 56 | 56 | } |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | switch ($direction) { |
| 37 | 37 | case GraphNavigatorInterface::DIRECTION_DESERIALIZATION: |
| 38 | - return 'deserialize' . $type . 'From' . $format; |
|
| 38 | + return 'deserialize'.$type.'From'.$format; |
|
| 39 | 39 | |
| 40 | 40 | case GraphNavigatorInterface::DIRECTION_SERIALIZATION: |
| 41 | - return 'serialize' . $type . 'To' . $format; |
|
| 41 | + return 'serialize'.$type.'To'.$format; |
|
| 42 | 42 | |
| 43 | 43 | default: |
| 44 | 44 | throw new LogicException(sprintf('The direction %s does not exist; see GraphNavigatorInterface::DIRECTION_??? constants.', json_encode($direction))); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public function registerSubscribingHandler(SubscribingHandlerInterface $handler):void |
| 54 | 54 | { |
| 55 | 55 | foreach ($handler->getSubscribingMethods() as $methodData) { |
| 56 | - if (!isset($methodData['type'], $methodData['format'])) { |
|
| 56 | + if ( ! isset($methodData['type'], $methodData['format'])) { |
|
| 57 | 57 | throw new RuntimeException(sprintf('For each subscribing method a "type" and "format" attribute must be given, but only got "%s" for %s.', implode('" and "', array_keys($methodData)), \get_class($handler))); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | public function getHandler(int $direction, string $typeName, string $format) |
| 82 | 82 | { |
| 83 | - if (!isset($this->handlers[$direction][$typeName][$format])) { |
|
| 83 | + if ( ! isset($this->handlers[$direction][$typeName][$format])) { |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -50,32 +50,32 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function visitString($data, array $type): string |
| 52 | 52 | { |
| 53 | - return (string)$data; |
|
| 53 | + return (string) $data; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function visitBoolean($data, array $type): bool |
| 57 | 57 | { |
| 58 | - return (bool)$data; |
|
| 58 | + return (bool) $data; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function visitInteger($data, array $type): int |
| 62 | 62 | { |
| 63 | - return (int)$data; |
|
| 63 | + return (int) $data; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | public function visitDouble($data, array $type): float |
| 67 | 67 | { |
| 68 | - return (double)$data; |
|
| 68 | + return (double) $data; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | public function visitArray($data, array $type): array |
| 72 | 72 | { |
| 73 | - if (!\is_array($data)) { |
|
| 73 | + if ( ! \is_array($data)) { |
|
| 74 | 74 | throw new RuntimeException(sprintf('Expected array, but got %s: %s', \gettype($data), json_encode($data))); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // If no further parameters were given, keys/values are just passed as is. |
| 78 | - if (!$type['params']) { |
|
| 78 | + if ( ! $type['params']) { |
|
| 79 | 79 | return $data; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -120,15 +120,15 @@ discard block |
||
| 120 | 120 | return; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (!\is_array($data)) { |
|
| 123 | + if ( ! \is_array($data)) { |
|
| 124 | 124 | throw new RuntimeException(sprintf('Invalid data "%s"(%s), expected "%s".', $data, $metadata->type['name'], $metadata->reflection->class)); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if (!array_key_exists($name, $data)) { |
|
| 127 | + if ( ! array_key_exists($name, $data)) { |
|
| 128 | 128 | return; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if (!$metadata->type) { |
|
| 131 | + if ( ! $metadata->type) { |
|
| 132 | 132 | throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name)); |
| 133 | 133 | } |
| 134 | 134 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $rs = isset($type['params'][1]) ? new \ArrayObject() : array(); |
| 87 | 87 | |
| 88 | - $isList = isset($type['params'][0]) && !isset($type['params'][1]); |
|
| 88 | + $isList = isset($type['params'][0]) && ! isset($type['params'][1]); |
|
| 89 | 89 | |
| 90 | 90 | $elType = $this->getElementType($type); |
| 91 | 91 | foreach ($data as $k => $v) { |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | if ($metadata->inline) { |
| 152 | 152 | if (\is_array($v) || ($v instanceof \ArrayObject)) { |
| 153 | - $this->data = array_merge($this->data, (array)$v); |
|
| 153 | + $this->data = array_merge($this->data, (array) $v); |
|
| 154 | 154 | } |
| 155 | 155 | } else { |
| 156 | 156 | $this->data[$metadata->serializedName] = $v; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | private function getAccessorStrategy() |
| 117 | 117 | { |
| 118 | - if (!$this->accessorStrategy) { |
|
| 118 | + if ( ! $this->accessorStrategy) { |
|
| 119 | 119 | $this->accessorStrategy = new DefaultAccessorStrategy(); |
| 120 | 120 | |
| 121 | 121 | if ($this->expressionEvaluator) { |
@@ -148,17 +148,17 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | public function setDebug($bool) |
| 150 | 150 | { |
| 151 | - $this->debug = (boolean)$bool; |
|
| 151 | + $this->debug = (boolean) $bool; |
|
| 152 | 152 | |
| 153 | 153 | return $this; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | public function setCacheDir($dir) |
| 157 | 157 | { |
| 158 | - if (!is_dir($dir)) { |
|
| 158 | + if ( ! is_dir($dir)) { |
|
| 159 | 159 | $this->createDir($dir); |
| 160 | 160 | } |
| 161 | - if (!is_writable($dir)) { |
|
| 161 | + if ( ! is_writable($dir)) { |
|
| 162 | 162 | throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir)); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | public function includeInterfaceMetadata($include) |
| 262 | 262 | { |
| 263 | - $this->includeInterfaceMetadata = (Boolean)$include; |
|
| 263 | + $this->includeInterfaceMetadata = (Boolean) $include; |
|
| 264 | 264 | |
| 265 | 265 | return $this; |
| 266 | 266 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | public function setMetadataDirs(array $namespacePrefixToDirMap) |
| 280 | 280 | { |
| 281 | 281 | foreach ($namespacePrefixToDirMap as $dir) { |
| 282 | - if (!is_dir($dir)) { |
|
| 282 | + if ( ! is_dir($dir)) { |
|
| 283 | 283 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | public function addMetadataDir($dir, $namespacePrefix = '') |
| 319 | 319 | { |
| 320 | - if (!is_dir($dir)) { |
|
| 320 | + if ( ! is_dir($dir)) { |
|
| 321 | 321 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
| 322 | 322 | } |
| 323 | 323 | |
@@ -359,11 +359,11 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | public function replaceMetadataDir($dir, $namespacePrefix = '') |
| 361 | 361 | { |
| 362 | - if (!is_dir($dir)) { |
|
| 362 | + if ( ! is_dir($dir)) { |
|
| 363 | 363 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | - if (!isset($this->metadataDirs[$namespacePrefix])) { |
|
| 366 | + if ( ! isset($this->metadataDirs[$namespacePrefix])) { |
|
| 367 | 367 | throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix)); |
| 368 | 368 | } |
| 369 | 369 | |
@@ -426,8 +426,8 @@ discard block |
||
| 426 | 426 | $annotationReader = new AnnotationReader(); |
| 427 | 427 | |
| 428 | 428 | if (null !== $this->cacheDir) { |
| 429 | - $this->createDir($this->cacheDir . '/annotations'); |
|
| 430 | - $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations'); |
|
| 429 | + $this->createDir($this->cacheDir.'/annotations'); |
|
| 430 | + $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations'); |
|
| 431 | 431 | $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug); |
| 432 | 432 | } |
| 433 | 433 | } |
@@ -443,19 +443,19 @@ discard block |
||
| 443 | 443 | $metadataFactory->setIncludeInterfaces($this->includeInterfaceMetadata); |
| 444 | 444 | |
| 445 | 445 | if (null !== $this->cacheDir) { |
| 446 | - $this->createDir($this->cacheDir . '/metadata'); |
|
| 447 | - $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata')); |
|
| 446 | + $this->createDir($this->cacheDir.'/metadata'); |
|
| 447 | + $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata')); |
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | - if (!$this->handlersConfigured) { |
|
| 450 | + if ( ! $this->handlersConfigured) { |
|
| 451 | 451 | $this->addDefaultHandlers(); |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - if (!$this->listenersConfigured) { |
|
| 454 | + if ( ! $this->listenersConfigured) { |
|
| 455 | 455 | $this->addDefaultListeners(); |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - if (!$this->visitorsAdded) { |
|
| 458 | + if ( ! $this->visitorsAdded) { |
|
| 459 | 459 | $this->addDefaultSerializationVisitors(); |
| 460 | 460 | $this->addDefaultDeserializationVisitors(); |
| 461 | 461 | } |