@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $params = $this->queries[$key][self::PARAMS]; |
130 | 130 | $types = $this->queries[$key][self::TYPES]; |
131 | 131 | |
132 | - $stmt = $this->connection->executeQuery('EXPLAIN ' . $query, $params, $types); |
|
132 | + $stmt = $this->connection->executeQuery('EXPLAIN '.$query, $params, $types); |
|
133 | 133 | |
134 | 134 | $this->queries[$key][self::EXPLAIN] = $stmt->fetchAll(); |
135 | 135 | |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | { |
146 | 146 | return '<span title="Doctrine 2">' |
147 | 147 | . '<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU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iD781bz83cr849H96dz969/+7uT+8+v+8+3+9O7+9/H++PT//Pv//v7///+xeeLXAAAAO3RSTlMAAAAAAAAAAAAAAAAAAAAAAgUGBw0QEBERFBUZHR4fKSotP0RKW15lc32GlaWsydvo6err6+z2+vv8/YuXaogAAAABYktHRGjLbPQiAAAAuklEQVQYGQXBhyIVABQA0FNkr6zsGTKzZT83e5Vsks39/y/oHFD7ZbC+HADMLU82qgRQaSpivsUHAGVtCxE37aoBRRrGI+K6B1BhZGntVyHisB8wtBOX+bq7EWfdxfjUfBPx8yHf9wrxHfTF6vHvk5fMP4UfdTAafzMzM3NzqwsG4ur56fEt837loAk6D6Kwfp75by1moMpExEXmXcTOMPB5No7yNmJ7TA3g2+Lp/vX0VyWAUjp6W/mI/zsxJP3EcQMdAAAAAElFTkSuQmCC" />' |
148 | - . count($this->queries) . ' queries' |
|
149 | - . ($this->totalTime ? ' / ' . sprintf('%0.1f', $this->totalTime * 1000) . 'ms' : '') |
|
148 | + . count($this->queries).' queries' |
|
149 | + . ($this->totalTime ? ' / '.sprintf('%0.1f', $this->totalTime * 1000).'ms' : '') |
|
150 | 150 | . '</span>'; |
151 | 151 | } |
152 | 152 | |
@@ -158,36 +158,36 @@ discard block |
||
158 | 158 | protected function processQuery(array $query) |
159 | 159 | { |
160 | 160 | $s = '<tr>'; |
161 | - $s .= '<td>' . sprintf('%0.3f', $query[self::TIME] * 1000); |
|
161 | + $s .= '<td>'.sprintf('%0.3f', $query[self::TIME] * 1000); |
|
162 | 162 | |
163 | 163 | if ($this->doExplains && isset($query[self::EXPLAIN])) { |
164 | 164 | static $counter; |
165 | 165 | $counter++; |
166 | - $s .= "<br /><a href='#' class='nette-toggler' rel='#nette-Doctrine2Panel-row-$counter'>" . |
|
166 | + $s .= "<br /><a href='#' class='nette-toggler' rel='#nette-Doctrine2Panel-row-$counter'>". |
|
167 | 167 | "explain ►</a>"; |
168 | 168 | } |
169 | 169 | |
170 | 170 | $s .= '</td>'; |
171 | - $s .= '<td class="nette-Doctrine2Panel-sql" style="min-width: 400px">' . |
|
171 | + $s .= '<td class="nette-Doctrine2Panel-sql" style="min-width: 400px">'. |
|
172 | 172 | Helpers::dumpSql($query[self::SQL]); |
173 | 173 | |
174 | 174 | if ($this->doExplains && isset($query[self::EXPLAIN])) { |
175 | 175 | $s .= "<table id='nette-Doctrine2Panel-row-$counter' class='nette-collapsed'><tr>"; |
176 | 176 | foreach ($query[self::EXPLAIN][0] as $col => $foo) { |
177 | - $s .= '<th>' . htmlSpecialChars($col) . '</th>'; |
|
177 | + $s .= '<th>'.htmlSpecialChars($col).'</th>'; |
|
178 | 178 | } |
179 | 179 | $s .= '</tr>'; |
180 | 180 | foreach ($query[self::EXPLAIN] as $row) { |
181 | 181 | $s .= '<tr>'; |
182 | 182 | foreach ($row as $col) { |
183 | - $s .= '<td>' . htmlSpecialChars($col) . '</td>'; |
|
183 | + $s .= '<td>'.htmlSpecialChars($col).'</td>'; |
|
184 | 184 | } |
185 | 185 | $s .= '</tr>'; |
186 | 186 | } |
187 | 187 | $s .= '</table>'; |
188 | 188 | } |
189 | 189 | $s .= '</td>'; |
190 | - $s .= '<td>' . \Tracy\Dumper::toHtml($query[self::PARAMS]) . '</td>'; |
|
190 | + $s .= '<td>'.\Tracy\Dumper::toHtml($query[self::PARAMS]).'</td>'; |
|
191 | 191 | $s .= '</tr>'; |
192 | 192 | |
193 | 193 | return $s; |
@@ -215,14 +215,13 @@ discard block |
||
215 | 215 | $s .= $this->processQuery($query); |
216 | 216 | } |
217 | 217 | |
218 | - return empty($this->queries) ? '' : |
|
219 | - $this->renderStyles() . |
|
220 | - '<h1>Queries: ' . count($this->queries) . |
|
221 | - ($this->totalTime ? ', time: ' . sprintf('%0.3f', $this->totalTime * 1000) . ' ms' : '') . |
|
218 | + return empty($this->queries) ? '' : $this->renderStyles(). |
|
219 | + '<h1>Queries: '.count($this->queries). |
|
220 | + ($this->totalTime ? ', time: '.sprintf('%0.3f', $this->totalTime * 1000).' ms' : ''). |
|
222 | 221 | '</h1> |
223 | 222 | <div class="tracy-inner nette-Doctrine2Panel"> |
224 | 223 | <table> |
225 | - <tr><th>Time ms</th><th>SQL</th><th>Params</th></tr>' . $s . ' |
|
224 | + <tr><th>Time ms</th><th>SQL</th><th>Params</th></tr>' . $s.' |
|
226 | 225 | </table> |
227 | 226 | </div>'; |
228 | 227 | } |
@@ -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 | } |