Skip to content

Commit 9abd547

Browse files
committed
Added mutation free where needed
1 parent 63d9a10 commit 9abd547

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

src/Authentication/Authenticate.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,33 @@
1515

1616
final class Authenticate
1717
{
18+
/**
19+
* @psalm-mutation-free
20+
*/
1821
public static function basic(string $username, string $password): BasicAuth
1922
{
2023
return new BasicAuth($username, $password);
2124
}
2225

26+
/**
27+
* @psalm-mutation-free
28+
*/
2329
public static function kerberos(string $token): KerberosAuth
2430
{
2531
return new KerberosAuth($token);
2632
}
2733

34+
/**
35+
* @psalm-mutation-free
36+
*/
2837
public static function disabled(): NoAuth
2938
{
3039
return new NoAuth();
3140
}
3241

42+
/**
43+
* @psalm-mutation-free
44+
*/
3345
public static function fromUrl(): UrlAuth
3446
{
3547
return new UrlAuth();

src/Common/Uri.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
use function sprintf;
2121
use function strtolower;
2222

23+
/**
24+
* @psalm-immutable
25+
*/
2326
final class Uri implements UriInterface
2427
{
2528
private string $scheme;
@@ -48,6 +51,9 @@ public function __construct(
4851
$this->fragment = $fragment;
4952
}
5053

54+
/**
55+
* @psalm-mutation-free
56+
*/
5157
public static function create(string $uri = ''): self
5258
{
5359
$parsedUrl = parse_url($uri);
@@ -261,6 +267,9 @@ public function withFragment($fragment)
261267
);
262268
}
263269

270+
/**
271+
* @psalm-mutation-free
272+
*/
264273
private static function filterPort(?int $port): ?int
265274
{
266275
if ($port === null) {

src/Databags/DriverConfiguration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public static function create($userAgent, $httpPsrBindings): self
4444
return new self($userAgent, $httpPsrBindings);
4545
}
4646

47+
/**
48+
* @psalm-mutation-free
49+
*/
4750
public static function default(): self
4851
{
4952
return new self(

src/Databags/HttpPsrBindings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public static function create($client = null, $streamFactory = null, $requestFac
6060
return new self($client, $streamFactory, $requestFactory);
6161
}
6262

63+
/**
64+
* @psalm-mutation-free
65+
*/
6366
public static function default(): self
6467
{
6568
return new self();

src/Formatter/OGMFormatter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public function __construct(BoltOGMTranslator $boltTranslator, HttpOGMTranslator
5656
$this->httpTranslator = $httpTranslator;
5757
}
5858

59+
/**
60+
* @psalm-mutation-free
61+
*/
5962
public static function create(): OGMFormatter
6063
{
6164
return new self(

0 commit comments

Comments
 (0)