1 | <?php |
||
18 | class PostgreSqlDsn extends BaseDns { |
||
19 | /** @var string */ |
||
20 | protected $user; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $password; |
||
24 | |||
25 | 4 | public function __construct(string $dbName, string $host = 'localhost', int $port = 5432, string $user = null, string $password = null) { |
|
32 | |||
33 | 1 | public function toString() : string { |
|
46 | |||
47 | /** |
||
48 | * @param string|null $user |
||
49 | * @return PostgreSqlDsn |
||
|
|||
50 | */ |
||
51 | 4 | public function setUser(string $user = null) : self { |
|
60 | |||
61 | /** |
||
62 | * @return bool |
||
63 | */ |
||
64 | 1 | public function hasUser() : bool { |
|
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | 1 | public function getUser() : string { |
|
74 | |||
75 | /** |
||
76 | * @param string|null $password |
||
77 | * @return PostgreSqlDsn |
||
78 | */ |
||
79 | 4 | public function setPassword(string $password = null) : self { |
|
88 | |||
89 | /** |
||
90 | * @return bool |
||
91 | */ |
||
92 | 1 | public function hasPassword() : bool { |
|
95 | |||
96 | /** |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | public function getPassword() : string { |
|
102 | } |
||
103 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.