@@ -50,7 +50,7 @@ final class DriverConfiguration
5050 * @param callable():(CacheInterface|null)|CacheInterface|null $cache
5151 * @param callable():(SemaphoreFactoryInterface|null)|SemaphoreFactoryInterface|null $semaphore
5252 *
53- * @psalm-immutable
53+ * @psalm-external-mutation-free
5454 */
5555 public function __construct (?string $ userAgent , $ httpPsrBindings , SslConfiguration $ sslConfig , ?int $ maxPoolSize , $ cache , ?float $ acquireConnectionTimeout , $ semaphore )
5656 {
@@ -66,7 +66,7 @@ public function __construct(?string $userAgent, $httpPsrBindings, SslConfigurati
6666 /**
6767 * @param pure-callable():(HttpPsrBindings|null)|HttpPsrBindings|null $httpPsrBindings
6868 *
69- * @psalm-immutable
69+ * @pure
7070 */
7171 public static function create (?string $ userAgent , $ httpPsrBindings , SslConfiguration $ sslConfig , int $ maxPoolSize , CacheInterface $ cache , float $ acquireConnectionTimeout , SemaphoreFactoryInterface $ semaphore ): self
7272 {
@@ -77,13 +77,16 @@ public static function create(?string $userAgent, $httpPsrBindings, SslConfigura
7777 * Creates a default configuration with a user agent based on the driver version
7878 * and HTTP PSR implementation auto detected from the environment.
7979 *
80- * @psalm-immutable
80+ * @pure
8181 */
8282 public static function default (): self
8383 {
8484 return new self (null , HttpPsrBindings::default (), SslConfiguration::default (), null , null , null , null );
8585 }
8686
87+ /**
88+ * @psalm-mutation-free
89+ */
8790 public function getUserAgent (): string
8891 {
8992 if ($ this ->userAgent === null ) {
@@ -94,7 +97,7 @@ public function getUserAgent(): string
9497 $ version = '2 ' ;
9598 }
9699
97- $ this -> userAgent = sprintf (self ::DEFAULT_USER_AGENT , $ version );
100+ return sprintf (self ::DEFAULT_USER_AGENT , $ version );
98101 }
99102
100103 return $ this ->userAgent ;
0 commit comments