Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Symphony 4.3 Dependency Fix for Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch() #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias =
$connection = $this->connectionManager->getConnection($connectionAlias);
$params = null !== $parameters ? $parameters : [];
$statement = Statement::create($query, $params, $tag);
$this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent([$statement]));
$this->eventDispatcher->dispatch(new PreRunEvent([$statement]), Neo4jClientEvents::NEO4J_PRE_RUN);

try {
$result = $connection->run($query, $parameters, $tag);
$this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result)));
$this->eventDispatcher->dispatch(new PostRunEvent(ResultCollection::withResult($result)), Neo4jClientEvents::NEO4J_POST_RUN);
} catch (Neo4jException $e) {
$event = new FailureEvent($e);
$this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, $event);
$this->eventDispatcher->dispatch($event, Neo4jClientEvents::NEO4J_ON_FAILURE);

if ($event->shouldThrowException()) {
throw $e;
Expand Down
6 changes: 3 additions & 3 deletions src/Transaction/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ public function run($statement, array $parameters = [], $tag = null)
$this->driverTransaction->begin();
}
$stmt = Statement::create($statement, $parameters, $tag);
$this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent([$stmt]));
$this->eventDispatcher->dispatch(new PreRunEvent([$stmt]), Neo4jClientEvents::NEO4J_PRE_RUN);
try {
$result = $this->driverTransaction->run(Statement::create($statement, $parameters, $tag));
$this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result)));
$this->eventDispatcher->dispatch(new PostRunEvent(ResultCollection::withResult($result)), Neo4jClientEvents::NEO4J_POST_RUN);
} catch (MessageFailureException $e) {
$exception = new Neo4jException($e->getMessage());
$exception->setNeo4jStatusCode($e->getStatusCode());

$event = new FailureEvent($exception);
$this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, $event);
$this->eventDispatcher->dispatch($event, Neo4jClientEvents::NEO4J_ON_FAILURE);
if ($event->shouldThrowException()) {
throw $exception;
}
Expand Down