@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /x', |
51 | 51 | array(self::T_NAME => 'T_NAME', self::T_STRING => 'T_STRING', self::T_OPEN_BRACKET => 'T_OPEN_BRACKET', |
52 | 52 | self::T_CLOSE_BRACKET => 'T_CLOSE_BRACKET', self::T_COMMA => 'T_COMMA', self::T_NONE => 'T_NONE'), |
53 | - function ($value) { |
|
53 | + function($value) { |
|
54 | 54 | switch ($value[0]) { |
55 | 55 | case '"': |
56 | 56 | case "'": |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | protected function parseInternal() |
83 | 83 | { |
84 | 84 | $typeName = $this->match(self::T_NAME); |
85 | - if (!$this->lexer->isNext(self::T_OPEN_BRACKET)) { |
|
85 | + if ( ! $this->lexer->isNext(self::T_OPEN_BRACKET)) { |
|
86 | 86 | return array('name' => $typeName, 'params' => array()); |
87 | 87 | } |
88 | 88 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public static function getDefaultMethodName($eventName) |
37 | 37 | { |
38 | - return 'on' . str_replace(array('_', '.'), '', $eventName); |
|
38 | + return 'on'.str_replace(array('_', '.'), '', $eventName); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | public function addSubscriber(EventSubscriberInterface $subscriber) |
59 | 59 | { |
60 | 60 | foreach ($subscriber->getSubscribedEvents() as $eventData) { |
61 | - if (!isset($eventData['event'])) { |
|
61 | + if ( ! isset($eventData['event'])) { |
|
62 | 62 | throw new InvalidArgumentException(sprintf('Each event must have a "event" key.')); |
63 | 63 | } |
64 | 64 | |
@@ -72,24 +72,24 @@ discard block |
||
72 | 72 | |
73 | 73 | public function hasListeners($eventName, $class, $format) |
74 | 74 | { |
75 | - if (!isset($this->listeners[$eventName])) { |
|
75 | + if ( ! isset($this->listeners[$eventName])) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | - if (!isset($this->classListeners[$eventName][$class][$format])) { |
|
79 | + if ( ! isset($this->classListeners[$eventName][$class][$format])) { |
|
80 | 80 | $this->classListeners[$eventName][$class][$format] = $this->initializeListeners($eventName, $class, $format); |
81 | 81 | } |
82 | 82 | |
83 | - return !!$this->classListeners[$eventName][$class][$format]; |
|
83 | + return ! ! $this->classListeners[$eventName][$class][$format]; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function dispatch($eventName, $class, $format, Event $event) |
87 | 87 | { |
88 | - if (!isset($this->listeners[$eventName])) { |
|
88 | + if ( ! isset($this->listeners[$eventName])) { |
|
89 | 89 | return; |
90 | 90 | } |
91 | 91 | |
92 | - if (!isset($this->classListeners[$eventName][$class][$format])) { |
|
92 | + if ( ! isset($this->classListeners[$eventName][$class][$format])) { |
|
93 | 93 | $this->classListeners[$eventName][$class][$format] = $this->initializeListeners($eventName, $class, $format); |
94 | 94 | } |
95 | 95 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $classMetadata = $this->delegate->loadMetadataForClass($class); |
84 | 84 | |
85 | 85 | // Abort if the given class is not a mapped entity |
86 | - if (!$doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) { |
|
86 | + if ( ! $doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) { |
|
87 | 87 | return $classMetadata; |
88 | 88 | } |
89 | 89 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | protected function tryLoadingDoctrineMetadata($className) |
150 | 150 | { |
151 | - if (!$manager = $this->registry->getManagerForClass($className)) { |
|
151 | + if ( ! $manager = $this->registry->getManagerForClass($className)) { |
|
152 | 152 | return null; |
153 | 153 | } |
154 | 154 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | protected function normalizeFieldType($type) |
166 | 166 | { |
167 | - if (!isset($this->fieldMapping[$type])) { |
|
167 | + if ( ! isset($this->fieldMapping[$type])) { |
|
168 | 168 | return; |
169 | 169 | } |
170 | 170 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $propertyName = $propertyMetadata->name; |
44 | 44 | if ($doctrineMetadata->hasField($propertyName) && $fieldType = $this->normalizeFieldType($doctrineMetadata->getTypeOfField($propertyName))) { |
45 | 45 | $field = $doctrineMetadata->getFieldMapping($propertyName); |
46 | - if (!empty($field['multivalue'])) { |
|
46 | + if ( ! empty($field['multivalue'])) { |
|
47 | 47 | $fieldType = 'array'; |
48 | 48 | } |
49 | 49 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
62 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
62 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
63 | 63 | $targetEntity = "ArrayCollection<{$targetEntity}>"; |
64 | 64 | } |
65 | 65 |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | { |
31 | 31 | protected function setDiscriminator(DoctrineClassMetadata $doctrineMetadata, ClassMetadata $classMetadata) |
32 | 32 | { |
33 | - if (empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled |
|
34 | - && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
33 | + if (empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled |
|
34 | + && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
35 | 35 | ) { |
36 | 36 | $classMetadata->setDiscriminator( |
37 | 37 | $doctrineMetadata->discriminatorColumn['name'], |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy. |
56 | 56 | // On serialization, this would lead to only the supertype being serialized, and properties of subtypes |
57 | 57 | // being ignored. |
58 | - if ($targetMetadata instanceof DoctrineClassMetadata && !$targetMetadata->isInheritanceTypeNone()) { |
|
58 | + if ($targetMetadata instanceof DoctrineClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) { |
|
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
62 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
62 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
63 | 63 | $targetEntity = "ArrayCollection<{$targetEntity}>"; |
64 | 64 | } |
65 | 65 |
@@ -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 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | public function __construct(array $values) |
35 | 35 | { |
36 | - if (!\is_string($values['value'])) { |
|
36 | + if ( ! \is_string($values['value'])) { |
|
37 | 37 | throw new RuntimeException('"value" must be a string.'); |
38 | 38 | } |
39 | 39 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | foreach ($data as $key => $value) { |
43 | - if (!property_exists(__CLASS__, $key)) { |
|
43 | + if ( ! property_exists(__CLASS__, $key)) { |
|
44 | 44 | throw new InvalidArgumentException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__)); |
45 | 45 | } |
46 | 46 | $this->{$key} = $value; |
@@ -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 |