Skip to content

Commit 4b21aba

Browse files
authored
Add missing getTypeFromMimeMapping method to AssetResolver.php (#55)
* add missing getTypeFromMimeMapping method to AssetResolver.php * add missing getSafeCopyName method to ServiceResolver.php
1 parent dd4eaf0 commit 4b21aba

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/Models/Asset/AssetResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,9 @@ public function getTypes(): array
5252
{
5353
return Asset::getTypes();
5454
}
55+
56+
public function getTypeFromMimeMapping(string $mimeType, string $filename): string
57+
{
58+
return Asset::getTypeFromMimeMapping($mimeType, $filename);
59+
}
5560
}

src/Models/Asset/AssetResolverInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public function create(int $parentId, array $data = [], bool $save = true): Asse
3030
public function getList(array $config = []): Listing;
3131

3232
public function getTypes(): array;
33+
34+
public function getTypeFromMimeMapping(string $mimeType, string $filename): string;
3335
}

src/Models/Element/ServiceResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,9 @@ public function getValidKey(string $key, string $type): string
5454
{
5555
return Service::getValidKey($key, $type);
5656
}
57+
58+
public function getSafeCopyName(string $sourceKey, ElementInterface $target): string
59+
{
60+
return Service::getSafeCopyName($sourceKey, $target);
61+
}
5762
}

src/Models/Element/ServiceResolverInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ public function findForbiddenPaths(string $type, User $user): array;
4343
public function isPublished(ElementInterface $element = null): bool;
4444

4545
public function getValidKey(string $key, string $type): string;
46+
47+
public function getSafeCopyName(string $sourceKey, ElementInterface $target): string;
4648
}

0 commit comments

Comments
 (0)