@@ -91,31 +91,31 @@ discard block |
||
91 | 91 | $name = $config['prefix']; |
92 | 92 | |
93 | 93 | |
94 | - $builder->addDefinition($name . ".resolver") |
|
94 | + $builder->addDefinition($name.".resolver") |
|
95 | 95 | ->setClass('\Doctrine\ORM\Tools\ResolveTargetEntityListener'); |
96 | 96 | |
97 | - $builder->addDefinition($name . ".naming") |
|
97 | + $builder->addDefinition($name.".naming") |
|
98 | 98 | ->setClass('\Doctrine\ORM\Mapping\UnderscoreNamingStrategy'); |
99 | 99 | |
100 | - $builder->addDefinition($name . ".config") |
|
100 | + $builder->addDefinition($name.".config") |
|
101 | 101 | ->setClass('\Doctrine\ORM\Configuration'); |
102 | 102 | |
103 | 103 | |
104 | - $builder->addDefinition($name . ".connection") |
|
104 | + $builder->addDefinition($name.".connection") |
|
105 | 105 | ->setClass('\Doctrine\DBAL\Connection') |
106 | - ->setFactory('@' . $name . '.entityManager::getConnection'); |
|
106 | + ->setFactory('@'.$name.'.entityManager::getConnection'); |
|
107 | 107 | |
108 | 108 | |
109 | - $builder->addDefinition($name . ".entityManager") |
|
109 | + $builder->addDefinition($name.".entityManager") |
|
110 | 110 | ->setClass('\Doctrine\ORM\EntityManager') |
111 | 111 | ->setFactory('\Doctrine\ORM\EntityManager::create', [ |
112 | 112 | $config['connection'], |
113 | - '@' . $name . '.config', |
|
113 | + '@'.$name.'.config', |
|
114 | 114 | '@Doctrine\Common\EventManager' |
115 | 115 | ]); |
116 | 116 | |
117 | 117 | if ($this->hasIBarPanelInterface()) { |
118 | - $builder->addDefinition($this->prefix($name . '.diagnosticsPanel')) |
|
118 | + $builder->addDefinition($this->prefix($name.'.diagnosticsPanel')) |
|
119 | 119 | ->setClass(self::DOCTRINE_SQL_PANEL_FQN); |
120 | 120 | } |
121 | 121 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | $cache = $this->getCache($name, $builder); |
133 | 133 | |
134 | - $configService = $builder->getDefinition($name . ".config") |
|
134 | + $configService = $builder->getDefinition($name.".config") |
|
135 | 135 | ->setFactory('\Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration', [ |
136 | 136 | array_values($this->entitySources), |
137 | 137 | $config['debug'], |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $cache, |
140 | 140 | FALSE |
141 | 141 | ]) |
142 | - ->addSetup('setNamingStrategy', ['@' . $name . '.naming']); |
|
142 | + ->addSetup('setNamingStrategy', ['@'.$name.'.naming']); |
|
143 | 143 | |
144 | 144 | |
145 | 145 | foreach ($config['functions'] as $functionName => $function) { |
@@ -154,22 +154,22 @@ discard block |
||
154 | 154 | |
155 | 155 | |
156 | 156 | foreach ($this->classMappings as $source => $target) { |
157 | - $builder->getDefinition($name . '.resolver') |
|
157 | + $builder->getDefinition($name.'.resolver') |
|
158 | 158 | ->addSetup('addResolveTargetEntity', [ |
159 | 159 | $source, $target, [] |
160 | 160 | ]); |
161 | 161 | } |
162 | 162 | |
163 | - if($this->hasEventManager($builder)) { |
|
163 | + if ($this->hasEventManager($builder)) { |
|
164 | 164 | $builder->getDefinition($builder->getByType('Doctrine\Common\EventManager')) |
165 | - ->addSetup('addEventListener', [Events::loadClassMetadata, '@' . $name . '.resolver']); |
|
165 | + ->addSetup('addEventListener', [Events::loadClassMetadata, '@'.$name.'.resolver']); |
|
166 | 166 | } else { |
167 | - if($config['ownEventManager']){ |
|
167 | + if ($config['ownEventManager']) { |
|
168 | 168 | throw new InvalidStateException("Where is your own EventManager?"); |
169 | 169 | } |
170 | - $builder->addDefinition($name . ".eventManager") |
|
170 | + $builder->addDefinition($name.".eventManager") |
|
171 | 171 | ->setClass('Doctrine\Common\EventManager') |
172 | - ->addSetup('addEventListener', [Events::loadClassMetadata, '@' . $name . '.resolver']); |
|
172 | + ->addSetup('addEventListener', [Events::loadClassMetadata, '@'.$name.'.resolver']); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | $initialize = $class->methods['initialize']; |
180 | 180 | if ($this->hasIBarPanelInterface()) { |
181 | - $initialize->addBody('$this->getByType(\'' . self::DOCTRINE_SQL_PANEL_FQN . '\')->bindToBar();'); |
|
181 | + $initialize->addBody('$this->getByType(\''.self::DOCTRINE_SQL_PANEL_FQN.'\')->bindToBar();'); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | |
195 | 195 | private function addHelpersToKdybyConsole(ContainerBuilder $builder) |
196 | 196 | { |
197 | - if(class_exists(self::KDYBY_CONSOLE_EXTENSION)){ |
|
198 | - $helperTag = constant(self::KDYBY_CONSOLE_EXTENSION . '::HELPER_TAG'); |
|
197 | + if (class_exists(self::KDYBY_CONSOLE_EXTENSION)) { |
|
198 | + $helperTag = constant(self::KDYBY_CONSOLE_EXTENSION.'::HELPER_TAG'); |
|
199 | 199 | $builder->addDefinition($this->prefix('helper.entityManager')) |
200 | 200 | ->setClass('Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper') |
201 | 201 | ->addTag($helperTag, 'em'); |
@@ -213,13 +213,13 @@ discard block |
||
213 | 213 | return strlen($builder->getByType('Doctrine\Common\EventManager')) > 0; |
214 | 214 | } |
215 | 215 | |
216 | - private function getCache($prefix, ContainerBuilder $builder){ |
|
217 | - if(strlen($builder->getByType('Doctrine\Common\Cache\Cache')) > 0){ |
|
218 | - return '@' . $builder->getByType('Doctrine\Common\Cache\Cache'); |
|
216 | + private function getCache($prefix, ContainerBuilder $builder) { |
|
217 | + if (strlen($builder->getByType('Doctrine\Common\Cache\Cache')) > 0) { |
|
218 | + return '@'.$builder->getByType('Doctrine\Common\Cache\Cache'); |
|
219 | 219 | } else { |
220 | - $builder->addDefinition($prefix . ".cache") |
|
220 | + $builder->addDefinition($prefix.".cache") |
|
221 | 221 | ->setClass(self::DOCTRINE_DEFAULT_CACHE); |
222 | - return '@' . $prefix . ".cache"; |
|
222 | + return '@'.$prefix.".cache"; |
|
223 | 223 | } |
224 | 224 | } |
225 | 225 | } |