Skip to content

Commit 26be9b6

Browse files
committed
Revert "Run PHP-CS-Fixer"
This reverts commit 2471929.
1 parent 2471929 commit 26be9b6

33 files changed

Lines changed: 334 additions & 334 deletions

lib/Core/Provider/Cloudinary/CloudinaryRemoteId.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use function count;
1313
use function explode;
1414
use function implode;
15-
use function mb_ltrim;
15+
use function ltrim;
1616
use function sprintf;
1717
use function str_replace;
1818

@@ -110,7 +110,7 @@ public function move(?Folder $folder): self
110110
private function resolveNewResourceId(?Folder $folder): string
111111
{
112112
$resourceId = $this->getFolder() instanceof Folder
113-
? mb_ltrim(str_replace($this->getFolder()->getPath(), '', $this->resourceId), '/')
113+
? ltrim(str_replace($this->getFolder()->getPath(), '', $this->resourceId), '/')
114114
: $this->resourceId;
115115

116116
if (!$folder instanceof Folder) {

lib/Core/Provider/Cloudinary/Factory/Md5FileHash.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use function explode;
1717
use function mb_strlen;
1818
use function mb_strtolower;
19-
use function mb_trim;
19+
use function trim;
2020

2121
use const CURLINFO_HTTP_CODE;
2222
use const CURLOPT_HEADERFUNCTION;
@@ -49,7 +49,7 @@ static function ($curl, $header) use (&$headers) {
4949
return $len;
5050
}
5151

52-
$headers[mb_strtolower(mb_trim($header[0]))][] = mb_trim($header[1]);
52+
$headers[mb_strtolower(trim($header[0]))][] = trim($header[1]);
5353

5454
return $len;
5555
},
@@ -64,6 +64,6 @@ static function ($curl, $header) use (&$headers) {
6464
return null;
6565
}
6666

67-
return ($headers['etag'][0] ?? null) ? mb_trim($headers['etag'][0], ' "\'\t\n\r\0\v') : null;
67+
return ($headers['etag'][0] ?? null) ? trim($headers['etag'][0], ' "\'\t\n\r\0\v') : null;
6868
}
6969
}

lib/Core/Provider/Cloudinary/Gateway/Cache/Psr6CachedGateway.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
use function array_values;
2222
use function array_walk;
2323
use function implode;
24-
use function mb_trim;
2524
use function str_replace;
25+
use function trim;
2626

2727
final class Psr6CachedGateway implements CacheableGatewayInterface
2828
{
@@ -469,7 +469,7 @@ private function washKey(string $key): string
469469
{
470470
$forbiddenCharacters = ['{', '}', '(', ')', '/', '\\', '@'];
471471
foreach ($forbiddenCharacters as $char) {
472-
$key = str_replace($char, '_', mb_trim($key, $char));
472+
$key = str_replace($char, '_', trim($key, $char));
473473
}
474474

475475
return $key;

tests/bundle/Command/RefreshStoredResourcesCommandTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
use function array_map;
2121
use function array_slice;
22-
use function mb_trim;
22+
use function trim;
2323

2424
use const PHP_EOL;
2525

@@ -109,7 +109,7 @@ public function testExecute(): void
109109
self::assertSame(
110110
'0/1 [>---------------------------] 0%'
111111
. PHP_EOL . ' 1/1 [============================] 100%',
112-
mb_trim($this->commandTester->getDisplay()),
112+
trim($this->commandTester->getDisplay()),
113113
);
114114
}
115115

@@ -166,7 +166,7 @@ public function testExecuteWithoutDelete(): void
166166
'0/1 [>---------------------------] 0%'
167167
. PHP_EOL . ' 1/1 [============================] 100%'
168168
. PHP_EOL . 'There are 1 resources no longer existing on remote. Use --delete to delete them.',
169-
mb_trim($this->commandTester->getDisplay()),
169+
trim($this->commandTester->getDisplay()),
170170
);
171171
}
172172

@@ -225,7 +225,7 @@ public function testExecuteWithDelete(): void
225225
. PHP_EOL . 'Deleting resources that are no longer on remote:'
226226
. PHP_EOL . ' 0/1 [>---------------------------] 0%'
227227
. PHP_EOL . ' 1/1 [============================] 100%',
228-
mb_trim($this->commandTester->getDisplay()),
228+
trim($this->commandTester->getDisplay()),
229229
);
230230
}
231231

