diff --git a/src/Connection/Aggregate/MasterSlaveReplication.php b/src/Connection/Aggregate/MasterSlaveReplication.php index 84ace894..ca99aa8e 100644 --- a/src/Connection/Aggregate/MasterSlaveReplication.php +++ b/src/Connection/Aggregate/MasterSlaveReplication.php @@ -158,6 +158,7 @@ class MasterSlaveReplication implements ReplicationInterface if (!$connection instanceof NodeConnectionInterface) { $connection = $this->getConnectionById($connection); } + if ($connection !== $this->master && !in_array($connection, $this->slaves, true)) { throw new \InvalidArgumentException('Invalid connection or connection not found.'); }