v7.0.0-beta.2 release
This commit is contained in:
1 parent
6595fd0eb5
commit
fa8eba7a0d
1165 files changed
+107118
-762127
No files matched your search
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Extension\Vendor;
|
||||
|
||||
/**
|
||||
* Vendor 설치 모드.
|
||||
*
|
||||
* - Auto: composer 사용 가능 시 composer, 불가 시 bundled
|
||||
* - Composer: 강제 composer 실행 (불가 시 예외)
|
||||
* - Bundled: 강제 vendor-bundle.zip 추출 (zip 없으면 예외)
|
||||
*/
|
||||
enum VendorMode: string
|
||||
{
|
||||
case Auto = 'auto';
|
||||
case Composer = 'composer';
|
||||
case Bundled = 'bundled';
|
||||
|
||||
/**
|
||||
* 다국어 라벨.
|
||||
*/
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Auto => __('vendor.mode.auto'),
|
||||
self::Composer => __('vendor.mode.composer'),
|
||||
self::Bundled => __('vendor.mode.bundled'),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자열에서 안전하게 변환 (null/auto 폴백).
|
||||
*/
|
||||
public static function fromStringOrAuto(?string $value): self
|
||||
{
|
||||
if ($value === null || $value === '') {
|
||||
return self::Auto;
|
||||
}
|
||||
|
||||
return self::tryFrom($value) ?? self::Auto;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user