@@ -394,7 +394,7 @@ public function testExecuteWithCustomBatchSizeAndDelete(): void
394394
. PHP_EOL . 'Deleting resources that are no longer on remote:'
395395
. PHP_EOL . ' 0/2 [>---------------------------] 0%'
396396
. PHP_EOL . ' 2/2 [============================] 100%',
397-
mb_trim($this->commandTester->getDisplay()),
397+
trim($this->commandTester->getDisplay()),
398398
);
399399
}
400400
}

tests/bundle/Command/ShowApiUsageCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Symfony\Component\Console\Application;
1414
use Symfony\Component\Console\Tester\CommandTester;
1515

16-
use function mb_trim;
16+
use function trim;
1717

1818
use const PHP_EOL;
1919

@@ -62,7 +62,7 @@ public function testExecute(): void
6262
. PHP_EOL . 'Api rate limit: 1000'
6363
. PHP_EOL . 'Resources: 500'
6464
. PHP_EOL . 'Variations: 3000',
65-
mb_trim($this->commandTester->getDisplay()),
65+
trim($this->commandTester->getDisplay()),
6666
);
6767
}
6868
}

tests/bundle/DependencyInjection/ConfigurationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ public function testMissingAccountKeyIsInvalid(): void
152152
);
153153
}
154154

155-
#[DataProvider('provideInvalidNamedObjectsConfigurationCases')]
155+
#[DataProvider('invalidNamedObjectsProvider')]
156156
public function testInvalidNamedObjectsConfiguration(array $configuration): void
157157
{
158158
$this->assertConfigurationIsInvalid($configuration);
159159
}
160160

