@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $config = Yaml::parse(file_get_contents($file)); |
37 | 37 | |
38 | - if (!isset($config[$name = $class->name])) { |
|
38 | + if ( ! isset($config[$name = $class->name])) { |
|
39 | 39 | throw new RuntimeException(sprintf('Expected metadata for class %s to be defined in %s.', $class->name, $file)); |
40 | 40 | } |
41 | 41 | |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | $metadata->fileResources[] = $file; |
45 | 45 | $metadata->fileResources[] = $class->getFileName(); |
46 | 46 | $exclusionPolicy = isset($config['exclusion_policy']) ? strtoupper($config['exclusion_policy']) : 'NONE'; |
47 | - $excludeAll = isset($config['exclude']) ? (Boolean)$config['exclude'] : false; |
|
47 | + $excludeAll = isset($config['exclude']) ? (Boolean) $config['exclude'] : false; |
|
48 | 48 | $classAccessType = isset($config['access_type']) ? $config['access_type'] : PropertyMetadata::ACCESS_TYPE_PROPERTY; |
49 | - $readOnlyClass = isset($config['read_only']) ? (Boolean)$config['read_only'] : false; |
|
49 | + $readOnlyClass = isset($config['read_only']) ? (Boolean) $config['read_only'] : false; |
|
50 | 50 | $this->addClassProperties($metadata, $config); |
51 | 51 | |
52 | 52 | $propertiesMetadata = array(); |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | |
59 | 59 | } else { |
60 | 60 | |
61 | - if (!$class->hasMethod($methodName)) { |
|
62 | - throw new RuntimeException('The method ' . $methodName . ' not found in class ' . $class->name); |
|
61 | + if ( ! $class->hasMethod($methodName)) { |
|
62 | + throw new RuntimeException('The method '.$methodName.' not found in class '.$class->name); |
|
63 | 63 | } |
64 | 64 | $virtualPropertyMetadata = new VirtualPropertyMetadata($name, $methodName); |
65 | 65 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - if (!$excludeAll) { |
|
71 | + if ( ! $excludeAll) { |
|
72 | 72 | foreach ($class->getProperties() as $property) { |
73 | 73 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
74 | 74 | continue; |
@@ -88,39 +88,39 @@ discard block |
||
88 | 88 | $pConfig = $config['properties'][$pName]; |
89 | 89 | |
90 | 90 | if (isset($pConfig['exclude'])) { |
91 | - $isExclude = (Boolean)$pConfig['exclude']; |
|
91 | + $isExclude = (Boolean) $pConfig['exclude']; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | if (isset($pConfig['expose'])) { |
95 | - $isExpose = (Boolean)$pConfig['expose']; |
|
95 | + $isExpose = (Boolean) $pConfig['expose']; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | if (isset($pConfig['skip_when_empty'])) { |
99 | - $pMetadata->skipWhenEmpty = (Boolean)$pConfig['skip_when_empty']; |
|
99 | + $pMetadata->skipWhenEmpty = (Boolean) $pConfig['skip_when_empty']; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if (isset($pConfig['since_version'])) { |
103 | - $pMetadata->sinceVersion = (string)$pConfig['since_version']; |
|
103 | + $pMetadata->sinceVersion = (string) $pConfig['since_version']; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | if (isset($pConfig['until_version'])) { |
107 | - $pMetadata->untilVersion = (string)$pConfig['until_version']; |
|
107 | + $pMetadata->untilVersion = (string) $pConfig['until_version']; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | if (isset($pConfig['exclude_if'])) { |
111 | - $pMetadata->excludeIf = (string)$pConfig['exclude_if']; |
|
111 | + $pMetadata->excludeIf = (string) $pConfig['exclude_if']; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | if (isset($pConfig['expose_if'])) { |
115 | - $pMetadata->excludeIf = "!(" . $pConfig['expose_if'] . ")"; |
|
115 | + $pMetadata->excludeIf = "!(".$pConfig['expose_if'].")"; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | if (isset($pConfig['serialized_name'])) { |
119 | - $pMetadata->serializedName = (string)$pConfig['serialized_name']; |
|
119 | + $pMetadata->serializedName = (string) $pConfig['serialized_name']; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | if (isset($pConfig['type'])) { |
123 | - $pMetadata->setType((string)$pConfig['type']); |
|
123 | + $pMetadata->setType((string) $pConfig['type']); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | if (isset($pConfig['groups'])) { |
@@ -132,21 +132,21 @@ discard block |
||
132 | 132 | |
133 | 133 | $colConfig = $pConfig['xml_list']; |
134 | 134 | if (isset($colConfig['inline'])) { |
135 | - $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline']; |
|
135 | + $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline']; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | if (isset($colConfig['entry_name'])) { |
139 | - $pMetadata->xmlEntryName = (string)$colConfig['entry_name']; |
|
139 | + $pMetadata->xmlEntryName = (string) $colConfig['entry_name']; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | if (isset($colConfig['skip_when_empty'])) { |
143 | - $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty']; |
|
143 | + $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty']; |
|
144 | 144 | } else { |
145 | 145 | $pMetadata->xmlCollectionSkipWhenEmpty = true; |
146 | 146 | } |
147 | 147 | |
148 | 148 | if (isset($colConfig['namespace'])) { |
149 | - $pMetadata->xmlEntryNamespace = (string)$colConfig['namespace']; |
|
149 | + $pMetadata->xmlEntryNamespace = (string) $colConfig['namespace']; |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
@@ -155,15 +155,15 @@ discard block |
||
155 | 155 | |
156 | 156 | $colConfig = $pConfig['xml_map']; |
157 | 157 | if (isset($colConfig['inline'])) { |
158 | - $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline']; |
|
158 | + $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline']; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | if (isset($colConfig['entry_name'])) { |
162 | - $pMetadata->xmlEntryName = (string)$colConfig['entry_name']; |
|
162 | + $pMetadata->xmlEntryName = (string) $colConfig['entry_name']; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | if (isset($colConfig['namespace'])) { |
166 | - $pMetadata->xmlEntryNamespace = (string)$colConfig['namespace']; |
|
166 | + $pMetadata->xmlEntryNamespace = (string) $colConfig['namespace']; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | if (isset($colConfig['key_attribute_name'])) { |
@@ -175,33 +175,33 @@ discard block |
||
175 | 175 | if (isset($pConfig['xml_element'])) { |
176 | 176 | $colConfig = $pConfig['xml_element']; |
177 | 177 | if (isset($colConfig['cdata'])) { |
178 | - $pMetadata->xmlElementCData = (Boolean)$colConfig['cdata']; |
|
178 | + $pMetadata->xmlElementCData = (Boolean) $colConfig['cdata']; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | if (isset($colConfig['namespace'])) { |
182 | - $pMetadata->xmlNamespace = (string)$colConfig['namespace']; |
|
182 | + $pMetadata->xmlNamespace = (string) $colConfig['namespace']; |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
186 | 186 | if (isset($pConfig['xml_attribute'])) { |
187 | - $pMetadata->xmlAttribute = (Boolean)$pConfig['xml_attribute']; |
|
187 | + $pMetadata->xmlAttribute = (Boolean) $pConfig['xml_attribute']; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | if (isset($pConfig['xml_attribute_map'])) { |
191 | - $pMetadata->xmlAttributeMap = (Boolean)$pConfig['xml_attribute_map']; |
|
191 | + $pMetadata->xmlAttributeMap = (Boolean) $pConfig['xml_attribute_map']; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | if (isset($pConfig['xml_value'])) { |
195 | - $pMetadata->xmlValue = (Boolean)$pConfig['xml_value']; |
|
195 | + $pMetadata->xmlValue = (Boolean) $pConfig['xml_value']; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | if (isset($pConfig['xml_key_value_pairs'])) { |
199 | - $pMetadata->xmlKeyValuePairs = (Boolean)$pConfig['xml_key_value_pairs']; |
|
199 | + $pMetadata->xmlKeyValuePairs = (Boolean) $pConfig['xml_key_value_pairs']; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | //we need read_only before setter and getter set, because that method depends on flag being set |
203 | 203 | if (isset($pConfig['read_only'])) { |
204 | - $pMetadata->readOnly = (Boolean)$pConfig['read_only']; |
|
204 | + $pMetadata->readOnly = (Boolean) $pConfig['read_only']; |
|
205 | 205 | } else { |
206 | 206 | $pMetadata->readOnly = $pMetadata->readOnly || $readOnlyClass; |
207 | 207 | } |
@@ -213,14 +213,14 @@ discard block |
||
213 | 213 | ); |
214 | 214 | |
215 | 215 | if (isset($pConfig['inline'])) { |
216 | - $pMetadata->inline = (Boolean)$pConfig['inline']; |
|
216 | + $pMetadata->inline = (Boolean) $pConfig['inline']; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | if (isset($pConfig['max_depth'])) { |
220 | - $pMetadata->maxDepth = (int)$pConfig['max_depth']; |
|
220 | + $pMetadata->maxDepth = (int) $pConfig['max_depth']; |
|
221 | 221 | } |
222 | 222 | } |
223 | - if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
223 | + if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
224 | 224 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
225 | 225 | ) { |
226 | 226 | $metadata->addPropertyMetadata($pMetadata); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | private function addClassProperties(ClassMetadata $metadata, array $config) |
263 | 263 | { |
264 | - if (isset($config['custom_accessor_order']) && !isset($config['accessor_order'])) { |
|
264 | + if (isset($config['custom_accessor_order']) && ! isset($config['accessor_order'])) { |
|
265 | 265 | $config['accessor_order'] = 'custom'; |
266 | 266 | } |
267 | 267 | |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | if (isset($config['xml_root_name'])) { |
273 | - $metadata->xmlRootName = (string)$config['xml_root_name']; |
|
273 | + $metadata->xmlRootName = (string) $config['xml_root_name']; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | if (isset($config['xml_root_namespace'])) { |
277 | - $metadata->xmlRootNamespace = (string)$config['xml_root_namespace']; |
|
277 | + $metadata->xmlRootNamespace = (string) $config['xml_root_namespace']; |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | if (array_key_exists('xml_namespaces', $config)) { |
@@ -289,25 +289,25 @@ discard block |
||
289 | 289 | if (isset($config['discriminator']['disabled']) && true === $config['discriminator']['disabled']) { |
290 | 290 | $metadata->discriminatorDisabled = true; |
291 | 291 | } else { |
292 | - if (!isset($config['discriminator']['field_name'])) { |
|
292 | + if ( ! isset($config['discriminator']['field_name'])) { |
|
293 | 293 | throw new RuntimeException('The "field_name" attribute must be set for discriminators.'); |
294 | 294 | } |
295 | 295 | |
296 | - if (!isset($config['discriminator']['map']) || !is_array($config['discriminator']['map'])) { |
|
296 | + if ( ! isset($config['discriminator']['map']) || ! is_array($config['discriminator']['map'])) { |
|
297 | 297 | throw new RuntimeException('The "map" attribute must be set, and be an array for discriminators.'); |
298 | 298 | } |
299 | 299 | $groups = isset($config['discriminator']['groups']) ? $config['discriminator']['groups'] : array(); |
300 | 300 | $metadata->setDiscriminator($config['discriminator']['field_name'], $config['discriminator']['map'], $groups); |
301 | 301 | |
302 | 302 | if (isset($config['discriminator']['xml_attribute'])) { |
303 | - $metadata->xmlDiscriminatorAttribute = (bool)$config['discriminator']['xml_attribute']; |
|
303 | + $metadata->xmlDiscriminatorAttribute = (bool) $config['discriminator']['xml_attribute']; |
|
304 | 304 | } |
305 | 305 | if (isset($config['discriminator']['xml_element'])) { |
306 | 306 | if (isset($config['discriminator']['xml_element']['cdata'])) { |
307 | - $metadata->xmlDiscriminatorCData = (bool)$config['discriminator']['xml_element']['cdata']; |
|
307 | + $metadata->xmlDiscriminatorCData = (bool) $config['discriminator']['xml_element']['cdata']; |
|
308 | 308 | } |
309 | 309 | if (isset($config['discriminator']['xml_element']['namespace'])) { |
310 | - $metadata->xmlDiscriminatorNamespace = (string)$config['discriminator']['xml_element']['namespace']; |
|
310 | + $metadata->xmlDiscriminatorNamespace = (string) $config['discriminator']['xml_element']['namespace']; |
|
311 | 311 | } |
312 | 312 | } |
313 | 313 | |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | { |
320 | 320 | if (is_string($config)) { |
321 | 321 | $config = array($config); |
322 | - } elseif (!is_array($config)) { |
|
322 | + } elseif ( ! is_array($config)) { |
|
323 | 323 | throw new RuntimeException(sprintf('callback methods expects a string, or an array of strings that represent method names, but got %s.', json_encode($config['pre_serialize']))); |
324 | 324 | } |
325 | 325 | |
326 | 326 | $methods = array(); |
327 | 327 | foreach ($config as $name) { |
328 | - if (!$class->hasMethod($name)) { |
|
328 | + if ( ! $class->hasMethod($name)) { |
|
329 | 329 | throw new RuntimeException(sprintf('The method %s does not exist in class %s.', $name, $class->name)); |
330 | 330 | } |
331 | 331 |
@@ -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 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $metadata = require $file; |
30 | 30 | |
31 | - if (!$metadata instanceof ClassMetadata) { |
|
31 | + if ( ! $metadata instanceof ClassMetadata) { |
|
32 | 32 | throw new RuntimeException(sprintf('The file %s was expected to return an instance of ClassMetadata, but returned %s.', $file, json_encode($metadata))); |
33 | 33 | } |
34 | 34 | if ($metadata->name !== $class->name) { |
@@ -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 |
@@ -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 |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | |
42 | 42 | public function __construct($skipVirtualTypeInit = false, $initializeExcluded = true) |
43 | 43 | { |
44 | - $this->skipVirtualTypeInit = (bool)$skipVirtualTypeInit; |
|
45 | - $this->initializeExcluded = (bool)$initializeExcluded; |
|
44 | + $this->skipVirtualTypeInit = (bool) $skipVirtualTypeInit; |
|
45 | + $this->initializeExcluded = (bool) $initializeExcluded; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function onPreSerialize(PreSerializeEvent $event) |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | // If the set type name is not an actual class, but a faked type for which a custom handler exists, we do not |
54 | 54 | // modify it with this subscriber. Also, we forgo autoloading here as an instance of this type is already created, |
55 | 55 | // so it must be loaded if its a real class. |
56 | - $virtualType = !class_exists($type['name'], false); |
|
56 | + $virtualType = ! class_exists($type['name'], false); |
|
57 | 57 | |
58 | 58 | if ($object instanceof PersistentCollection |
59 | 59 | || $object instanceof MongoDBPersistentCollection |
60 | 60 | || $object instanceof PHPCRPersistentCollection |
61 | 61 | ) { |
62 | - if (!$virtualType) { |
|
62 | + if ( ! $virtualType) { |
|
63 | 63 | $event->setType('ArrayCollection'); |
64 | 64 | } |
65 | 65 | |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | if (($this->skipVirtualTypeInit && $virtualType) || |
70 | - (!$object instanceof Proxy && !$object instanceof ORMProxy) |
|
70 | + ( ! $object instanceof Proxy && ! $object instanceof ORMProxy) |
|
71 | 71 | ) { |
72 | 72 | return; |
73 | 73 | } |
74 | 74 | |
75 | 75 | // do not initialize the proxy if is going to be excluded by-class by some exclusion strategy |
76 | - if ($this->initializeExcluded === false && !$virtualType) { |
|
76 | + if ($this->initializeExcluded === false && ! $virtualType) { |
|
77 | 77 | $context = $event->getContext(); |
78 | 78 | $exclusionStrategy = $context->getExclusionStrategy(); |
79 | 79 | if ($exclusionStrategy !== null && $exclusionStrategy->shouldSkipClass($context->getMetadataFactory()->getMetadataForClass(get_parent_class($object)), $context)) { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $object->__load(); |
85 | 85 | |
86 | - if (!$virtualType) { |
|
86 | + if ( ! $virtualType) { |
|
87 | 87 | $event->setType(get_parent_class($object), $type['params']); |
88 | 88 | } |
89 | 89 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $type = $event->getType(); |
94 | 94 | // is a virtual type? then there is no need to change the event name |
95 | - if (!class_exists($type['name'], false)) { |
|
95 | + if ( ! class_exists($type['name'], false)) { |
|
96 | 96 | return; |
97 | 97 | } |
98 | 98 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | $validator = $this->validator; |
51 | 51 | $context->attributes->get('validation_groups')->map( |
52 | - function (array $groups) use ($event, $validator) { |
|
52 | + function(array $groups) use ($event, $validator) { |
|
53 | 53 | $list = $validator->validate($event->getObject(), $groups); |
54 | 54 | |
55 | 55 | if ($list->count() > 0) { |
@@ -37,11 +37,11 @@ |
||
37 | 37 | $listeners = parent::initializeListeners($eventName, $loweredClass, $format); |
38 | 38 | |
39 | 39 | foreach ($listeners as &$listener) { |
40 | - if (!is_array($listener) || !is_string($listener[0])) { |
|
40 | + if ( ! is_array($listener) || ! is_string($listener[0])) { |
|
41 | 41 | continue; |
42 | 42 | } |
43 | 43 | |
44 | - if (!$this->container->has($listener[0])) { |
|
44 | + if ( ! $this->container->has($listener[0])) { |
|
45 | 45 | continue; |
46 | 46 | } |
47 | 47 |
@@ -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,26 +72,26 @@ 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 | 79 | $loweredClass = strtolower($class); |
80 | - if (!isset($this->classListeners[$eventName][$loweredClass][$format])) { |
|
80 | + if ( ! isset($this->classListeners[$eventName][$loweredClass][$format])) { |
|
81 | 81 | $this->classListeners[$eventName][$loweredClass][$format] = $this->initializeListeners($eventName, $loweredClass, $format); |
82 | 82 | } |
83 | 83 | |
84 | - return !!$this->classListeners[$eventName][$loweredClass][$format]; |
|
84 | + return ! ! $this->classListeners[$eventName][$loweredClass][$format]; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | public function dispatch($eventName, $class, $format, Event $event) |
88 | 88 | { |
89 | - if (!isset($this->listeners[$eventName])) { |
|
89 | + if ( ! isset($this->listeners[$eventName])) { |
|
90 | 90 | return; |
91 | 91 | } |
92 | 92 | |
93 | 93 | $loweredClass = strtolower($class); |
94 | - if (!isset($this->classListeners[$eventName][$loweredClass][$format])) { |
|
94 | + if ( ! isset($this->classListeners[$eventName][$loweredClass][$format])) { |
|
95 | 95 | $this->classListeners[$eventName][$loweredClass][$format] = $this->initializeListeners($eventName, $loweredClass, $format); |
96 | 96 | } |
97 | 97 |