File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/laravel/framework/src/Illuminate/Support
Upload
[..]
AggregateServiceProvider.php (1.08 KB)
Edit
Rename
Del
Benchmark.php (2.05 KB)
Edit
Rename
Del
BinaryCodec.php (2.9 KB)
Edit
Rename
Del
Carbon.php (2.11 KB)
Edit
Rename
Del
Composer.php (6.84 KB)
Edit
Rename
Del
ConfigurationUrlParser.php (4.42 KB)
Edit
Rename
Del
DateFactory.php (10.47 KB)
Edit
Rename
Del
DefaultProviders.php (3.26 KB)
Edit
Rename
Del
Defer/
Rename
Del
Env.php (8.34 KB)
Edit
Rename
Del
Exceptions/
Rename
Del
Facades/
Rename
Del
Fluent.php (7.47 KB)
Edit
Rename
Del
HigherOrderTapProxy.php (645 B)
Edit
Rename
Del
HtmlString.php (1.05 KB)
Edit
Rename
Del
InteractsWithTime.php (2.03 KB)
Edit
Rename
Del
Js.php (3.86 KB)
Edit
Rename
Del
LICENSE.md (1.05 KB)
Edit
Rename
Del
Lottery.php (6.05 KB)
Edit
Rename
Del
Manager.php (4.79 KB)
Edit
Rename
Del
MessageBag.php (10.55 KB)
Edit
Rename
Del
MultipleInstanceManager.php (5.52 KB)
Edit
Rename
Del
NamespacedItemResolver.php (3.33 KB)
Edit
Rename
Del
Number.php (12.93 KB)
Edit
Rename
Del
Once.php (1.86 KB)
Edit
Rename
Del
Onceable.php (2.49 KB)
Edit
Rename
Del
Optional.php (2.65 KB)
Edit
Rename
Del
Pluralizer.php (2.84 KB)
Edit
Rename
Del
ProcessUtils.php (2 KB)
Edit
Rename
Del
Queue/
Rename
Del
RebindsCallbacksToSelf.php (860 B)
Edit
Rename
Del
ServiceProvider.php (16.76 KB)
Edit
Rename
Del
Sleep.php (12.14 KB)
Edit
Rename
Del
Str.php (64.62 KB)
Edit
Rename
Del
Stringable.php (38.62 KB)
Edit
Rename
Del
Testing/
Rename
Del
Timebox.php (1.66 KB)
Edit
Rename
Del
Traits/
Rename
Del
Uri.php (11.56 KB)
Edit
Rename
Del
ValidatedInput.php (4.62 KB)
Edit
Rename
Del
ViewErrorBag.php (2.69 KB)
Edit
Rename
Del
composer.json (2.08 KB)
Edit
Rename
Del
functions.php (4.14 KB)
Edit
Rename
Del
helpers.php (13.35 KB)
Edit
Rename
Del
Edit: BinaryCodec.php
<?php namespace Illuminate\Support; use InvalidArgumentException; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; use Symfony\Component\Uid\Ulid; class BinaryCodec { /** @var array<string, array{encode: callable(UuidInterface|Ulid|string|null): ?string, decode: callable(?string): ?string}> */ protected static array $customCodecs = []; /** * Register a custom codec. */ public static function register(string $name, callable $encode, callable $decode): void { self::$customCodecs[$name] = [ 'encode' => $encode, 'decode' => $decode, ]; } /** * Encode a value to binary. * * @throws \InvalidArgumentException */ public static function encode(UuidInterface|Ulid|string|null $value, string $format): ?string { if (blank($value)) { return null; } if (isset(self::$customCodecs[$format])) { return (self::$customCodecs[$format]['encode'])($value); } return match ($format) { 'uuid' => match (true) { $value instanceof UuidInterface => $value->getBytes(), self::isBinary($value) => $value, default => Uuid::fromString($value)->getBytes(), }, 'ulid' => match (true) { $value instanceof Ulid => $value->toBinary(), self::isBinary($value) => $value, default => Ulid::fromString($value)->toBinary(), }, default => throw new InvalidArgumentException("Format [$format] is invalid."), }; } /** * Decode a binary value to string. * * @throws \InvalidArgumentException */ public static function decode(?string $value, string $format): ?string { if (blank($value)) { return null; } if (isset(self::$customCodecs[$format])) { return (self::$customCodecs[$format]['decode'])($value); } return match ($format) { 'uuid' => (self::isBinary($value) ? Uuid::fromBytes($value) : Uuid::fromString($value))->toString(), 'ulid' => (self::isBinary($value) ? Ulid::fromBinary($value) : Ulid::fromString($value))->toString(), default => throw new InvalidArgumentException("Format [$format] is invalid."), }; } /** * Get all available format names. * * @return array<string> */ public static function formats(): array { return array_unique([...['uuid', 'ulid'], ...array_keys(self::$customCodecs)]); } /** * Determine if the given value is binary data. */ public static function isBinary(mixed $value): bool { if (! is_string($value) || $value === '') { return false; } if (str_contains($value, "\0")) { return true; } return ! mb_check_encoding($value, 'UTF-8'); } }
Simpan