Skip to content

Commit 5c35d36

Browse files
committed
fixed static analysis
1 parent 38492f3 commit 5c35d36

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/ClientBuilder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ public function build(): ClientInterface
247247
/**
248248
* @deprecated
249249
* @see self::withDefaultDriverConfiguration
250-
*
251-
* @psalm-mutation-free
252250
*/
253251
public function withHttpPsrBindings(HttpPsrBindings $bindings): self
254252
{

src/Databags/DriverConfiguration.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

src/Http/HttpDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static function create($uri, ?DriverConfiguration $configuration = null,
102102
}
103103

104104
/**
105-
* @psalm-mutation-free
105+
* @psalm-external-mutation-free
106106
*/
107107
public function createSession(?SessionConfiguration $config = null): SessionInterface
108108
{

0 commit comments

Comments
 (0)