Skip to content

Commit ab9256f

Browse files
committed
Reconfigure PHP CS Fixer and run
1 parent 26be9b6 commit ab9256f

29 files changed

Lines changed: 292 additions & 291 deletions

.php-cs-fixer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
'import_functions' => true,
3838
],
3939
'heredoc_indentation' => ['indentation' => 'same_as_start'],
40-
'mb_str_functions' => true,
40+
//'mb_str_functions' => true,
4141
'native_constant_invocation' => true,
4242
'nullable_type_declaration_for_default_null_value' => true,
4343
'static_lambda' => true,
4444
'ternary_to_null_coalescing' => true,
4545
'use_arrow_functions' => true,
46+
'php_unit_data_provider_name' => false,
4647
])
4748
->setFinder(
4849
PhpCsFixer\Finder::create()

tests/bundle/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function testInvalidNamedObjectsConfiguration(array $configuration): void
158158
$this->assertConfigurationIsInvalid($configuration);
159159
}
160160

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

tests/lib/API/Search/QueryTest.php

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,71 @@ public function testConstructor(
102102
);
103103
}
104104

105+
public static function constructorPropsProvider(): 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+
105170
#[DataProvider('remoteIdsProvider')]
106171
public function testFromRemoteIds(
107172
array $remoteIds,
@@ -150,6 +215,26 @@ public function testFromRemoteIds(
150215
);
151216
}
152217

218+
public static function remoteIdsProvider(): 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+
153238
public function testSimpleFromRemoteIds(): void
154239
{
155240
$query = Query::fromRemoteIds(['test/image.jpg']);
@@ -198,89 +283,4 @@ public function testSettingNextCursor(): void
198283
$query->getNextCursor(),
199284
);
200285
}
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testConstructor(
3737
);
3838
}
3939

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

tests/lib/API/Upload/ResourceStructTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function testCreate(
142142
);
143143
}
144144

145-
public static function dataProvider(): array
145+
public static function dataProvider(): iterable
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(): array
94+
public static function dataProvider(): iterable
9595
{
9696
return [
9797
[

tests/lib/Core/Provider/Cloudinary/Converter/ResourceTypeTest.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,7 @@ public function testFromCloudinaryData(string $type, ?string $format, string $ex
2929
);
3030
}
3131

32-
#[DataProvider('toCloudinaryTypeProvider')]
33-
public function testToCloudinaryType(string $type, string $expectedType): void
34-
{
35-
self::assertSame(
36-
$expectedType,
37-
$this->converter->toCloudinaryType($type),
38-
);
39-
}
40-
41-
public function testGetAudioFormats(): void
42-
{
43-
self::assertSame(
44-
['aac', 'aiff', 'amr', 'flac', 'm4a', 'mp3', 'ogg', 'opus', 'wav'],
45-
$this->converter->getAudioFormats(),
46-
);
47-
}
48-
49-
public function testGetDocumentFormats(): void
50-
{
51-
self::assertSame(
52-
['pdf', 'doc', 'docx', 'ppt', 'pptx', 'txt'],
53-
$this->converter->getDocumentFormats(),
54-
);
55-
}
56-
57-
public static function fromCloudinaryDataProvider(): array
32+
public static function fromCloudinaryDataProvider(): iterable
5833
{
5934
return [
6035
['image', null, RemoteResource::TYPE_IMAGE],
@@ -76,7 +51,16 @@ public static function fromCloudinaryDataProvider(): array
7651
];
7752
}
7853

79-
public static function toCloudinaryTypeProvider(): array
54+
#[DataProvider('toCloudinaryTypeProvider')]
55+
public function testToCloudinaryType(string $type, string $expectedType): void
56+
{
57+
self::assertSame(
58+
$expectedType,
59+
$this->converter->toCloudinaryType($type),
60+
);
61+
}
62+
63+
public static function toCloudinaryTypeProvider(): iterable
8064
{
8165
return [
8266
[RemoteResource::TYPE_IMAGE, 'image'],
@@ -86,4 +70,20 @@ public static function toCloudinaryTypeProvider(): array
8670
[RemoteResource::TYPE_OTHER, 'raw'],
8771
];
8872
}
73+
74+
public function testGetAudioFormats(): void
75+
{
76+
self::assertSame(
77+
['aac', 'aiff', 'amr', 'flac', 'm4a', 'mp3', 'ogg', 'opus', 'wav'],
78+
$this->converter->getAudioFormats(),
79+
);
80+
}
81+
82+
public function testGetDocumentFormats(): void
83+
{
84+
self::assertSame(
85+
['pdf', 'doc', 'docx', 'ppt', 'pptx', 'txt'],
86+
$this->converter->getDocumentFormats(),
87+
);
88+
}
8989
}

tests/lib/Core/Provider/Cloudinary/Converter/VisibilityTypeTest.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ public function testFromCloudinaryType(string $type, string $expectedFormat): vo
2929
);
3030
}
3131

