Skip to content

Commit

Permalink
Symfony 5 and doctrine-bundle v2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mijohen authored and debesha committed Apr 11, 2022
1 parent aacc612 commit d3f24b6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DataCollector/HydrationDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(EntityManagerInterface $manager)
$this->hydrationLogger = $manager->getConfiguration()->getHydrationLogger();
}

public function collect(Request $request, Response $response, \Exception $exception = null)
public function collect(Request $request, Response $response, \Throwable $exception = null)
{
$this->data['hydrations'] = $this->hydrationLogger->hydrations;
}
Expand Down
5 changes: 1 addition & 4 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('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.

return $treeBuilder;
return new TreeBuilder('debesha_doctrine_profile_extra');
}
}
4 changes: 2 additions & 2 deletions ORM/LoggingEntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function newHydrator($hydrationMode)
}

/**
* @return LoggingConfiguration
* @return Configuration
*/
public function getConfiguration()
{
Expand Down Expand Up @@ -81,7 +81,7 @@ public static function create($conn, Configuration $config, EventManager $eventM
break;

default:
throw new \InvalidArgumentException('Invalid argument: '.$conn);
throw new \InvalidArgumentException('Invalid argument');
}

return new self($conn, $config, $conn->getEventManager());
Expand Down
3 changes: 2 additions & 1 deletion ORM/LoggingHydratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Debesha\DoctrineProfileExtraBundle\ORM;

use Countable;
use Doctrine\ORM\Internal\Hydration\ArrayHydrator;
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
use Doctrine\ORM\Internal\Hydration\ScalarHydrator;
Expand All @@ -24,7 +25,7 @@ trait LoggingHydratorTrait
/**
* Hydrates all rows returned by the passed statement instance at once.
*
* @param \Doctrine\DBAL\Driver\Statement $stmt
* @param \Doctrine\DBAL\Result $stmt
* @param \Doctrine\ORM\Query\ResultSetMapping $resultSetMapping
* @param array $hints
*
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
}
],
"require": {
"php": ">=5.4",
"php": ">=7.0",
"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",
"doctrine/doctrine-bundle": "^1.2|^2.0",
"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"
},
"require-dev": {
"roave/security-advisories": "dev-latest"
},
"autoload": {
"psr-4": {
"Debesha\\DoctrineProfileExtraBundle\\": "."
Expand Down

0 comments on commit d3f24b6

Please sign in to comment.