diff --git a/src/Commands/AuthenticateCommand.php b/src/Commands/AuthenticateCommand.php index a7edfe8..9283c4c 100644 --- a/src/Commands/AuthenticateCommand.php +++ b/src/Commands/AuthenticateCommand.php @@ -51,8 +51,13 @@ class AuthenticateCommand extends AbstractCommand * @param string $charset * @throws \InvalidArgumentException for invalid/unknown charset name */ - public function __construct($user, $passwd, $dbname, $charset) - { + public function __construct( + $user, + #[\SensitiveParameter] + $passwd, + $dbname, + $charset + ) { if (!isset(self::$charsetMap[$charset])) { throw new \InvalidArgumentException('Unsupported charset selected'); } diff --git a/src/Factory.php b/src/Factory.php index 351ffb6..1ccee7e 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -156,8 +156,10 @@ public function __construct(LoopInterface $loop = null, ConnectorInterface $conn * @param string $uri * @return PromiseInterface Promise */ - public function createConnection($uri) - { + public function createConnection( + #[\SensitiveParameter] + $uri + ) { if (strpos($uri, '://') === false) { $uri = 'mysql://' . $uri; } @@ -374,8 +376,10 @@ public function createConnection($uri) * @param string $uri * @return ConnectionInterface */ - public function createLazyConnection($uri) - { + public function createLazyConnection( + #[\SensitiveParameter] + $uri + ) { return new LazyConnection($this, $uri, $this->loop); } } diff --git a/src/Io/LazyConnection.php b/src/Io/LazyConnection.php index 3fc58cd..b493456 100644 --- a/src/Io/LazyConnection.php +++ b/src/Io/LazyConnection.php @@ -31,8 +31,12 @@ class LazyConnection extends EventEmitter implements ConnectionInterface private $idleTimer; private $pending = 0; - public function __construct(Factory $factory, $uri, LoopInterface $loop) - { + public function __construct( + Factory $factory, + #[\SensitiveParameter] + $uri, + LoopInterface $loop + ) { $args = []; \parse_str((string) \parse_url($uri, \PHP_URL_QUERY), $args); if (isset($args['idle'])) {