@@ -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) |
@@ -25,5 +25,7 @@ |
||
| 25 | 25 | const PRE_DESERIALIZE = 'serializer.pre_deserialize'; |
| 26 | 26 | const POST_DESERIALIZE = 'serializer.post_deserialize'; |
| 27 | 27 | |
| 28 | - final private function __construct() { } |
|
| 28 | + final private function __construct() |
|
| 29 | + { |
|
| 30 | +} |
|
| 29 | 31 | } |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | |
| 168 | 168 | //we need read_only before setter and getter set, because that method depends on flag being set |
| 169 | 169 | if (isset($pConfig['read_only'])) { |
| 170 | - $pMetadata->readOnly = (Boolean) $pConfig['read_only']; |
|
| 170 | + $pMetadata->readOnly = (Boolean) $pConfig['read_only']; |
|
| 171 | 171 | } else { |
| 172 | 172 | $pMetadata->readOnly = $pMetadata->readOnly || $readOnlyClass; |
| 173 | 173 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | if (isset($pConfig['expose_if'])) { |
| 104 | - $pMetadata->excludeIf = "!(" . $pConfig['expose_if'].")"; |
|
| 104 | + $pMetadata->excludeIf = "!(".$pConfig['expose_if'].")"; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if (isset($pConfig['serialized_name'])) { |
@@ -121,15 +121,15 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $colConfig = $pConfig['xml_list']; |
| 123 | 123 | if (isset($colConfig['inline'])) { |
| 124 | - $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline']; |
|
| 124 | + $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline']; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (isset($colConfig['entry_name'])) { |
| 128 | - $pMetadata->xmlEntryName = (string)$colConfig['entry_name']; |
|
| 128 | + $pMetadata->xmlEntryName = (string) $colConfig['entry_name']; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (isset($colConfig['skip_when_empty'])) { |
| 132 | - $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty']; |
|
| 132 | + $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty']; |
|
| 133 | 133 | } else { |
| 134 | 134 | $pMetadata->xmlCollectionSkipWhenEmpty = true; |
| 135 | 135 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |(.) |
| 50 | 50 | /x', |
| 51 | 51 | array(self::T_NAME => 'T_NAME', self::T_STRING => 'T_STRING', self::T_OPEN_BRACKET => 'T_OPEN_BRACKET', |
| 52 | - self::T_CLOSE_BRACKET => 'T_CLOSE_BRACKET', self::T_COMMA => 'T_COMMA', self::T_NONE => 'T_NONE'), |
|
| 52 | + self::T_CLOSE_BRACKET => 'T_CLOSE_BRACKET', self::T_COMMA => 'T_COMMA', self::T_NONE => 'T_NONE'), |
|
| 53 | 53 | function($value) { |
| 54 | 54 | switch ($value[0]) { |
| 55 | 55 | case '"': |
@@ -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 | } |
@@ -168,8 +168,8 @@ |
||
| 168 | 168 | |
| 169 | 169 | if ( ! $metadata->inline) { |
| 170 | 170 | $this->writer |
| 171 | - ->writeln(Inline::dump($name).':') |
|
| 172 | - ->indent(); |
|
| 171 | + ->writeln(Inline::dump($name).':') |
|
| 172 | + ->indent(); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | $this->setCurrentMetadata($metadata); |
@@ -226,7 +226,7 @@ |
||
| 226 | 226 | throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name)); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - if ($metadata->xmlAttribute) { |
|
| 229 | + if ($metadata->xmlAttribute) { |
|
| 230 | 230 | |
| 231 | 231 | $attributes = $data->attributes($metadata->xmlNamespace); |
| 232 | 232 | if (isset($attributes[$name])) { |
@@ -346,7 +346,6 @@ |
||
| 346 | 346 | /** |
| 347 | 347 | * Retrieves internalSubset even in bugfixed php versions |
| 348 | 348 | * |
| 349 | - * @param \DOMDocumentType $child |
|
| 350 | 349 | * @param string $data |
| 351 | 350 | * @return string |
| 352 | 351 | */ |
@@ -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; |
@@ -72,8 +72,7 @@ discard block |
||
| 72 | 72 | \DateTimeInterface $date, |
| 73 | 73 | array $type, |
| 74 | 74 | Context $context |
| 75 | - ) |
|
| 76 | - { |
|
| 75 | + ) { |
|
| 77 | 76 | if ($visitor instanceof XmlSerializationVisitor && false === $this->xmlCData) { |
| 78 | 77 | return $visitor->visitSimpleString($date->format($this->getFormat($type)), $type, $context); |
| 79 | 78 | } |
@@ -96,8 +95,7 @@ discard block |
||
| 96 | 95 | \DateTimeImmutable $date, |
| 97 | 96 | array $type, |
| 98 | 97 | Context $context |
| 99 | - ) |
|
| 100 | - { |
|
| 98 | + ) { |
|
| 101 | 99 | return $this->serializeDateTimeInterface($visitor, $date, $type, $context); |
| 102 | 100 | } |
| 103 | 101 | |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | |
| 19 | 19 | namespace JMS\Serializer; |
| 20 | 20 | |
| 21 | -use JMS\Serializer\Exception\LogicException; |
|
| 22 | 21 | use JMS\Serializer\Exception\RuntimeException; |
| 23 | 22 | use Metadata\MetadataFactoryInterface; |
| 24 | 23 | |