diff --git a/.gitignore b/.gitignore index 3d0b430..98157e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .php_cs.cache +/.idea +/vendor \ No newline at end of file diff --git a/DataCollector/HydrationDataCollector.php b/DataCollector/HydrationDataCollector.php index fa5ddd2..633cd73 100644 --- a/DataCollector/HydrationDataCollector.php +++ b/DataCollector/HydrationDataCollector.php @@ -21,57 +21,58 @@ class HydrationDataCollector extends DataCollector { - /** - * @var HydrationLogger - */ - private $hydrationLogger = []; + /** + * @var HydrationLogger + */ + private $hydrationLogger = []; - public function __construct(EntityManagerInterface $manager) - { - $this->hydrationLogger = $manager->getConfiguration()->getHydrationLogger(); - } + public function __construct(EntityManagerInterface $manager) + { + $this->hydrationLogger = $manager->getConfiguration()->getHydrationLogger(); + } - public function collect(Request $request, Response $response, \Exception $exception = null) - { - $this->data['hydrations'] = $this->hydrationLogger->hydrations; - } + public function collect(Request $request, Response $response, \Throwable $exception = null) + { + $this->data['hydrations'] = $this->hydrationLogger->hydrations; + } - public function getHydrations() - { - return $this->data['hydrations']; - } + public function getHydrations() + { + return $this->data['hydrations']; + } - public function getHydrationsCount() - { - return count($this->data['hydrations']); - } + public function getHydrationsCount() + { + return count($this->data['hydrations']); + } - public function getTime() - { - $time = 0; - foreach ($this->data['hydrations'] as $hydration) { - if (isset($hydration['executionMS'])) { - $time += $hydration['executionMS']; - } - } + public function getTime() + { + $time = 0; + foreach ($this->data['hydrations'] as $hydration) { + if (isset($hydration['executionMS'])) { + $time += $hydration['executionMS']; + } + } - return $time; - } + return $time; + } - /** - * {@inheritdoc} - */ - public function getName() - { - return 'hydrations'; - } + /** + * {@inheritdoc} + */ + public function getName() + { + return 'hydrations'; + } - /** - * {@inheritdoc} - */ - public function reset() - { - $this->data = []; - $this->hydrationLogger->hydrations = 0; - } -} + /** + * {@inheritdoc} + */ + public function reset() + { + $this->data = []; + $this->hydrationLogger->hydrations = []; + $this->hydrationLogger->currentHydration = 0; + } +} \ No newline at end of file diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 9e8b95a..765d553 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -17,12 +17,12 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('debesha_doctrine_profile_extra'); + $treeBuilder = new TreeBuilder('debesha_doctrine_profile_extra'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. +// $rootNode = $treeBuilder->getRootNode(); return $treeBuilder; } diff --git a/composer.json b/composer.json index 04a6e1e..2d0aa96 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "debesha/doctrine-hydration-profiler-bundle", + "name": "janwebdev/doctrine-hydration-profiler-bundle", "type": "symfony-bundle", "description": "Information about hydration of doctrine entities at the profiler", "keywords": [ @@ -19,16 +19,16 @@ } ], "require": { - "php": ">=5.4", - "doctrine/orm": "^2.2", - "doctrine/doctrine-bundle": "^1.2", - "symfony/framework-bundle": "^2.1|^3.0|^4.0", - "symfony/twig-bundle": "^2.0|^3.0|^4.0", - "twig/twig": "^1.12|^2.0" + "php": ">=7.2.5", + "doctrine/orm": "^2.11", + "doctrine/doctrine-bundle": "^2.5", + "symfony/framework-bundle": "^2.1|^3.0|^4.0|^5.0", + "symfony/twig-bundle": "^2.0|^3.0|^4.0|^5.0", + "twig/twig": "^1.12|^2.0|^3.0" }, "autoload": { "psr-4": { "Debesha\\DoctrineProfileExtraBundle\\": "." } } -} \ No newline at end of file +}