Skip to content

Commit f878591

Browse files
committed
Added size to path method
1 parent bbd0c2e commit f878591

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Utils/Texture.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Microwin7\PHPUtils\Configs\TextureConfig;
77
use function Microwin7\PHPUtils\convertToBytes;
88
use function Microwin7\PHPUtils\ar_slash_string;
9+
use function Microwin7\PHPUtils\str_ends_with_slash;
910
use Microwin7\PHPUtils\Exceptions\TextureSizeException;
1011
use Microwin7\PHPUtils\Exceptions\TextureSizeHDException;
1112
use Microwin7\PHPUtils\Contracts\User\UserStorageTypeEnum;
@@ -78,10 +79,11 @@ public static function TEXTURE_STORAGE_FULL_PATH(ResponseTypeEnum|TextureStorage
7879
return Path::ROOT_FOLDER() . self::TEXTURE_STORAGE_DIR($type);
7980
}
8081
/** FOR PHP ONLY */
81-
public static function PATH(ResponseTypeEnum|TextureStorageTypeEnum $type, string $login, ?string $extension = null): string
82+
public static function PATH(ResponseTypeEnum|TextureStorageTypeEnum $type, string $login, ?string $extension = null, ?int $size = null): string
8283
{
8384
$extension ??= self::EXTENSTION();
84-
return self::TEXTURE_STORAGE_FULL_PATH($type) . $login . $extension;
85+
$size = null === $size ? '' : str_ends_with_slash((string) $size);
86+
return self::TEXTURE_STORAGE_FULL_PATH($type) . $size . $login . $extension;
8587
}
8688
/** @return array<array{w: int, h: int}> */
8789
public static function SIZE(ResponseTypeEnum $type = ResponseTypeEnum::SKIN): array

0 commit comments

Comments
 (0)