@@ -104,32 +104,32 @@ discard block |
||
104 | 104 | $name = $config['prefix']; |
105 | 105 | |
106 | 106 | |
107 | - $builder->addDefinition($name . ".resolver") |
|
107 | + $builder->addDefinition($name.".resolver") |
|
108 | 108 | ->setClass('\Doctrine\ORM\Tools\ResolveTargetEntityListener'); |
109 | 109 | |
110 | - $builder->addDefinition($name . ".naming") |
|
110 | + $builder->addDefinition($name.".naming") |
|
111 | 111 | ->setClass('\Doctrine\ORM\Mapping\UnderscoreNamingStrategy'); |
112 | 112 | |
113 | - $builder->addDefinition($name . ".config") |
|
113 | + $builder->addDefinition($name.".config") |
|
114 | 114 | ->setClass('\Doctrine\ORM\Configuration') |
115 | 115 | ->addSetup(new Statement('setFilterSchemaAssetsExpression', [$config['dbal']['schema_filter']])); |
116 | 116 | |
117 | 117 | |
118 | - $builder->addDefinition($name . ".connection") |
|
118 | + $builder->addDefinition($name.".connection") |
|
119 | 119 | ->setClass('\Doctrine\DBAL\Connection') |
120 | - ->setFactory('@' . $name . '.entityManager::getConnection'); |
|
120 | + ->setFactory('@'.$name.'.entityManager::getConnection'); |
|
121 | 121 | |
122 | 122 | |
123 | - $builder->addDefinition($name . ".entityManager") |
|
123 | + $builder->addDefinition($name.".entityManager") |
|
124 | 124 | ->setClass('\Doctrine\ORM\EntityManager') |
125 | 125 | ->setFactory('\Doctrine\ORM\EntityManager::create', [ |
126 | 126 | $config['connection'], |
127 | - '@' . $name . '.config', |
|
127 | + '@'.$name.'.config', |
|
128 | 128 | '@Doctrine\Common\EventManager' |
129 | 129 | ]); |
130 | 130 | |
131 | 131 | if ($this->hasIBarPanelInterface()) { |
132 | - $builder->addDefinition($this->prefix($name . '.diagnosticsPanel')) |
|
132 | + $builder->addDefinition($this->prefix($name.'.diagnosticsPanel')) |
|
133 | 133 | ->setClass(self::DOCTRINE_SQL_PANEL_FQN); |
134 | 134 | } |
135 | 135 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | $cache = $this->getCache($name, $builder); |
147 | 147 | |
148 | - $configService = $builder->getDefinition($name . ".config") |
|
148 | + $configService = $builder->getDefinition($name.".config") |
|
149 | 149 | ->setFactory('\Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration', [ |
150 | 150 | array_values($this->entitySources), |
151 | 151 | $config['debug'], |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $cache, |
154 | 154 | FALSE |
155 | 155 | ]) |
156 | - ->addSetup('setNamingStrategy', ['@' . $name . '.naming']); |
|
156 | + ->addSetup('setNamingStrategy', ['@'.$name.'.naming']); |
|
157 | 157 | |
158 | 158 | |
159 | 159 | foreach ($config['functions'] as $functionName => $function) { |
@@ -168,22 +168,22 @@ discard block |
||
168 | 168 | |
169 | 169 | |
170 | 170 | foreach ($this->classMappings as $source => $target) { |
171 | - $builder->getDefinition($name . '.resolver') |
|
171 | + $builder->getDefinition($name.'.resolver') |
|
172 | 172 | ->addSetup('addResolveTargetEntity', [ |
173 | 173 | $source, $target, [] |
174 | 174 | ]); |
175 | 175 | } |
176 | 176 | |
177 | - if($this->hasEventManager($builder)) { |
|
177 | + if ($this->hasEventManager($builder)) { |
|
178 | 178 | $builder->getDefinition($builder->getByType('Doctrine\Common\EventManager')) |
179 | - ->addSetup('addEventListener', [Events::loadClassMetadata, '@' . $name . '.resolver']); |
|
179 | + ->addSetup('addEventListener', [Events::loadClassMetadata, '@'.$name.'.resolver']); |
|
180 | 180 | } else { |
181 | - if($config['ownEventManager']){ |
|
181 | + if ($config['ownEventManager']) { |
|
182 | 182 | throw new InvalidStateException("Where is your own EventManager?"); |
183 | 183 | } |
184 | - $builder->addDefinition($name . ".eventManager") |
|
184 | + $builder->addDefinition($name.".eventManager") |
|
185 | 185 | ->setClass('Doctrine\Common\EventManager') |
186 | - ->addSetup('addEventListener', [Events::loadClassMetadata, '@' . $name . '.resolver']); |
|
186 | + ->addSetup('addEventListener', [Events::loadClassMetadata, '@'.$name.'.resolver']); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | $this->processDbalTypes($name, $config['dbal']['types']); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | private function processDbalTypes($name, array $types) |
199 | 199 | { |
200 | 200 | $builder = $this->getContainerBuilder(); |
201 | - $connection = $builder->getDefinition($name . '.entityManager'); |
|
201 | + $connection = $builder->getDefinition($name.'.entityManager'); |
|
202 | 202 | |
203 | 203 | foreach ($types as $type => $typeSpec) { |
204 | 204 | if (is_array($typeSpec)) { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | private function processDbalTypeOverrides($name, array $types) |
223 | 223 | { |
224 | 224 | $builder = $this->getContainerBuilder(); |
225 | - $entityManagerDefinition = $builder->getDefinition($name . '.entityManager'); |
|
225 | + $entityManagerDefinition = $builder->getDefinition($name.'.entityManager'); |
|
226 | 226 | |
227 | 227 | foreach ($types as $type => $className) { |
228 | 228 | $entityManagerDefinition->addSetup('Doctrine\DBAL\Types\Type::overrideType(?, ?);', [$type, $className]); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | { |
235 | 235 | $initialize = $class->methods['initialize']; |
236 | 236 | if ($this->hasIBarPanelInterface()) { |
237 | - $initialize->addBody('$this->getByType(\'' . self::DOCTRINE_SQL_PANEL_FQN . '\')->bindToBar();'); |
|
237 | + $initialize->addBody('$this->getByType(\''.self::DOCTRINE_SQL_PANEL_FQN.'\')->bindToBar();'); |
|
238 | 238 | } |
239 | 239 | } |
240 | 240 | |
@@ -250,8 +250,8 @@ discard block |
||
250 | 250 | |
251 | 251 | private function addHelpersToKdybyConsole(ContainerBuilder $builder) |
252 | 252 | { |
253 | - if(class_exists(self::KDYBY_CONSOLE_EXTENSION)){ |
|
254 | - $helperTag = constant(self::KDYBY_CONSOLE_EXTENSION . '::HELPER_TAG'); |
|
253 | + if (class_exists(self::KDYBY_CONSOLE_EXTENSION)) { |
|
254 | + $helperTag = constant(self::KDYBY_CONSOLE_EXTENSION.'::HELPER_TAG'); |
|
255 | 255 | $builder->addDefinition($this->prefix('helper.entityManager')) |
256 | 256 | ->setClass('Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper') |
257 | 257 | ->addTag($helperTag, 'em'); |
@@ -269,13 +269,13 @@ discard block |
||
269 | 269 | return strlen($builder->getByType('Doctrine\Common\EventManager')) > 0; |
270 | 270 | } |
271 | 271 | |
272 | - private function getCache($prefix, ContainerBuilder $builder){ |
|
273 | - if(strlen($builder->getByType('Doctrine\Common\Cache\Cache')) > 0){ |
|
274 | - return '@' . $builder->getByType('Doctrine\Common\Cache\Cache'); |
|
272 | + private function getCache($prefix, ContainerBuilder $builder) { |
|
273 | + if (strlen($builder->getByType('Doctrine\Common\Cache\Cache')) > 0) { |
|
274 | + return '@'.$builder->getByType('Doctrine\Common\Cache\Cache'); |
|
275 | 275 | } else { |
276 | - $builder->addDefinition($prefix . ".cache") |
|
276 | + $builder->addDefinition($prefix.".cache") |
|
277 | 277 | ->setClass(self::DOCTRINE_DEFAULT_CACHE); |
278 | - return '@' . $prefix . ".cache"; |
|
278 | + return '@'.$prefix.".cache"; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |