@@ -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) |
@@ -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 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | if (array_key_exists('virtual_properties', $config)) { |
| 54 | 54 | foreach ($config['virtual_properties'] as $methodName => $propertySettings) { |
| 55 | 55 | if (isset($propertySettings['exp'])) { |
| 56 | - $virtualPropertyMetadata = new ExpressionPropertyMetadata( $name, $methodName, $propertySettings['exp']); |
|
| 56 | + $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $methodName, $propertySettings['exp']); |
|
| 57 | 57 | unset($propertySettings['exp']); |
| 58 | 58 | |
| 59 | 59 | } else { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if (isset($pConfig['expose_if'])) { |
| 110 | - $pMetadata->excludeIf = "!(" . $pConfig['expose_if'].")"; |
|
| 110 | + $pMetadata->excludeIf = "!(".$pConfig['expose_if'].")"; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | if (isset($pConfig['serialized_name'])) { |
@@ -127,15 +127,15 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $colConfig = $pConfig['xml_list']; |
| 129 | 129 | if (isset($colConfig['inline'])) { |
| 130 | - $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline']; |
|
| 130 | + $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline']; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (isset($colConfig['entry_name'])) { |
| 134 | - $pMetadata->xmlEntryName = (string)$colConfig['entry_name']; |
|
| 134 | + $pMetadata->xmlEntryName = (string) $colConfig['entry_name']; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (isset($colConfig['skip_when_empty'])) { |
| 138 | - $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty']; |
|
| 138 | + $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty']; |
|
| 139 | 139 | } else { |
| 140 | 140 | $pMetadata->xmlCollectionSkipWhenEmpty = true; |
| 141 | 141 | } |
@@ -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); |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | continue; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if ($isList && !$isHash) { |
|
| 94 | + if ($isList && ! $isHash) { |
|
| 95 | 95 | $this->writer->writeln('-'); |
| 96 | 96 | } else { |
| 97 | 97 | $this->writer->writeln(Inline::dump($k).':'); |
@@ -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])) { |
@@ -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; |
@@ -256,7 +256,7 @@ |
||
| 256 | 256 | */ |
| 257 | 257 | public function getCurrentPath() |
| 258 | 258 | { |
| 259 | - if (!$this->metadataStack) { |
|
| 259 | + if ( ! $this->metadataStack) { |
|
| 260 | 260 | return array(); |
| 261 | 261 | } |
| 262 | 262 | |
@@ -169,13 +169,13 @@ |
||
| 169 | 169 | $parentStr |
| 170 | 170 | ) = $unserialized; |
| 171 | 171 | |
| 172 | - if (isset($unserialized['xmlEntryNamespace'])){ |
|
| 172 | + if (isset($unserialized['xmlEntryNamespace'])) { |
|
| 173 | 173 | $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace']; |
| 174 | 174 | } |
| 175 | - if (isset($unserialized['xmlCollectionSkipWhenEmpty'])){ |
|
| 175 | + if (isset($unserialized['xmlCollectionSkipWhenEmpty'])) { |
|
| 176 | 176 | $this->xmlCollectionSkipWhenEmpty = $unserialized['xmlCollectionSkipWhenEmpty']; |
| 177 | 177 | } |
| 178 | - if (isset($unserialized['excludeIf'])){ |
|
| 178 | + if (isset($unserialized['excludeIf'])) { |
|
| 179 | 179 | $this->excludeIf = $unserialized['excludeIf']; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | $this->name |
| 101 | 101 | ) = $unserialized; |
| 102 | 102 | |
| 103 | - if (isset($unserialized['excludeIf'])){ |
|
| 103 | + if (isset($unserialized['excludeIf'])) { |
|
| 104 | 104 | $this->excludeIf = $unserialized['excludeIf']; |
| 105 | 105 | } |
| 106 | 106 | } |