@@ -50,7 +50,7 @@ final class DriverConfiguration
50
50
* @param callable():(CacheInterface|null)|CacheInterface|null $cache
51
51
* @param callable():(SemaphoreFactoryInterface|null)|SemaphoreFactoryInterface|null $semaphore
52
52
*
53
- * @psalm-immutable
53
+ * @psalm-external-mutation-free
54
54
*/
55
55
public function __construct (?string $ userAgent , $ httpPsrBindings , SslConfiguration $ sslConfig , ?int $ maxPoolSize , $ cache , ?float $ acquireConnectionTimeout , $ semaphore )
56
56
{
@@ -66,7 +66,7 @@ public function __construct(?string $userAgent, $httpPsrBindings, SslConfigurati
66
66
/**
67
67
* @param pure-callable():(HttpPsrBindings|null)|HttpPsrBindings|null $httpPsrBindings
68
68
*
69
- * @psalm-immutable
69
+ * @pure
70
70
*/
71
71
public static function create (?string $ userAgent , $ httpPsrBindings , SslConfiguration $ sslConfig , int $ maxPoolSize , CacheInterface $ cache , float $ acquireConnectionTimeout , SemaphoreFactoryInterface $ semaphore ): self
72
72
{
@@ -77,13 +77,16 @@ public static function create(?string $userAgent, $httpPsrBindings, SslConfigura
77
77
* Creates a default configuration with a user agent based on the driver version
78
78
* and HTTP PSR implementation auto detected from the environment.
79
79
*
80
- * @psalm-immutable
80
+ * @pure
81
81
*/
82
82
public static function default (): self
83
83
{
84
84
return new self (null , HttpPsrBindings::default (), SslConfiguration::default (), null , null , null , null );
85
85
}
86
86
87
+ /**
88
+ * @psalm-mutation-free
89
+ */
87
90
public function getUserAgent (): string
88
91
{
89
92
if ($ this ->userAgent === null ) {
@@ -94,7 +97,7 @@ public function getUserAgent(): string
94
97
$ version = '2 ' ;
95
98
}
96
99
97
- $ this -> userAgent = sprintf (self ::DEFAULT_USER_AGENT , $ version );
100
+ return sprintf (self ::DEFAULT_USER_AGENT , $ version );
98
101
}
99
102
100
103
return $ this ->userAgent ;
0 commit comments