161-
public static function provideInvalidNamedObjectsConfigurationCases(): iterable
161+
public static function invalidNamedObjectsProvider(): array
162162
{
163163
return [
164164
[

tests/lib/API/Search/QueryTest.php

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#[CoversClass(Query::class)]
1313
final class QueryTest extends TestCase
1414
{
15-
#[DataProvider('provideConstructorCases')]
15+
#[DataProvider('constructorPropsProvider')]
1616
public function testConstructor(
1717
?string $searchQuery,
1818
array $types,
@@ -102,72 +102,7 @@ public function testConstructor(
102102
);
103103
}
104104

105-
public static function provideConstructorCases(): iterable
106-
{
107-
return [
108-
[
109-
'test search',
110-
[],
111-
[],
112-
[],
113-
[],
114-
[],
115-
[],
116-
[],
117-
25,
118-
null,
119-
['created_at' => 'desc'],
120-
'test search|25|||||||||created_at=desc',
121-
],
122-
[
123-
null,
124-
['audio', 'video'],
125-
['root/images', 'root/videos'],
126-
['public', 'private'],
127-
['tag1', 'tag2', 'tag3'],
128-
[],
129-
['hash1', 'hash2', 'hash3'],
130-
[
131-
'type' => ['product_image', 'product_category'],
132-
'source' => 'webshop',
133-
],
134-
30,
135-
null,
136-
['updated_at' => 'asc'],
137-
'|30||audio,video|root/images,root/videos|public,private|tag1,tag2,tag3||hash1,hash2,hash3|type=product_image,type=product_category,source=webshop|updated_at=asc',
138-
],
139-
[
140-
null,
141-
[],
142-
[],
143-
[],
144-
[],
145-
['root/images/image1.jpg', 'root/videos/example.mp4'],
146-
[],
147-
[],
148-
25,
149-
null,
150-
['created_at' => 'desc'],
151-
'|25||||||root/images/image1.jpg,root/videos/example.mp4|||created_at=desc',
152-
],
153-
[
154-
'unix',
155-
['image'],
156-
['root/images'],
157-
['protected'],
158-
['tech'],
159-
[],
160-
[],
161-
[],
162-
25,
163-
'd395jdgew45nd73kjsijfh',
164-
['created_at' => 'asc'],
165-
'unix|25|d395jdgew45nd73kjsijfh|image|root/images|protected|tech||||created_at=asc',
166-
],
167-
];
168-
}
169-
170-
#[DataProvider('provideFromRemoteIdsCases')]
105+
#[DataProvider('remoteIdsProvider')]
171106
public function testFromRemoteIds(
172107
array $remoteIds,
173108
int $limit,
@@ -215,26 +150,6 @@ public function testFromRemoteIds(
215150
);
216151
}
217152

218-
public static function provideFromRemoteIdsCases(): iterable
219-
{
220-
return [
221-
[
222-
['image.jpg', 'test/subfolder/document.pdf', 'videos/example.mp4', 'media/audio/song.mp3'],
223-
100,
224-
null,
225-
['created_at' => 'asc'],
226-
'|100||||||image.jpg,test/subfolder/document.pdf,videos/example.mp4,media/audio/song.mp3|||created_at=asc',
227-
],
228-
[
229-
['image.jpg'],
230-
25,
231-
'ewdsofu439oirejfoi3',
232-
['updated_at' => 'desc'],
233-
'|25|ewdsofu439oirejfoi3|||||image.jpg|||updated_at=desc',
234-
],
235-
];
236-
}
237-
238153
public function testSimpleFromRemoteIds(): void
239154
{
240155
$query = Query::fromRemoteIds(['test/image.jpg']);
@@ -283,4 +198,89 @@ public function testSettingNextCursor(): void
283198
$query->getNextCursor(),
284199
);
285200
}
201+
202+
public static function constructorPropsProvider(): array
203+
{
204+
return [
205+
[
206+
'test search',
207+
[],
208+
[],
209+
[],
210+
[],
211+
[],
212+
[],
213+
[],
214+
25,
215+
null,
216+
['created_at' => 'desc'],
217+
'test search|25|||||||||created_at=desc',
218+
],
219+
[
220+
null,
221+
['audio', 'video'],
222+
['root/images', 'root/videos'],
223+
['public', 'private'],
224+
['tag1', 'tag2', 'tag3'],
225+
[],
226+
['hash1', 'hash2', 'hash3'],
227+
[
228+
'type' => ['product_image', 'product_category'],
229+
'source' => 'webshop',
230+
],
231+
30,
232+
null,
233+
['updated_at' => 'asc'],
234+
'|30||audio,video|root/images,root/videos|public,private|tag1,tag2,tag3||hash1,hash2,hash3|type=product_image,type=product_category,source=webshop|updated_at=asc',
235+
],
236+
[
237+
null,
238+
[],
239+
[],
240+
[],
241+
[],
242+
['root/images/image1.jpg', 'root/videos/example.mp4'],
243+
[],
244+
[],
245+
25,
246+
null,
247+
['created_at' => 'desc'],
248+
'|25||||||root/images/image1.jpg,root/videos/example.mp4|||created_at=desc',
249+
],
250+
[
251+
'unix',
252+
['image'],
253+
['root/images'],
254+
['protected'],
255+
['tech'],
256+
[],
257+
[],
258+
[],
259+
25,
260+
'd395jdgew45nd73kjsijfh',
261+
['created_at' => 'asc'],
262+
'unix|25|d395jdgew45nd73kjsijfh|image|root/images|protected|tech||||created_at=asc',
263+
],
264+
];
265+
}
266+
267+
public static function remoteIdsProvider(): array
268+
{
269+
return [
270+
[
271+
['image.jpg', 'test/subfolder/document.pdf', 'videos/example.mp4', 'media/audio/song.mp3'],
272+
100,
273+
null,
274+
['created_at' => 'asc'],
275+
'|100||||||image.jpg,test/subfolder/document.pdf,videos/example.mp4,media/audio/song.mp3|||created_at=asc',
276+
],
277+
[
278+
['image.jpg'],
279+
25,
280+
'ewdsofu439oirejfoi3',
281+
['updated_at' => 'desc'],
282+
'|25|ewdsofu439oirejfoi3|||||image.jpg|||updated_at=desc',
283+
],
284+
];
285+
}
286286
}

tests/lib/API/Search/ResultTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#[CoversClass(Result::class)]
1414
final class ResultTest extends TestCase
1515
{
16-
#[DataProvider('provideConstructorCases')]
16+
#[DataProvider('dataProvider')]
1717
public function testConstructor(
1818
int $totalCount,
1919
?string $nextCursor,
@@ -37,7 +37,7 @@ public function testConstructor(
3737
);
3838
}
3939

40-
public static function provideConstructorCases(): iterable
40+
public static function dataProvider(): array
4141
{
4242
return [
4343
[0, null, []],

tests/lib/API/Upload/ResourceStructTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testSimpleCreate(): void
5252
self::assertFalse($resourceStruct->doHideFilename());
5353
}
5454

55-
#[DataProvider('provideCreateCases')]
55+
#[DataProvider('dataProvider')]
5656
public function testCreate(
5757
FileStruct $fileStruct,
5858
string $resourceType,
@@ -142,7 +142,7 @@ public function testCreate(
142142
);
143143
}
144144

145-
public static function provideCreateCases(): iterable
145+
public static function dataProvider(): array
146146
{
147147
return [
148148
[

tests/lib/API/Values/FolderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testCreateFromPath(string $name, ?Folder $parent, bool $isRoot,
9191
);
9292
}
9393

94-
public static function dataProvider(): iterable
94+
public static function dataProvider(): array
9595
{
9696
return [
9797
[

0 commit comments

Comments
 (0)