Skip to content

Commit d3a7402

Browse files
committed
run cs fixer
1 parent fe0be49 commit d3a7402

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/Helpers/Storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function buildPath(string $path): string
4949
{
5050
$trimRules = DIRECTORY_SEPARATOR . ' ';
5151

52-
return rtrim($this->baseDirectory, $trimRules) . DIRECTORY_SEPARATOR . ltrim($path, $trimRules);
52+
return mb_rtrim($this->baseDirectory, $trimRules) . DIRECTORY_SEPARATOR . mb_ltrim($path, $trimRules);
5353
}
5454

5555
/**
@@ -100,7 +100,7 @@ protected function ensurePathUnderBase(string $fullPath): void
100100
throw new InvalidArgumentException('Path must remain inside the storage base directory.');
101101
}
102102

103-
$baseTrimmed = rtrim($this->baseDirectory, DIRECTORY_SEPARATOR . ' ');
103+
$baseTrimmed = mb_rtrim($this->baseDirectory, DIRECTORY_SEPARATOR . ' ');
104104
$baseNorm = $this->normalizePath($baseTrimmed);
105105
$fullNorm = $this->normalizePath($fullPath);
106106
$baseWithSep = $baseNorm . DIRECTORY_SEPARATOR;

src/Helpers/URLHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static function matches(string $pattern, string $value): bool
3131
*/
3232
public static function join(string $baseUrl, string $endpoint, bool $allowBaseUrlOverride = false): string
3333
{
34-
$baseTrimmed = trim($baseUrl, '/ ');
34+
$baseTrimmed = mb_trim($baseUrl, '/ ');
3535
if ($baseTrimmed !== '' && static::isValidUrl($endpoint)) {
3636
if ($allowBaseUrlOverride) {
3737
return $endpoint;
@@ -47,12 +47,12 @@ public static function join(string $baseUrl, string $endpoint, bool $allowBaseUr
4747
}
4848

4949
if ($endpoint !== '/') {
50-
$endpoint = ltrim($endpoint, '/ ');
50+
$endpoint = mb_ltrim($endpoint, '/ ');
5151
}
5252

5353
$requiresTrailingSlash = ! empty($endpoint) && $endpoint !== '/';
5454

55-
$baseEndpoint = rtrim($baseUrl, '/ ');
55+
$baseEndpoint = mb_rtrim($baseUrl, '/ ');
5656

5757
$baseEndpoint = $requiresTrailingSlash ? $baseEndpoint . '/' : $baseEndpoint;
5858

src/Http/Auth/TokenAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public function __construct(
2222
*/
2323
public function set(PendingRequest $pendingRequest): void
2424
{
25-
$pendingRequest->headers()->add('Authorization', trim($this->prefix . ' ' . $this->token));
25+
$pendingRequest->headers()->add('Authorization', mb_trim($this->prefix . ' ' . $this->token));
2626
}
2727
}

src/Traits/OAuth2/AuthorizationCodeGrant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function getAuthorizationUrl(array $scopes = [], ?string $state = null, s
5858
]);
5959

6060
$query = http_build_query($queryParameters, '', '&', PHP_QUERY_RFC3986);
61-
$query = trim($query, '?&');
61+
$query = mb_trim($query, '?&');
6262

6363
$allows = $config->getAllowBaseUrlOverride() || $this->allowBaseUrlOverride;
6464
$url = URLHelper::join($this->resolveBaseUrl(), $config->getAuthorizeEndpoint(), $allows);

tests/Unit/RequestCloneTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5+
use Saloon\Http\Response;
56
use Saloon\Http\Faking\MockClient;
67
use Saloon\Http\Faking\MockResponse;
7-
use Saloon\Http\Response;
8-
use Saloon\Tests\Fixtures\Connectors\TestConnector;
98
use Saloon\Tests\Fixtures\Requests\UserRequest;
9+
use Saloon\Tests\Fixtures\Connectors\TestConnector;
1010

1111
test('cloning a request after query() is initialized gives independent query bags', function () {
1212
$original = new UserRequest;

0 commit comments

Comments
 (0)