Skip to content

Commit ff1c11a

Browse files
committed
Changing array constant to static
1 parent fadf9a9 commit ff1c11a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/DSN.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class DSN
2020
{
21-
const PORTS = [
21+
private static $PORTS = [
2222
'redis' => 6379,
2323
'mongodb' => 27017,
2424
'tcp' => 6379,
@@ -229,7 +229,9 @@ private function parseHosts($hostString)
229229

230230
$hosts = [];
231231
foreach ($matches['host'] as $index => $match) {
232-
$port = !empty($matches['port'][$index]) ? (int) $matches['port'][$index] : self::PORTS[$this->protocol];
232+
$port = !empty($matches['port'][$index])
233+
? (int) $matches['port'][$index]
234+
: self::$PORTS[$this->protocol];
233235
$hosts[] = ['host' => $match, 'port' => $port];
234236
}
235237

0 commit comments

Comments
 (0)