forked from doctrine/doctrine1
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add(typehint) Add typehint to methods and return types
- Loading branch information
Showing
4 changed files
with
40 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,8 @@ | |
* @version $Revision$ | ||
* @author Konsta Vesterinen <[email protected]> | ||
* @author Lukas Smith <[email protected]> (MDB2 library) | ||
* | ||
* @property Doctrine_Export $export | ||
*/ | ||
abstract class Doctrine_Connection extends Doctrine_Configurable implements Countable, IteratorAggregate, Serializable | ||
{ | ||
|
@@ -241,41 +243,31 @@ public function isConnected() | |
} | ||
|
||
/** | ||
* getOptions | ||
* | ||
* Get array of all options | ||
* | ||
* @return void | ||
* @return array<string, mixed> | ||
*/ | ||
public function getOptions() | ||
{ | ||
return $this->options; | ||
} | ||
|
||
/** | ||
* getOption | ||
* | ||
* Retrieves option | ||
* | ||
* @param string $option | ||
* @return void | ||
* @return null|mixed | ||
*/ | ||
public function getOption($option) | ||
public function getOption(string $option) | ||
{ | ||
if (isset($this->options[$option])) { | ||
return $this->options[$option]; | ||
} | ||
} | ||
|
||
/** | ||
* setOption | ||
* | ||
* Set option value | ||
* | ||
* @param string $option | ||
* @return void | ||
* @return mixed | ||
*/ | ||
public function setOption($option, $value) | ||
public function setOption(string $option, $value) | ||
{ | ||
return $this->options[$option] = $value; | ||
} | ||
|
@@ -1545,8 +1537,8 @@ public function dropDatabase() | |
* which is always guaranteed to exist. Mysql: 'mysql', PostgreSQL: 'postgres', etc. | ||
* This value is set in the Doctrine_Export_{DRIVER} classes if required | ||
* | ||
* @param string $info | ||
* @return void | ||
* @param array $info | ||
* @return Doctrine_Connection | ||
*/ | ||
public function getTmpConnection($info) | ||
{ | ||
|
@@ -1569,7 +1561,7 @@ public function getTmpConnection($info) | |
$username = $this->getOption('username'); | ||
$password = $this->getOption('password'); | ||
|
||
$conn = $this->getManager()->openConnection(array($pdoDsn, $username, $password), 'doctrine_tmp_connection', false); | ||
$conn = $this->getManager()->openConnection([$pdoDsn, $username, $password], 'doctrine_tmp_connection', false); | ||
$conn->setOption('username', $username); | ||
$conn->setOption('password', $password); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters