@@ -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 | |
@@ -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(); |
@@ -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 | |
@@ -41,14 +41,14 @@ |
||
| 41 | 41 | 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, |
| 42 | 42 | 'type' => $type, |
| 43 | 43 | 'format' => $format, |
| 44 | - 'method' => 'serialize' . $shortName, |
|
| 44 | + 'method' => 'serialize'.$shortName, |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | $methods[] = array( |
| 48 | 48 | 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, |
| 49 | 49 | 'type' => $type, |
| 50 | 50 | 'format' => $format, |
| 51 | - 'method' => 'deserialize' . $shortName, |
|
| 51 | + 'method' => 'deserialize'.$shortName, |
|
| 52 | 52 | ); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, |
| 41 | 41 | 'type' => $type, |
| 42 | 42 | 'format' => $format, |
| 43 | - 'method' => $method . 'To' . $format, |
|
| 43 | + 'method' => $method.'To'.$format, |
|
| 44 | 44 | ); |
| 45 | 45 | } |
| 46 | 46 | } |