Permalink
Browse files

Remove use of Reflection.

  • Loading branch information...
bburnichon committed Jan 9, 2015
1 parent de13e6c commit ce9441ac3f8150a7643ed9815b4c56baee61ee4f
Showing with 7 additions and 4 deletions.
  1. +7 −4 RabbitMq/AMQPConnectionFactory.php
@@ -21,11 +21,14 @@ class AMQPConnectionFactory
'heartbeat' => 0,
);
/**
* Constructor
*
* @param string $class FQCN of AMQPConnection class to instantiate.
* @param array $parameters Map containing parameters resolved by Extension.
*/
public function __construct($class, array $parameters)
{
if (is_string($class)) {
$class = new \ReflectionClass($class);
}
$this->class = $class;
$this->parameters = array_merge($this->parameters, $parameters);
if (is_array($this->parameters['ssl_context'])) {
@@ -37,7 +40,7 @@ public function __construct($class, array $parameters)
public function createConnection()
{
return $this->class->newInstance(
return new $this->class(
$this->parameters['host'],
$this->parameters['port'],
$this->parameters['user'],

0 comments on commit ce9441a

Please sign in to comment.