@@ -56,7 +56,7 @@ |
||
56 | 56 | ? null |
57 | 57 | : $context->attributes->get('validation_groups')->get(); |
58 | 58 | |
59 | - if (!$groups) { |
|
59 | + if ( ! $groups) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 |
@@ -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 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | foreach ($data as $key => $value) { |
41 | - if (!property_exists(__CLASS__, $key)) { |
|
41 | + if ( ! property_exists(__CLASS__, $key)) { |
|
42 | 42 | throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__)); |
43 | 43 | } |
44 | 44 | $this->{$key} = $value; |
@@ -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, $context); |
56 | 56 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | public function __construct(array $values) |
32 | 32 | { |
33 | - if (!isset($values['value']) || !is_string($values['value'])) { |
|
33 | + if ( ! isset($values['value']) || ! is_string($values['value'])) { |
|
34 | 34 | throw new RuntimeException(sprintf('"value" must be a string.')); |
35 | 35 | } |
36 | 36 |
@@ -24,7 +24,6 @@ |
||
24 | 24 | use JMS\Serializer\Annotation\AccessType; |
25 | 25 | use JMS\Serializer\Annotation\Discriminator; |
26 | 26 | use JMS\Serializer\Annotation\Exclude; |
27 | -use JMS\Serializer\Annotation\ExcludeIf; |
|
28 | 27 | use JMS\Serializer\Annotation\ExclusionPolicy; |
29 | 28 | use JMS\Serializer\Annotation\Expose; |
30 | 29 | use JMS\Serializer\Annotation\Groups; |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | $classMetadata->setDiscriminator($annot->field, $annot->map, $annot->groups); |
105 | 105 | } |
106 | 106 | } elseif ($annot instanceof XmlDiscriminator) { |
107 | - $classMetadata->xmlDiscriminatorAttribute = (bool)$annot->attribute; |
|
108 | - $classMetadata->xmlDiscriminatorCData = (bool)$annot->cdata; |
|
109 | - $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string)$annot->namespace : null; |
|
107 | + $classMetadata->xmlDiscriminatorAttribute = (bool) $annot->attribute; |
|
108 | + $classMetadata->xmlDiscriminatorCData = (bool) $annot->cdata; |
|
109 | + $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string) $annot->namespace : null; |
|
110 | 110 | } elseif ($annot instanceof VirtualProperty) { |
111 | 111 | $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $annot->name, $annot->exp); |
112 | 112 | $propertiesMetadata[] = $virtualPropertyMetadata; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | - if (!$excludeAll) { |
|
146 | + if ( ! $excludeAll) { |
|
147 | 147 | foreach ($class->getProperties() as $property) { |
148 | 148 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
149 | 149 | continue; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } elseif ($annot instanceof Expose) { |
175 | 175 | $isExpose = true; |
176 | 176 | if (null !== $annot->if) { |
177 | - $propertyMetadata->excludeIf = "!(" . $annot->if . ")"; |
|
177 | + $propertyMetadata->excludeIf = "!(".$annot->if.")"; |
|
178 | 178 | } |
179 | 179 | } elseif ($annot instanceof Exclude) { |
180 | 180 | if (null !== $annot->if) { |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | $accessor = array($annot->getter, $annot->setter); |
219 | 219 | } elseif ($annot instanceof Groups) { |
220 | 220 | $propertyMetadata->groups = $annot->groups; |
221 | - foreach ((array)$propertyMetadata->groups as $groupName) { |
|
221 | + foreach ((array) $propertyMetadata->groups as $groupName) { |
|
222 | 222 | if (false !== strpos($groupName, ',')) { |
223 | 223 | throw new InvalidArgumentException(sprintf( |
224 | 224 | 'Invalid group name "%s" on "%s", did you mean to create multiple groups?', |
225 | 225 | implode(', ', $propertyMetadata->groups), |
226 | - $propertyMetadata->class . '->' . $propertyMetadata->name |
|
226 | + $propertyMetadata->class.'->'.$propertyMetadata->name |
|
227 | 227 | )); |
228 | 228 | } |
229 | 229 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | |
240 | - if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
240 | + if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
241 | 241 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
242 | 242 | ) { |
243 | 243 | $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $isHash = isset($type['params'][1]); |
85 | 85 | |
86 | 86 | $count = $this->writer->changeCount; |
87 | - $isList = (isset($type['params'][0]) && !isset($type['params'][1])) |
|
87 | + $isList = (isset($type['params'][0]) && ! isset($type['params'][1])) |
|
88 | 88 | || array_keys($data) === range(0, count($data) - 1); |
89 | 89 | |
90 | 90 | foreach ($data as $k => $v) { |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | |
95 | - if ($isList && !$isHash) { |
|
95 | + if ($isList && ! $isHash) { |
|
96 | 96 | $this->writer->writeln('-'); |
97 | 97 | } else { |
98 | - $this->writer->writeln(Inline::dump($k) . ':'); |
|
98 | + $this->writer->writeln(Inline::dump($k).':'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $this->writer->indent(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | if (null !== $v = $this->navigator->accept($v, $this->getElementType($type), $context)) { |
104 | 104 | $this->writer |
105 | 105 | ->rtrim(false) |
106 | - ->writeln(' ' . $v); |
|
106 | + ->writeln(' '.$v); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | $this->writer->outdent(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | public function visitDouble($data, array $type, Context $context) |
135 | 135 | { |
136 | - $v = (string)$data; |
|
136 | + $v = (string) $data; |
|
137 | 137 | |
138 | 138 | if ('' === $this->writer->content) { |
139 | 139 | $this->writer->writeln($v); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | public function visitInteger($data, array $type, Context $context) |
146 | 146 | { |
147 | - $v = (string)$data; |
|
147 | + $v = (string) $data; |
|
148 | 148 | |
149 | 149 | if ('' === $this->writer->content) { |
150 | 150 | $this->writer->writeln($v); |
@@ -167,9 +167,9 @@ discard block |
||
167 | 167 | |
168 | 168 | $name = $this->namingStrategy->translateName($metadata); |
169 | 169 | |
170 | - if (!$metadata->inline) { |
|
170 | + if ( ! $metadata->inline) { |
|
171 | 171 | $this->writer |
172 | - ->writeln(Inline::dump($name) . ':') |
|
172 | + ->writeln(Inline::dump($name).':') |
|
173 | 173 | ->indent(); |
174 | 174 | } |
175 | 175 | |
@@ -180,12 +180,12 @@ discard block |
||
180 | 180 | if (null !== $v = $this->navigator->accept($v, $metadata->type, $context)) { |
181 | 181 | $this->writer |
182 | 182 | ->rtrim(false) |
183 | - ->writeln(' ' . $v); |
|
184 | - } elseif ($count === $this->writer->changeCount && !$metadata->inline) { |
|
183 | + ->writeln(' '.$v); |
|
184 | + } elseif ($count === $this->writer->changeCount && ! $metadata->inline) { |
|
185 | 185 | $this->writer->revert(); |
186 | 186 | } |
187 | 187 | |
188 | - if (!$metadata->inline) { |
|
188 | + if ( ! $metadata->inline) { |
|
189 | 189 | $this->writer->outdent(); |
190 | 190 | } |
191 | 191 | $this->revertCurrentMetadata(); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | return $this->initializedHandlers[$direction][$typeName][$format]; |
44 | 44 | } |
45 | 45 | |
46 | - if (!isset($this->handlers[$direction][$typeName][$format])) { |
|
46 | + if ( ! isset($this->handlers[$direction][$typeName][$format])) { |
|
47 | 47 | return null; |
48 | 48 | } |
49 | 49 |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | |
35 | 35 | switch ($direction) { |
36 | 36 | case GraphNavigator::DIRECTION_DESERIALIZATION: |
37 | - return 'deserialize' . $type . 'From' . $format; |
|
37 | + return 'deserialize'.$type.'From'.$format; |
|
38 | 38 | |
39 | 39 | case GraphNavigator::DIRECTION_SERIALIZATION: |
40 | - return 'serialize' . $type . 'To' . $format; |
|
40 | + return 'serialize'.$type.'To'.$format; |
|
41 | 41 | |
42 | 42 | default: |
43 | 43 | throw new LogicException(sprintf('The direction %s does not exist; see GraphNavigator::DIRECTION_??? constants.', json_encode($direction))); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function registerSubscribingHandler(SubscribingHandlerInterface $handler) |
53 | 53 | { |
54 | 54 | foreach ($handler->getSubscribingMethods() as $methodData) { |
55 | - if (!isset($methodData['type'], $methodData['format'])) { |
|
55 | + if ( ! isset($methodData['type'], $methodData['format'])) { |
|
56 | 56 | 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))); |
57 | 57 | } |
58 | 58 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public function getHandler($direction, $typeName, $format) |
81 | 81 | { |
82 | - if (!isset($this->handlers[$direction][$typeName][$format])) { |
|
82 | + if ( ! isset($this->handlers[$direction][$typeName][$format])) { |
|
83 | 83 | return null; |
84 | 84 | } |
85 | 85 |