32+
public static function fromCloudinaryTypeProvider(): iterable
33+
{
34+
return [
35+
['upload', RemoteResource::VISIBILITY_PUBLIC],
36+
['authenticated', RemoteResource::VISIBILITY_PROTECTED],
37+
];
38+
}
39+
3240
#[DataProvider('toCloudinaryTypeProvider')]
3341
public function testToCloudinaryType(string $visibility, string $expectedType): void
3442
{
@@ -38,6 +46,14 @@ public function testToCloudinaryType(string $visibility, string $expectedType):
3846
);
3947
}
4048

49+
public static function toCloudinaryTypeProvider(): iterable
50+
{
51+
return [
52+
[RemoteResource::VISIBILITY_PUBLIC, 'upload'],
53+
[RemoteResource::VISIBILITY_PROTECTED, 'authenticated'],
54+
];
55+
}
56+
4157
#[DataProvider('toCloudinaryAccessModeProvider')]
4258
public function testToCloudinaryAccessMode(string $visibility, string $expectedMode): void
4359
{
@@ -47,40 +63,24 @@ public function testToCloudinaryAccessMode(string $visibility, string $expectedM
4763
);
4864
}
4965

50-
#[DataProvider('toCloudinaryAccessControlProvider')]
51-
public function testToCloudinaryAccessControl(string $visibility, array $expectedSettings): void
52-
{
53-
self::assertSame(
54-
$expectedSettings,
55-
$this->converter->toCloudinaryAccessControl($visibility),
56-
);
57-
}
58-
59-
public static function fromCloudinaryTypeProvider(): array
66+
public static function toCloudinaryAccessModeProvider(): iterable
6067
{
6168
return [
62-
['upload', RemoteResource::VISIBILITY_PUBLIC],
63-
['authenticated', RemoteResource::VISIBILITY_PROTECTED],
64-
];
65-
}
66-
67-
public static function toCloudinaryTypeProvider(): array
68-
{
69-
return [
70-
[RemoteResource::VISIBILITY_PUBLIC, 'upload'],
69+
[RemoteResource::VISIBILITY_PUBLIC, 'public'],
7170
[RemoteResource::VISIBILITY_PROTECTED, 'authenticated'],
7271
];
7372
}
7473

75-
public static function toCloudinaryAccessModeProvider(): array
74+
#[DataProvider('toCloudinaryAccessControlProvider')]
75+
public function testToCloudinaryAccessControl(string $visibility, array $expectedSettings): void
7676
{
77-
return [
78-
[RemoteResource::VISIBILITY_PUBLIC, 'public'],
79-
[RemoteResource::VISIBILITY_PROTECTED, 'authenticated'],
80-
];
77+
self::assertSame(
78+
$expectedSettings,
79+
$this->converter->toCloudinaryAccessControl($visibility),
80+
);
8181
}
8282

83-
public static function toCloudinaryAccessControlProvider(): array
83+
public static function toCloudinaryAccessControlProvider(): iterable
8484
{
8585
return [
8686
[RemoteResource::VISIBILITY_PUBLIC, [['access_type' => 'anonymous']]],

0 commit comments

Comments
 (0)