Skip to content

Commit d1a32f9

Browse files
committed
formatting'
1 parent a0f6ff6 commit d1a32f9

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/Illuminate/Database/Connection.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ class Connection implements ConnectionInterface
4949
*/
5050
protected $database;
5151

52+
/**
53+
* The type of the connection.
54+
*
55+
* @var string|null
56+
*/
57+
protected $type;
58+
5259
/**
5360
* The table prefix for the connection.
5461
*
@@ -161,13 +168,6 @@ class Connection implements ConnectionInterface
161168
*/
162169
protected static $resolvers = [];
163170

164-
/**
165-
* The type of the connection.
166-
*
167-
* @var string|null
168-
*/
169-
protected $type;
170-
171171
/**
172172
* Create a new database connection instance.
173173
*
@@ -1057,9 +1057,9 @@ public function getName()
10571057
*
10581058
* @return string|null
10591059
*/
1060-
public function getFullName()
1060+
public function getNameWithReadWriteType()
10611061
{
1062-
return $this->getName().($this->type ? '::'.$this->type : '');
1062+
return $this->getName().($this->readWriteType ? '::'.$this->readWriteType : '');
10631063
}
10641064

10651065
/**
@@ -1292,14 +1292,14 @@ public function setDatabaseName($database)
12921292
}
12931293

12941294
/**
1295-
* Set the type of the connection.
1295+
* Set the read / write type of the connection.
12961296
*
1297-
* @param string $type
1297+
* @param string|null $readWriteType
12981298
* @return $this
12991299
*/
1300-
public function setType($type)
1300+
public function setReadWriteType($readWriteType)
13011301
{
1302-
$this->type = $type;
1302+
$this->readWriteType = $readWriteType;
13031303

13041304
return $this;
13051305
}

src/Illuminate/Database/DatabaseManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct($app, ConnectionFactory $factory)
6262
$this->factory = $factory;
6363

6464
$this->reconnector = function ($connection) {
65-
$this->reconnect($connection->getFullName());
65+
$this->reconnect($connection->getNameWithReadWriteType());
6666
};
6767
}
6868

@@ -165,7 +165,7 @@ protected function configuration($name)
165165
*/
166166
protected function configure(Connection $connection, $type)
167167
{
168-
$connection = $this->setPdoForType($connection, $type)->setType($type);
168+
$connection = $this->setPdoForType($connection, $type)->setReadWriteType($type);
169169

170170
// First we'll set the fetch mode and a few other dependencies of the database
171171
// connection. This method basically just configures and prepares it to get
@@ -282,8 +282,8 @@ protected function refreshPdoConnections($name)
282282
);
283283

284284
return $this->connections[$name]
285-
->setPdo($fresh->getRawPdo())
286-
->setReadPdo($fresh->getRawReadPdo());
285+
->setPdo($fresh->getRawPdo())
286+
->setReadPdo($fresh->getRawReadPdo());
287287
}
288288

289289
/**

0 commit comments

Comments
 (0)