@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * @var HydrationLogger |
| 20 | 20 | */ |
| 21 | - private $hydrationLogger = array (); |
|
| 21 | + private $hydrationLogger = array(); |
|
| 22 | 22 | |
| 23 | 23 | public function __construct(HydrationLogger $logger) |
| 24 | 24 | { |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function register(Application $app) |
| 25 | 25 | { |
| 26 | - $app["debesha.doctrine_extra_profiler.logger"] = $app->share(function () use ($app) { |
|
| 26 | + $app["debesha.doctrine_extra_profiler.logger"] = $app->share(function() use ($app) { |
|
| 27 | 27 | return new HydrationLogger($app->offsetGet("orm.em")); |
| 28 | 28 | }); |
| 29 | 29 | $app['debesha.class.hydrationDataCollector'] = 'SilexDoctrineHydrationProfile\Fix\DataCollector'; |
| 30 | - $app["debesha.doctrine_extra_profiler.data_collector"] = $app->share(function () use ($app) { |
|
| 30 | + $app["debesha.doctrine_extra_profiler.data_collector"] = $app->share(function() use ($app) { |
|
| 31 | 31 | $class = $app['debesha.class.hydrationDataCollector']; |
| 32 | 32 | return new $class( |
| 33 | 33 | $app->offsetGet("debesha.doctrine_extra_profiler.logger") |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $config = $app['orm.ems.config'][$name]; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $ems[$name] = $app->share(function () use ($app, $options, $config) { |
|
| 75 | + $ems[$name] = $app->share(function() use ($app, $options, $config) { |
|
| 76 | 76 | /** |
| 77 | 77 | * @var $entityManagerClassName \Doctrine\ORM\EntityManager |
| 78 | 78 | */ |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (!empty($entity['resources_namespace'])) { |
| 133 | - if($app->offsetExists('psr0_resource_locator')) { |
|
| 133 | + if ($app->offsetExists('psr0_resource_locator')) { |
|
| 134 | 134 | $entity['path'] = $app['psr0_resource_locator']->findFirstDirectory($entity['resources_namespace']); |
| 135 | 135 | } else { |
| 136 | 136 | throw new \InvalidArgumentException('Not exist psr0_resource_locator'); |
@@ -141,13 +141,13 @@ discard block |
||
| 141 | 141 | $config->addEntityNamespace($entity['alias'], $entity['namespace']); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if('annotation' === $entity['type']){ |
|
| 144 | + if ('annotation' === $entity['type']) { |
|
| 145 | 145 | $useSimpleAnnotationReader = isset($entity['use_simple_annotation_reader']) |
| 146 | 146 | ? $entity['use_simple_annotation_reader'] |
| 147 | 147 | : true; |
| 148 | - $driver = $config->newDefaultAnnotationDriver((array) $entity['path'], $useSimpleAnnotationReader); |
|
| 148 | + $driver = $config->newDefaultAnnotationDriver((array) $entity['path'], $useSimpleAnnotationReader); |
|
| 149 | 149 | } else { |
| 150 | - $driver = $app['orm.driver.factory']( $entity, $options ); |
|
| 150 | + $driver = $app['orm.driver.factory']($entity, $options); |
|
| 151 | 151 | } |
| 152 | 152 | $chain->addDriver($driver, $entity['namespace']); |
| 153 | 153 | } |
@@ -168,15 +168,15 @@ discard block |
||
| 168 | 168 | }); |
| 169 | 169 | |
| 170 | 170 | |
| 171 | - $app['orm.driver.factory'] = $app->share(function(){ |
|
| 171 | + $app['orm.driver.factory'] = $app->share(function() { |
|
| 172 | 172 | $simpleList = array( |
| 173 | 173 | 'simple_yml', |
| 174 | 174 | 'simple_xml', |
| 175 | 175 | ); |
| 176 | - return function ( $entity, $options ) use ($simpleList) { |
|
| 177 | - if (isset($options[ 'class.driver.' . $entity['type'] ])) { |
|
| 178 | - $className = $options[ 'class.driver.' . $entity['type'] ]; |
|
| 179 | - if( in_array($entity['type'], $simpleList) ) { |
|
| 176 | + return function($entity, $options) use ($simpleList) { |
|
| 177 | + if (isset($options['class.driver.'.$entity['type']])) { |
|
| 178 | + $className = $options['class.driver.'.$entity['type']]; |
|
| 179 | + if (in_array($entity['type'], $simpleList)) { |
|
| 180 | 180 | $param = array($entity['path'] => $entity['namespace']); |
| 181 | 181 | } else { |
| 182 | 182 | $param = $entity['path']; |
@@ -200,10 +200,10 @@ discard block |
||
| 200 | 200 | $templates = $app["data_collector.templates"]; |
| 201 | 201 | $templates[] = array("hydrations", "@DebeshaDoctrineProfileExtraBundle/Collector/hydrations.html.twig"); |
| 202 | 202 | $options = array('is_safe' => array('html')); |
| 203 | - $callable = function ($controller, $attributes = array(), $query = array()) { |
|
| 203 | + $callable = function($controller, $attributes = array(), $query = array()) { |
|
| 204 | 204 | return new ControllerReference($controller, $attributes, $query); |
| 205 | 205 | }; |
| 206 | - $collectors["hydrations"] = $app->share(function ($app) { |
|
| 206 | + $collectors["hydrations"] = $app->share(function($app) { |
|
| 207 | 207 | return $app["debesha.doctrine_extra_profiler.data_collector"]; |
| 208 | 208 | }); |
| 209 | 209 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $app["data_collector.templates"] = $templates; |
| 212 | 212 | |
| 213 | 213 | $app["twig"]->addFunction(new \Twig_SimpleFunction("controller", $callable, $options)); |
| 214 | - $app['twig.loader.filesystem']->addPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "Views", "DebeshaDoctrineProfileExtraBundle"); |
|
| 214 | + $app['twig.loader.filesystem']->addPath(dirname(__FILE__).DIRECTORY_SEPARATOR."Views", "DebeshaDoctrineProfileExtraBundle"); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | } |
| 218 | 218 | \ No newline at end of file |