mirror of
https://github.com/itflow-org/itflow
synced 2026-08-20 14:35:12 +00:00
Allow PHP-8.2 and up Compatibility instead of just PHP-8.4
This commit is contained in:
@@ -7,14 +7,14 @@ class AggregateServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* The provider class names.
|
||||
*
|
||||
* @var array
|
||||
* @var array<int, class-string<\Illuminate\Support\ServiceProvider>>
|
||||
*/
|
||||
protected $providers = [];
|
||||
|
||||
/**
|
||||
* An array of the service provider instances.
|
||||
*
|
||||
* @var array
|
||||
* @var array<int, \Illuminate\Support\ServiceProvider>
|
||||
*/
|
||||
protected $instances = [];
|
||||
|
||||
@@ -35,7 +35,7 @@ class AggregateServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
namespace Illuminate\Support;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
|
||||
class Benchmark
|
||||
{
|
||||
use Macroable;
|
||||
|
||||
/**
|
||||
* Measure a callable or array of callables over the given number of iterations.
|
||||
*
|
||||
|
||||
99
plugins/vendor/illuminate/support/BinaryCodec.php
vendored
Normal file
99
plugins/vendor/illuminate/support/BinaryCodec.php
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
<?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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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 list<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');
|
||||
}
|
||||
}
|
||||
38
plugins/vendor/illuminate/support/Carbon.php
vendored
38
plugins/vendor/illuminate/support/Carbon.php
vendored
@@ -33,4 +33,42 @@ class Carbon extends BaseCarbon
|
||||
|
||||
return static::createFromInterface($id->getDateTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current date / time plus a given amount of time.
|
||||
*/
|
||||
public function plus(
|
||||
int $years = 0,
|
||||
int $months = 0,
|
||||
int $weeks = 0,
|
||||
int $days = 0,
|
||||
int $hours = 0,
|
||||
int $minutes = 0,
|
||||
int $seconds = 0,
|
||||
int $microseconds = 0
|
||||
): static {
|
||||
return $this->add("
|
||||
$years years $months months $weeks weeks $days days
|
||||
$hours hours $minutes minutes $seconds seconds $microseconds microseconds
|
||||
");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current date / time minus a given amount of time.
|
||||
*/
|
||||
public function minus(
|
||||
int $years = 0,
|
||||
int $months = 0,
|
||||
int $weeks = 0,
|
||||
int $days = 0,
|
||||
int $hours = 0,
|
||||
int $minutes = 0,
|
||||
int $seconds = 0,
|
||||
int $microseconds = 0
|
||||
): static {
|
||||
return $this->sub("
|
||||
$years years $months months $weeks weeks $days days
|
||||
$hours hours $minutes minutes $seconds seconds $microseconds microseconds
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
13
plugins/vendor/illuminate/support/Env.php
vendored
13
plugins/vendor/illuminate/support/Env.php
vendored
@@ -5,7 +5,6 @@ namespace Illuminate\Support;
|
||||
use Closure;
|
||||
use Dotenv\Repository\Adapter\PutenvAdapter;
|
||||
use Dotenv\Repository\RepositoryBuilder;
|
||||
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use PhpOption\Option;
|
||||
use RuntimeException;
|
||||
@@ -126,8 +125,8 @@ class Env
|
||||
* @param bool $overwrite
|
||||
* @return void
|
||||
*
|
||||
* @throws RuntimeException
|
||||
* @throws FileNotFoundException
|
||||
* @throws \RuntimeException
|
||||
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
|
||||
*/
|
||||
public static function writeVariables(array $variables, string $pathToFile, bool $overwrite = false): void
|
||||
{
|
||||
@@ -155,8 +154,8 @@ class Env
|
||||
* @param bool $overwrite
|
||||
* @return void
|
||||
*
|
||||
* @throws RuntimeException
|
||||
* @throws FileNotFoundException
|
||||
* @throws \RuntimeException
|
||||
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
|
||||
*/
|
||||
public static function writeVariable(string $key, mixed $value, string $pathToFile, bool $overwrite = false): void
|
||||
{
|
||||
@@ -188,7 +187,7 @@ class Env
|
||||
$prefix = explode('_', $key)[0].'_';
|
||||
$lastPrefixIndex = -1;
|
||||
|
||||
$shouldQuote = preg_match('/^[a-zA-z0-9]+$/', $value) === 0;
|
||||
$shouldQuote = preg_match('/^[a-zA-Z0-9]+$/', $value) === 0;
|
||||
|
||||
$lineToAddVariations = [
|
||||
$key.'='.(is_string($value) ? self::prepareQuotedValue($value) : $value),
|
||||
@@ -285,7 +284,7 @@ class Env
|
||||
*/
|
||||
protected static function prepareQuotedValue(string $input)
|
||||
{
|
||||
return strpos($input, '"') !== false
|
||||
return str_contains($input, '"')
|
||||
? "'".self::addSlashesExceptFor($input, ['"'])."'"
|
||||
: '"'.self::addSlashesExceptFor($input, ["'"]).'"';
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ use RuntimeException;
|
||||
* @method static \Symfony\Component\HttpFoundation\Response|null basic(string $field = 'email', array $extraConditions = [])
|
||||
* @method static \Symfony\Component\HttpFoundation\Response|null onceBasic(string $field = 'email', array $extraConditions = [])
|
||||
* @method static bool attemptWhen(array $credentials = [], array|callable|null $callbacks = null, bool $remember = false)
|
||||
* @method static string hashPasswordForCookie(string $passwordHash)
|
||||
* @method static void logoutCurrentDevice()
|
||||
* @method static \Illuminate\Contracts\Auth\Authenticatable|null logoutOtherDevices(string $password)
|
||||
* @method static void attempting(mixed $callback)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static void include(string $path, string|null $alias = null)
|
||||
* @method static void aliasInclude(string $path, string|null $alias = null)
|
||||
* @method static void bindDirective(string $name, callable $handler)
|
||||
* @method static void directive(string $name, callable $handler, bool $bind = false)
|
||||
* @method static void directive(string $name, \Closure|callable $handler, bool $bind = false)
|
||||
* @method static array getCustomDirectives()
|
||||
* @method static \Illuminate\View\Compilers\BladeCompiler prepareStringsForCompilationUsing(callable $callback)
|
||||
* @method static void precompiler(callable $precompiler)
|
||||
|
||||
@@ -24,7 +24,7 @@ use Illuminate\Support\Testing\Fakes\BusFake;
|
||||
* @method static \Illuminate\Bus\Dispatcher withoutDispatchingAfterResponses()
|
||||
* @method static \Illuminate\Support\Testing\Fakes\BusFake except(array|string $jobsToDispatch)
|
||||
* @method static void assertDispatched(string|\Closure $command, callable|int|null $callback = null)
|
||||
* @method static void assertDispatchedOnce(string|\Closure $command, int $times = null)
|
||||
* @method static void assertDispatchedOnce(string|\Closure $command)
|
||||
* @method static void assertDispatchedTimes(string|\Closure $command, int $times = 1)
|
||||
* @method static void assertNotDispatched(string|\Closure $command, callable|null $callback = null)
|
||||
* @method static void assertNothingDispatched()
|
||||
@@ -38,7 +38,7 @@ use Illuminate\Support\Testing\Fakes\BusFake;
|
||||
* @method static void assertNothingChained()
|
||||
* @method static void assertDispatchedWithoutChain(string|\Closure $command, callable|null $callback = null)
|
||||
* @method static \Illuminate\Support\Testing\Fakes\ChainedBatchTruthTest chainedBatch(\Closure $callback)
|
||||
* @method static void assertBatched(callable $callback)
|
||||
* @method static void assertBatched(array|callable $callback)
|
||||
* @method static void assertBatchCount(int $count)
|
||||
* @method static void assertNothingBatched()
|
||||
* @method static void assertNothingPlaced()
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Illuminate\Support\Facades;
|
||||
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @method static \Illuminate\Contracts\Cache\Repository store(string|null $name = null)
|
||||
* @method static \Illuminate\Contracts\Cache\Repository driver(string|null $driver = null)
|
||||
@@ -16,26 +18,33 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static void purge(string|null $name = null)
|
||||
* @method static \Illuminate\Cache\CacheManager extend(string $driver, \Closure $callback)
|
||||
* @method static \Illuminate\Cache\CacheManager setApplication(\Illuminate\Contracts\Foundation\Application $app)
|
||||
* @method static bool has(array|string $key)
|
||||
* @method static bool missing(string $key)
|
||||
* @method static mixed get(array|string $key, mixed $default = null)
|
||||
* @method static bool has(\UnitEnum|array|string $key)
|
||||
* @method static bool missing(\UnitEnum|string $key)
|
||||
* @method static mixed get(\UnitEnum|array|string $key, mixed $default = null)
|
||||
* @method static array many(array $keys)
|
||||
* @method static iterable getMultiple(iterable $keys, mixed $default = null)
|
||||
* @method static mixed pull(array|string $key, mixed $default = null)
|
||||
* @method static bool put(array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null)
|
||||
* @method static bool set(string $key, mixed $value, null|int|\DateInterval $ttl = null)
|
||||
* @method static mixed pull(\UnitEnum|array|string $key, mixed $default = null)
|
||||
* @method static string string(\UnitEnum|string $key, \Closure|string|null $default = null)
|
||||
* @method static int integer(\UnitEnum|string $key, \Closure|int|null $default = null)
|
||||
* @method static float float(\UnitEnum|string $key, \Closure|float|null $default = null)
|
||||
* @method static bool boolean(\UnitEnum|string $key, \Closure|bool|null $default = null)
|
||||
* @method static array array(\UnitEnum|string $key, \Closure|array|null $default = null)
|
||||
* @method static bool put(\UnitEnum|array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null)
|
||||
* @method static bool set(\UnitEnum|array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null)
|
||||
* @method static bool putMany(array $values, \DateTimeInterface|\DateInterval|int|null $ttl = null)
|
||||
* @method static bool setMultiple(iterable $values, null|int|\DateInterval $ttl = null)
|
||||
* @method static bool add(string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null)
|
||||
* @method static int|bool increment(string $key, mixed $value = 1)
|
||||
* @method static int|bool decrement(string $key, mixed $value = 1)
|
||||
* @method static bool forever(string $key, mixed $value)
|
||||
* @method static mixed remember(string $key, \Closure|\DateTimeInterface|\DateInterval|int|null $ttl, \Closure $callback)
|
||||
* @method static mixed sear(string $key, \Closure $callback)
|
||||
* @method static mixed rememberForever(string $key, \Closure $callback)
|
||||
* @method static mixed flexible(string $key, array $ttl, callable $callback, array|null $lock = null, bool $alwaysDefer = false)
|
||||
* @method static bool forget(string $key)
|
||||
* @method static bool delete(string $key)
|
||||
* @method static bool add(\UnitEnum|array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null)
|
||||
* @method static int|bool increment(\UnitEnum|string $key, mixed $value = 1)
|
||||
* @method static int|bool decrement(\UnitEnum|string $key, mixed $value = 1)
|
||||
* @method static bool forever(\UnitEnum|string $key, mixed $value)
|
||||
* @method static mixed remember(\UnitEnum|string $key, \Closure|\DateTimeInterface|\DateInterval|int|null $ttl, \Closure $callback)
|
||||
* @method static mixed sear(\UnitEnum|string $key, \Closure $callback)
|
||||
* @method static mixed rememberForever(\UnitEnum|string $key, \Closure $callback)
|
||||
* @method static mixed flexible(\UnitEnum|string $key, array $ttl, callable $callback, array|null $lock = null, bool $alwaysDefer = false)
|
||||
* @method static mixed withoutOverlapping(\UnitEnum|string $key, callable $callback, int $lockFor = 0, int $waitFor = 10, string|null $owner = null)
|
||||
* @method static \Illuminate\Cache\Limiters\ConcurrencyLimiterBuilder funnel(\UnitEnum|string $name)
|
||||
* @method static bool forget(\UnitEnum|array|string $key)
|
||||
* @method static bool delete(\UnitEnum|array|string $key)
|
||||
* @method static bool deleteMultiple(iterable $keys)
|
||||
* @method static bool clear()
|
||||
* @method static \Illuminate\Cache\TaggedCache tags(mixed $names)
|
||||
@@ -71,4 +80,27 @@ class Cache extends Facade
|
||||
{
|
||||
return 'cache';
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the facade into a Mockery spy.
|
||||
*
|
||||
* @return \Mockery\MockInterface
|
||||
*/
|
||||
public static function spy()
|
||||
{
|
||||
if (! static::isMock()) {
|
||||
$class = static::getMockableClass();
|
||||
$instance = static::getFacadeRoot();
|
||||
|
||||
if ($class && $instance) {
|
||||
return tap(Mockery::spy($instance)->makePartial(), function ($spy) {
|
||||
static::swap($spy);
|
||||
});
|
||||
}
|
||||
|
||||
return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) {
|
||||
static::swap($spy);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use Illuminate\Concurrency\ConcurrencyManager;
|
||||
|
||||
/**
|
||||
* @method static mixed driver(string|null $name = null)
|
||||
* @method static \Illuminate\Concurrency\ProcessDriver createProcessDriver(array $config)
|
||||
* @method static \Illuminate\Concurrency\ForkDriver createForkDriver(array $config)
|
||||
* @method static \Illuminate\Concurrency\SyncDriver createSyncDriver(array $config)
|
||||
* @method static \Illuminate\Concurrency\ProcessDriver createProcessDriver()
|
||||
* @method static \Illuminate\Concurrency\ForkDriver createForkDriver()
|
||||
* @method static \Illuminate\Concurrency\SyncDriver createSyncDriver()
|
||||
* @method static string getDefaultInstance()
|
||||
* @method static void setDefaultInstance(string $name)
|
||||
* @method static array getInstanceConfig(string $name)
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static string encryptString(string $value)
|
||||
* @method static mixed decrypt(string $payload, bool $unserialize = true)
|
||||
* @method static string decryptString(string $payload)
|
||||
* @method static bool appearsEncrypted(mixed $value)
|
||||
* @method static string getKey()
|
||||
* @method static array getAllKeys()
|
||||
* @method static array getPreviousKeys()
|
||||
|
||||
@@ -76,6 +76,7 @@ use Illuminate\Database\Console\WipeCommand;
|
||||
* @method static \PDO|\Closure|null getRawReadPdo()
|
||||
* @method static \Illuminate\Database\Connection setPdo(\PDO|\Closure|null $pdo)
|
||||
* @method static \Illuminate\Database\Connection setReadPdo(\PDO|\Closure|null $pdo)
|
||||
* @method static \Illuminate\Database\Connection setReadPdoConfig(array $config)
|
||||
* @method static string|null getName()
|
||||
* @method static string|null getNameWithReadWriteType()
|
||||
* @method static mixed getConfig(string|null $option = null)
|
||||
@@ -87,7 +88,7 @@ use Illuminate\Database\Console\WipeCommand;
|
||||
* @method static \Illuminate\Database\Connection setSchemaGrammar(\Illuminate\Database\Schema\Grammars\Grammar $grammar)
|
||||
* @method static \Illuminate\Database\Query\Processors\Processor getPostProcessor()
|
||||
* @method static \Illuminate\Database\Connection setPostProcessor(\Illuminate\Database\Query\Processors\Processor $processor)
|
||||
* @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher()
|
||||
* @method static \Illuminate\Contracts\Events\Dispatcher|null getEventDispatcher()
|
||||
* @method static \Illuminate\Database\Connection setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events)
|
||||
* @method static void unsetEventDispatcher()
|
||||
* @method static \Illuminate\Database\Connection setTransactionManager(\Illuminate\Database\DatabaseTransactionsManager $manager)
|
||||
@@ -114,6 +115,7 @@ use Illuminate\Database\Console\WipeCommand;
|
||||
* @method static void rollBack(int|null $toLevel = null)
|
||||
* @method static int transactionLevel()
|
||||
* @method static void afterCommit(callable $callback)
|
||||
* @method static void afterRollBack(callable $callback)
|
||||
*
|
||||
* @see \Illuminate\Database\DatabaseManager
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Support\Testing\Fakes\EventFake;
|
||||
* @method static void push(string $event, object|array $payload = [])
|
||||
* @method static void flush(string $event)
|
||||
* @method static void subscribe(object|string $subscriber)
|
||||
* @method static mixed until(string|object $event, mixed $payload = [])
|
||||
* @method static array|null until(string|object $event, mixed $payload = [])
|
||||
* @method static array|null dispatch(string|object $event, mixed $payload = [], bool $halt = false)
|
||||
* @method static array getListeners(string $eventName)
|
||||
* @method static \Closure makeListener(\Closure|string|array $listener, bool $wildcard = false)
|
||||
@@ -21,7 +21,7 @@ use Illuminate\Support\Testing\Fakes\EventFake;
|
||||
* @method static void forgetPushed()
|
||||
* @method static \Illuminate\Events\Dispatcher setQueueResolver(callable $resolver)
|
||||
* @method static \Illuminate\Events\Dispatcher setTransactionManagerResolver(callable $resolver)
|
||||
* @method static mixed defer(callable $callback, array|null $events = null)
|
||||
* @method static mixed defer(callable $callback, string[]|null $events = null)
|
||||
* @method static array getRawListeners()
|
||||
* @method static void macro(string $name, object|callable $macro)
|
||||
* @method static void mixin(object $mixin, bool $replace = true)
|
||||
@@ -30,7 +30,7 @@ use Illuminate\Support\Testing\Fakes\EventFake;
|
||||
* @method static \Illuminate\Support\Testing\Fakes\EventFake except(array|string $eventsToDispatch)
|
||||
* @method static void assertListening(string $expectedEvent, string|array $expectedListener)
|
||||
* @method static void assertDispatched(string|\Closure $event, callable|int|null $callback = null)
|
||||
* @method static void assertDispatchedOnce(string $event, int $times = null)
|
||||
* @method static void assertDispatchedOnce(string $event)
|
||||
* @method static void assertDispatchedTimes(string $event, int $times = 1)
|
||||
* @method static void assertNotDispatched(string|\Closure $event, callable|null $callback = null)
|
||||
* @method static void assertNothingDispatched()
|
||||
|
||||
@@ -247,12 +247,12 @@ abstract class Facade
|
||||
/**
|
||||
* Clear a resolved facade instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param ?string $name
|
||||
* @return void
|
||||
*/
|
||||
public static function clearResolvedInstance($name)
|
||||
public static function clearResolvedInstance($name = null)
|
||||
{
|
||||
unset(static::$resolvedInstance[$name]);
|
||||
unset(static::$resolvedInstance[$name ?? static::getFacadeAccessor()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static string dirname(string $path)
|
||||
* @method static string extension(string $path)
|
||||
* @method static string|null guessExtension(string $path)
|
||||
* @method static string type(string $path)
|
||||
* @method static string|false type(string $path)
|
||||
* @method static string|false mimeType(string $path)
|
||||
* @method static int size(string $path)
|
||||
* @method static int lastModified(string $path)
|
||||
@@ -39,9 +39,10 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool hasSameHash(string $firstFile, string $secondFile)
|
||||
* @method static bool isFile(string $file)
|
||||
* @method static array glob(string $pattern, int $flags = 0)
|
||||
* @method static \Symfony\Component\Finder\SplFileInfo[] files(string $directory, bool $hidden = false)
|
||||
* @method static \Symfony\Component\Finder\SplFileInfo[] files(string $directory, bool $hidden = false, array|string|int $depth = 0)
|
||||
* @method static \Symfony\Component\Finder\SplFileInfo[] allFiles(string $directory, bool $hidden = false)
|
||||
* @method static array directories(string $directory)
|
||||
* @method static array directories(string $directory, array|string|int $depth = 0)
|
||||
* @method static array allDirectories(string $directory)
|
||||
* @method static void ensureDirectoryExists(string $path, int $mode = 0755, bool $recursive = true)
|
||||
* @method static bool makeDirectory(string $path, int $mode = 0755, bool $recursive = false, bool $force = false)
|
||||
* @method static bool moveDirectory(string $from, string $to, bool $overwrite = false)
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Illuminate\Support\Facades;
|
||||
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
|
||||
|
||||
/**
|
||||
* @method static bool has(string|array $ability)
|
||||
* @method static bool has(\UnitEnum|array|string $ability)
|
||||
* @method static \Illuminate\Auth\Access\Response allowIf(\Illuminate\Auth\Access\Response|\Closure|bool $condition, string|null $message = null, string|null $code = null)
|
||||
* @method static \Illuminate\Auth\Access\Response denyIf(\Illuminate\Auth\Access\Response|\Closure|bool $condition, string|null $message = null, string|null $code = null)
|
||||
* @method static \Illuminate\Auth\Access\Gate define(\UnitEnum|string $ability, callable|array|string $callback)
|
||||
|
||||
@@ -65,20 +65,23 @@ use Illuminate\Http\Client\Factory;
|
||||
* @method static \Illuminate\Http\Client\PendingRequest withMiddleware(callable $middleware)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest withRequestMiddleware(callable $middleware)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest withResponseMiddleware(callable $middleware)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest withAttributes(array $attributes)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest afterResponse(callable|null $callback)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest throw(callable|null $callback = null)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest throwIf(callable|bool $condition)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest throwUnless(callable|bool $condition)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest dump()
|
||||
* @method static \Illuminate\Http\Client\PendingRequest dd()
|
||||
* @method static \Illuminate\Http\Client\Response get(string $url, array|string|null $query = null)
|
||||
* @method static \Illuminate\Http\Client\Response head(string $url, array|string|null $query = null)
|
||||
* @method static \Illuminate\Http\Client\Response post(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static \Illuminate\Http\Client\Response patch(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static \Illuminate\Http\Client\Response put(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static \Illuminate\Http\Client\Response delete(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static array pool(callable $callback)
|
||||
* @method static \Illuminate\Http\Client\Response send(string $method, string $url, array $options = [])
|
||||
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface get(string $url, array|string|null $query = null)
|
||||
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface head(string $url, array|string|null $query = null)
|
||||
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface post(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface patch(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface put(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface delete(string $url, array|\JsonSerializable|\Illuminate\Contracts\Support\Arrayable $data = [])
|
||||
* @method static array pool(callable $callback, int|null $concurrency = null)
|
||||
* @method static \Illuminate\Http\Client\Batch batch(callable $callback)
|
||||
* @method static \Illuminate\Http\Client\Response|\Illuminate\Http\Client\Promises\LazyPromise send(string $method, string $url, array $options = [])
|
||||
* @method static \GuzzleHttp\Client buildClient()
|
||||
* @method static \GuzzleHttp\Client createClient(\GuzzleHttp\HandlerStack $handlerStack)
|
||||
* @method static \GuzzleHttp\HandlerStack buildHandlerStack()
|
||||
@@ -86,7 +89,7 @@ use Illuminate\Http\Client\Factory;
|
||||
* @method static \Closure buildBeforeSendingHandler()
|
||||
* @method static \Closure buildRecorderHandler()
|
||||
* @method static \Closure buildStubHandler()
|
||||
* @method static \GuzzleHttp\Psr7\RequestInterface runBeforeSendingCallbacks(\GuzzleHttp\Psr7\RequestInterface $request, array $options)
|
||||
* @method static \Psr\Http\Message\RequestInterface runBeforeSendingCallbacks(\Psr\Http\Message\RequestInterface $request, array $options)
|
||||
* @method static array mergeOptions(array ...$options)
|
||||
* @method static \Illuminate\Http\Client\PendingRequest stub(callable $callback)
|
||||
* @method static bool isAllowedRequestUrl(string $url)
|
||||
@@ -117,7 +120,7 @@ class Http extends Facade
|
||||
/**
|
||||
* Register a stub callable that will intercept requests and be able to return stub responses.
|
||||
*
|
||||
* @param \Closure|array $callback
|
||||
* @param \Closure|array|null $callback
|
||||
* @return \Illuminate\Http\Client\Factory
|
||||
*/
|
||||
public static function fake($callback = null)
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static \Illuminate\Log\Logger withContext(array $context = [])
|
||||
* @method static void listen(\Closure $callback)
|
||||
* @method static \Psr\Log\LoggerInterface getLogger()
|
||||
* @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher()
|
||||
* @method static \Illuminate\Contracts\Events\Dispatcher|null getEventDispatcher()
|
||||
* @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $dispatcher)
|
||||
* @method static \Illuminate\Log\Logger|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
|
||||
* @method static \Illuminate\Log\Logger|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
|
||||
|
||||
@@ -29,7 +29,7 @@ use Illuminate\Support\Testing\Fakes\MailFake;
|
||||
* @method static string render(string|array $view, array $data = [])
|
||||
* @method static \Illuminate\Mail\SentMessage|null send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string|null $callback = null)
|
||||
* @method static \Illuminate\Mail\SentMessage|null sendNow(\Illuminate\Contracts\Mail\Mailable|string|array $mailable, array $data = [], \Closure|string|null $callback = null)
|
||||
* @method static mixed queue(\Illuminate\Contracts\Mail\Mailable|string|array $view, \BackedEnum|string|null $queue = null)
|
||||
* @method static mixed queue(\Illuminate\Contracts\Mail\Mailable $view, \BackedEnum|string|null $queue = null)
|
||||
* @method static mixed onQueue(\BackedEnum|string|null $queue, \Illuminate\Contracts\Mail\Mailable $view)
|
||||
* @method static mixed queueOn(string $queue, \Illuminate\Contracts\Mail\Mailable $view)
|
||||
* @method static mixed later(\DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable $view, string|null $queue = null)
|
||||
@@ -43,6 +43,7 @@ use Illuminate\Support\Testing\Fakes\MailFake;
|
||||
* @method static bool hasMacro(string $name)
|
||||
* @method static void flushMacros()
|
||||
* @method static void assertSent(string|\Closure $mailable, callable|array|string|int|null $callback = null)
|
||||
* @method static void assertSentTimes(string $mailable, int $times = 1)
|
||||
* @method static void assertNotOutgoing(string|\Closure $mailable, callable|null $callback = null)
|
||||
* @method static void assertNotSent(string|\Closure $mailable, callable|array|string|null $callback = null)
|
||||
* @method static void assertNothingOutgoing()
|
||||
|
||||
@@ -4,6 +4,17 @@ namespace Illuminate\Support\Facades;
|
||||
|
||||
use Illuminate\Foundation\MaintenanceModeManager;
|
||||
|
||||
/**
|
||||
* @method static string getDefaultDriver()
|
||||
* @method static mixed driver(string|null $driver = null)
|
||||
* @method static \Illuminate\Foundation\MaintenanceModeManager extend(string $driver, \Closure $callback)
|
||||
* @method static array getDrivers()
|
||||
* @method static \Illuminate\Contracts\Container\Container getContainer()
|
||||
* @method static \Illuminate\Foundation\MaintenanceModeManager setContainer(\Illuminate\Contracts\Container\Container $container)
|
||||
* @method static \Illuminate\Foundation\MaintenanceModeManager forgetDrivers()
|
||||
*
|
||||
* @see \Illuminate\Foundation\MaintenanceModeManager
|
||||
*/
|
||||
class MaintenanceMode extends Facade
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,10 @@ use Illuminate\Support\Testing\Fakes\NotificationFake;
|
||||
* @method static \Illuminate\Contracts\Container\Container getContainer()
|
||||
* @method static \Illuminate\Notifications\ChannelManager setContainer(\Illuminate\Contracts\Container\Container $container)
|
||||
* @method static \Illuminate\Notifications\ChannelManager forgetDrivers()
|
||||
* @method static void macro(string $name, object|callable $macro)
|
||||
* @method static void mixin(object $mixin, bool $replace = true)
|
||||
* @method static bool hasMacro(string $name)
|
||||
* @method static void flushMacros()
|
||||
* @method static void assertSentOnDemand(string|\Closure $notification, callable|null $callback = null)
|
||||
* @method static void assertSentTo(mixed $notifiable, string|\Closure $notification, callable|null $callback = null)
|
||||
* @method static void assertSentOnDemandTimes(string $notification, int $times = 1)
|
||||
@@ -33,10 +37,6 @@ use Illuminate\Support\Testing\Fakes\NotificationFake;
|
||||
* @method static bool hasSent(mixed $notifiable, string $notification)
|
||||
* @method static \Illuminate\Support\Testing\Fakes\NotificationFake serializeAndRestore(bool $serializeAndRestore = true)
|
||||
* @method static array sentNotifications()
|
||||
* @method static void macro(string $name, object|callable $macro)
|
||||
* @method static void mixin(object $mixin, bool $replace = true)
|
||||
* @method static bool hasMacro(string $name)
|
||||
* @method static void flushMacros()
|
||||
*
|
||||
* @see \Illuminate\Notifications\ChannelManager
|
||||
* @see \Illuminate\Support\Testing\Fakes\NotificationFake
|
||||
|
||||
@@ -7,11 +7,13 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static void resolveTokenUsing(\Closure|null $resolver)
|
||||
* @method static void setUpProcess(callable $callback)
|
||||
* @method static void setUpTestCase(callable $callback)
|
||||
* @method static void setUpTestDatabaseBeforeMigrating(callable $callback)
|
||||
* @method static void setUpTestDatabase(callable $callback)
|
||||
* @method static void tearDownProcess(callable $callback)
|
||||
* @method static void tearDownTestCase(callable $callback)
|
||||
* @method static void callSetUpProcessCallbacks()
|
||||
* @method static void callSetUpTestCaseCallbacks(\Illuminate\Foundation\Testing\TestCase $testCase)
|
||||
* @method static void callSetUpTestDatabaseBeforeMigratingCallbacks(string $database)
|
||||
* @method static void callSetUpTestDatabaseCallbacks(string $database)
|
||||
* @method static void callTearDownProcessCallbacks()
|
||||
* @method static void callTearDownTestCaseCallbacks(\Illuminate\Foundation\Testing\TestCase $testCase)
|
||||
|
||||
@@ -15,6 +15,11 @@ use Illuminate\Support\Testing\Fakes\QueueFake;
|
||||
* @method static void stopping(mixed $callback)
|
||||
* @method static bool connected(string|null $name = null)
|
||||
* @method static \Illuminate\Contracts\Queue\Queue connection(string|null $name = null)
|
||||
* @method static void pause(string $connection, string $queue)
|
||||
* @method static void pauseFor(string $connection, string $queue, \DateTimeInterface|\DateInterval|int $ttl)
|
||||
* @method static void resume(string $connection, string $queue)
|
||||
* @method static bool isPaused(string $connection, string $queue)
|
||||
* @method static void withoutInterruptionPolling()
|
||||
* @method static void extend(string $driver, \Closure $resolver)
|
||||
* @method static void addConnector(string $driver, \Closure $resolver)
|
||||
* @method static string getDefaultDriver()
|
||||
@@ -40,10 +45,13 @@ use Illuminate\Support\Testing\Fakes\QueueFake;
|
||||
* @method static mixed getJobBackoff(mixed $job)
|
||||
* @method static mixed getJobExpiration(mixed $job)
|
||||
* @method static void createPayloadUsing(callable|null $callback)
|
||||
* @method static array getConfig()
|
||||
* @method static \Illuminate\Queue\Queue setConfig(array $config)
|
||||
* @method static \Illuminate\Container\Container getContainer()
|
||||
* @method static void setContainer(\Illuminate\Container\Container $container)
|
||||
* @method static \Illuminate\Support\Testing\Fakes\QueueFake except(array|string $jobsToBeQueued)
|
||||
* @method static void assertPushed(string|\Closure $job, callable|int|null $callback = null)
|
||||
* @method static void assertPushedTimes(string $job, int $times = 1)
|
||||
* @method static void assertPushedOn(string $queue, string|\Closure $job, callable|null $callback = null)
|
||||
* @method static void assertPushedWithChain(string $job, array $expectedChain = [], callable|null $callback = null)
|
||||
* @method static void assertPushedWithoutChain(string $job, callable|null $callback = null)
|
||||
@@ -60,6 +68,7 @@ use Illuminate\Support\Testing\Fakes\QueueFake;
|
||||
* @method static array pushedJobs()
|
||||
* @method static array rawPushes()
|
||||
* @method static \Illuminate\Support\Testing\Fakes\QueueFake serializeAndRestore(bool $serializeAndRestore = true)
|
||||
* @method static void releaseUniqueJobLocks()
|
||||
*
|
||||
* @see \Illuminate\Queue\QueueManager
|
||||
* @see \Illuminate\Queue\Queue
|
||||
@@ -88,7 +97,7 @@ class Queue extends Facade
|
||||
public static function fake($jobsToFake = [])
|
||||
{
|
||||
$actualQueueManager = static::isFake()
|
||||
? static::getFacadeRoot()->queue
|
||||
? tap(static::getFacadeRoot(), fn ($fake) => $fake->releaseUniqueJobLocks())->queue
|
||||
: static::getFacadeRoot();
|
||||
|
||||
return tap(new QueueFake(static::getFacadeApplication(), $jobsToFake, $actualQueueManager), function ($fake) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace Illuminate\Support\Facades;
|
||||
|
||||
/**
|
||||
* @method static \Illuminate\Cache\RateLimiter for(\BackedEnum|\UnitEnum|string $name, \Closure $callback)
|
||||
* @method static \Closure|null limiter(\BackedEnum|\UnitEnum|string $name)
|
||||
* @method static \Illuminate\Cache\RateLimiter for(\UnitEnum|string $name, \Closure $callback)
|
||||
* @method static \Closure|null limiter(\UnitEnum|string $name)
|
||||
* @method static mixed attempt(string $key, int $maxAttempts, \Closure $callback, \DateTimeInterface|\DateInterval|int $decaySeconds = 60)
|
||||
* @method static bool tooManyAttempts(string $key, int $maxAttempts)
|
||||
* @method static int hit(string $key, \DateTimeInterface|\DateInterval|int $decaySeconds = 60)
|
||||
|
||||
276
plugins/vendor/illuminate/support/Facades/Redis.php
vendored
276
plugins/vendor/illuminate/support/Facades/Redis.php
vendored
@@ -19,9 +19,10 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static void psubscribe(array|string $channels, \Closure $callback)
|
||||
* @method static mixed command(string $method, array $parameters = [])
|
||||
* @method static void listen(\Closure $callback)
|
||||
* @method static void listenForFailures(\Closure $callback)
|
||||
* @method static string|null getName()
|
||||
* @method static \Illuminate\Redis\Connections\Connection setName(string $name)
|
||||
* @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher()
|
||||
* @method static \Illuminate\Contracts\Events\Dispatcher|null getEventDispatcher()
|
||||
* @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events)
|
||||
* @method static void unsetEventDispatcher()
|
||||
* @method static void macro(string $name, object|callable $macro)
|
||||
@@ -29,6 +30,279 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool hasMacro(string $name)
|
||||
* @method static void flushMacros()
|
||||
* @method static mixed macroCall(string $method, array $parameters)
|
||||
* @method static string _compress(string $value)
|
||||
* @method static string _uncompress(string $value)
|
||||
* @method static string _prefix(string $key)
|
||||
* @method static string _serialize(mixed $value)
|
||||
* @method static mixed _unserialize(string $value)
|
||||
* @method static string _pack(mixed $value)
|
||||
* @method static mixed _unpack(string $value)
|
||||
* @method static mixed acl(string $subcmd, string ...$args)
|
||||
* @method static \Redis|int|false append(string $key, mixed $value)
|
||||
* @method static \Redis|bool auth(mixed $credentials)
|
||||
* @method static \Redis|bool bgSave()
|
||||
* @method static \Redis|bool bgrewriteaof()
|
||||
* @method static \Redis|array|false waitaof(int $numlocal, int $numreplicas, int $timeout)
|
||||
* @method static \Redis|int|false bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false)
|
||||
* @method static \Redis|int|false bitop(string $operation, string $deskey, string $srckey, string ...$other_keys)
|
||||
* @method static \Redis|int|false bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false)
|
||||
* @method static \Redis|array|false|null blPop(array|string $key_or_keys, string|int|float $timeout_or_key, mixed ...$extra_args)
|
||||
* @method static \Redis|array|false|null brPop(array|string $key_or_keys, string|int|float $timeout_or_key, mixed ...$extra_args)
|
||||
* @method static \Redis|string|false brpoplpush(string $src, string $dst, int|float $timeout)
|
||||
* @method static \Redis|array|false bzPopMax(array|string $key, string|int $timeout_or_key, mixed ...$extra_args)
|
||||
* @method static \Redis|array|false bzPopMin(array|string $key, string|int $timeout_or_key, mixed ...$extra_args)
|
||||
* @method static \Redis|array|false|null bzmpop(float $timeout, array $keys, string $from, int $count = 1)
|
||||
* @method static \Redis|array|false|null zmpop(array $keys, string $from, int $count = 1)
|
||||
* @method static \Redis|array|false|null blmpop(float $timeout, array $keys, string $from, int $count = 1)
|
||||
* @method static \Redis|array|false|null lmpop(array $keys, string $from, int $count = 1)
|
||||
* @method static bool clearLastError()
|
||||
* @method static bool close()
|
||||
* @method static mixed config(string $operation, array|string|null $key_or_settings = null, string|null $value = null)
|
||||
* @method static bool connect(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null)
|
||||
* @method static \Redis|bool copy(string $src, string $dst, array|null $options = null)
|
||||
* @method static \Redis|int|false dbSize()
|
||||
* @method static \Redis|string debug(string $key)
|
||||
* @method static \Redis|int|false decr(string $key, int $by = 1)
|
||||
* @method static \Redis|int|false decrBy(string $key, int $value)
|
||||
* @method static \Redis|int|false del(array|string $key, string ...$other_keys)
|
||||
* @method static \Redis|int|false delifeq(string $key, mixed $value)
|
||||
* @method static \Redis|bool discard()
|
||||
* @method static \Redis|string|false dump(string $key)
|
||||
* @method static \Redis|string|false echo(string $str)
|
||||
* @method static mixed eval(string $script, array $args = [], int $num_keys = 0)
|
||||
* @method static mixed eval_ro(string $script_sha, array $args = [], int $num_keys = 0)
|
||||
* @method static mixed evalsha(string $sha1, array $args = [], int $num_keys = 0)
|
||||
* @method static mixed evalsha_ro(string $sha1, array $args = [], int $num_keys = 0)
|
||||
* @method static \Redis|array|false exec()
|
||||
* @method static \Redis|int|bool exists(mixed $key, mixed ...$other_keys)
|
||||
* @method static \Redis|bool expire(string $key, int $timeout, string|null $mode = null)
|
||||
* @method static \Redis|bool expireAt(string $key, int $timestamp, string|null $mode = null)
|
||||
* @method static \Redis|bool failover(array|null $to = null, bool $abort = false, int $timeout = 0)
|
||||
* @method static \Redis|int|false expiretime(string $key)
|
||||
* @method static \Redis|int|false pexpiretime(string $key)
|
||||
* @method static mixed fcall(string $fn, array $keys = [], array $args = [])
|
||||
* @method static mixed fcall_ro(string $fn, array $keys = [], array $args = [])
|
||||
* @method static \Redis|bool flushAll(bool|null $sync = null)
|
||||
* @method static \Redis|bool flushDB(bool|null $sync = null)
|
||||
* @method static \Redis|array|string|bool function(string $operation, mixed ...$args)
|
||||
* @method static \Redis|int|false geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options)
|
||||
* @method static \Redis|float|false geodist(string $key, string $src, string $dst, string|null $unit = null)
|
||||
* @method static \Redis|array|false geohash(string $key, string $member, string ...$other_members)
|
||||
* @method static \Redis|array|false geopos(string $key, string $member, string ...$other_members)
|
||||
* @method static mixed georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])
|
||||
* @method static mixed georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])
|
||||
* @method static mixed georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = [])
|
||||
* @method static mixed georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = [])
|
||||
* @method static array geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = [])
|
||||
* @method static \Redis|array|int|false geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = [])
|
||||
* @method static mixed get(string $key)
|
||||
* @method static \Redis|array|false getWithMeta(string $key)
|
||||
* @method static mixed getAuth()
|
||||
* @method static \Redis|int|false getBit(string $key, int $idx)
|
||||
* @method static \Redis|string|bool getEx(string $key, array $options = [])
|
||||
* @method static int getDBNum()
|
||||
* @method static \Redis|string|bool getDel(string $key)
|
||||
* @method static string getHost()
|
||||
* @method static string|null getLastError()
|
||||
* @method static int getMode()
|
||||
* @method static mixed getOption(int $option)
|
||||
* @method static string|null getPersistentID()
|
||||
* @method static int getPort()
|
||||
* @method static string|false serverName()
|
||||
* @method static string|false serverVersion()
|
||||
* @method static \Redis|string|false getRange(string $key, int $start, int $end)
|
||||
* @method static \Redis|array|string|int|false lcs(string $key1, string $key2, array|null $options = null)
|
||||
* @method static float getReadTimeout()
|
||||
* @method static \Redis|string|false getset(string $key, mixed $value)
|
||||
* @method static float|false getTimeout()
|
||||
* @method static array getTransferredBytes()
|
||||
* @method static void clearTransferredBytes()
|
||||
* @method static \Redis|int|false hDel(string $key, string $field, string ...$other_fields)
|
||||
* @method static \Redis|bool hExists(string $key, string $field)
|
||||
* @method static mixed hGet(string $key, string $member)
|
||||
* @method static \Redis|array|false hGetAll(string $key)
|
||||
* @method static mixed hGetWithMeta(string $key, string $member)
|
||||
* @method static \Redis|int|false hIncrBy(string $key, string $field, int $value)
|
||||
* @method static \Redis|float|false hIncrByFloat(string $key, string $field, float $value)
|
||||
* @method static \Redis|array|false hKeys(string $key)
|
||||
* @method static \Redis|int|false hLen(string $key)
|
||||
* @method static \Redis|array|false hMget(string $key, array $fields)
|
||||
* @method static \Redis|array|false hgetex(string $key, array $fields, array|string|null $expiry = null)
|
||||
* @method static \Redis|int|false hsetex(string $key, array $fields, array|null $expiry = null)
|
||||
* @method static \Redis|array|false hgetdel(string $key, array $fields)
|
||||
* @method static \Redis|bool hMset(string $key, array $fieldvals)
|
||||
* @method static \Redis|array|string|false hRandField(string $key, array|null $options = null)
|
||||
* @method static \Redis|int|false hSet(string $key, mixed ...$fields_and_vals)
|
||||
* @method static \Redis|bool hSetNx(string $key, string $field, mixed $value)
|
||||
* @method static \Redis|int|false hStrLen(string $key, string $field)
|
||||
* @method static \Redis|array|false hVals(string $key)
|
||||
* @method static \Redis|array|false hexpire(string $key, int $ttl, array $fields, string|null $mode = null)
|
||||
* @method static \Redis|array|false hpexpire(string $key, int $ttl, array $fields, string|null $mode = null)
|
||||
* @method static \Redis|array|false hexpireat(string $key, int $time, array $fields, string|null $mode = null)
|
||||
* @method static \Redis|array|false hpexpireat(string $key, int $mstime, array $fields, string|null $mode = null)
|
||||
* @method static \Redis|array|false httl(string $key, array $fields)
|
||||
* @method static \Redis|array|false hpttl(string $key, array $fields)
|
||||
* @method static \Redis|array|false hexpiretime(string $key, array $fields)
|
||||
* @method static \Redis|array|false hpexpiretime(string $key, array $fields)
|
||||
* @method static \Redis|array|false hpersist(string $key, array $fields)
|
||||
* @method static \Redis|array|bool hscan(string $key, string|int|null $iterator, string|null $pattern = null, int $count = 0)
|
||||
* @method static \Redis|int|false expiremember(string $key, string $field, int $ttl, string|null $unit = null)
|
||||
* @method static \Redis|int|false expirememberat(string $key, string $field, int $timestamp)
|
||||
* @method static \Redis|int|false incr(string $key, int $by = 1)
|
||||
* @method static \Redis|int|false incrBy(string $key, int $value)
|
||||
* @method static \Redis|float|false incrByFloat(string $key, float $value)
|
||||
* @method static \Redis|array|false info(string ...$sections)
|
||||
* @method static bool isConnected()
|
||||
* @method static void keys(string $pattern)
|
||||
* @method static void lInsert(string $key, string $pos, mixed $pivot, mixed $value)
|
||||
* @method static \Redis|int|false lLen(string $key)
|
||||
* @method static \Redis|string|false lMove(string $src, string $dst, string $wherefrom, string $whereto)
|
||||
* @method static \Redis|string|false blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout)
|
||||
* @method static \Redis|array|string|bool lPop(string $key, int $count = 0)
|
||||
* @method static \Redis|array|int|bool|null lPos(string $key, mixed $value, array|null $options = null)
|
||||
* @method static \Redis|int|false lPush(string $key, mixed ...$elements)
|
||||
* @method static \Redis|int|false rPush(string $key, mixed ...$elements)
|
||||
* @method static \Redis|int|false lPushx(string $key, mixed $value)
|
||||
* @method static \Redis|int|false rPushx(string $key, mixed $value)
|
||||
* @method static \Redis|bool lSet(string $key, int $index, mixed $value)
|
||||
* @method static int lastSave()
|
||||
* @method static mixed lindex(string $key, int $index)
|
||||
* @method static \Redis|array|false lrange(string $key, int $start, int $end)
|
||||
* @method static \Redis|int|false lrem(string $key, mixed $value, int $count = 0)
|
||||
* @method static \Redis|bool ltrim(string $key, int $start, int $end)
|
||||
* @method static \Redis|array|false mget(array $keys)
|
||||
* @method static \Redis|bool migrate(string $host, int $port, array|string $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, mixed $credentials = null)
|
||||
* @method static \Redis|bool move(string $key, int $index)
|
||||
* @method static \Redis|bool mset(array $key_values)
|
||||
* @method static \Redis|bool msetnx(array $key_values)
|
||||
* @method static \Redis|bool multi(int $value = 1)
|
||||
* @method static \Redis|string|int|false object(string $subcommand, string $key)
|
||||
* @method static bool pconnect(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null)
|
||||
* @method static \Redis|bool persist(string $key)
|
||||
* @method static bool pexpire(string $key, int $timeout, string|null $mode = null)
|
||||
* @method static \Redis|bool pexpireAt(string $key, int $timestamp, string|null $mode = null)
|
||||
* @method static \Redis|int pfadd(string $key, array $elements)
|
||||
* @method static \Redis|int|false pfcount(array|string $key_or_keys)
|
||||
* @method static \Redis|bool pfmerge(string $dst, array $srckeys)
|
||||
* @method static \Redis|string|bool ping(string|null $message = null)
|
||||
* @method static \Redis|bool pipeline()
|
||||
* @method static \Redis|bool psetex(string $key, int $expire, mixed $value)
|
||||
* @method static \Redis|int|false pttl(string $key)
|
||||
* @method static \Redis|int|false publish(string $channel, string $message)
|
||||
* @method static mixed pubsub(string $command, mixed $arg = null)
|
||||
* @method static \Redis|array|bool punsubscribe(array $patterns)
|
||||
* @method static \Redis|array|string|bool rPop(string $key, int $count = 0)
|
||||
* @method static \Redis|string|false randomKey()
|
||||
* @method static mixed rawcommand(string $command, mixed ...$args)
|
||||
* @method static \Redis|bool rename(string $old_name, string $new_name)
|
||||
* @method static \Redis|bool renameNx(string $key_src, string $key_dst)
|
||||
* @method static \Redis|bool reset()
|
||||
* @method static \Redis|bool restore(string $key, int $ttl, string $value, array|null $options = null)
|
||||
* @method static mixed role()
|
||||
* @method static \Redis|string|false rpoplpush(string $srckey, string $dstkey)
|
||||
* @method static \Redis|int|false sAdd(string $key, mixed $value, mixed ...$other_values)
|
||||
* @method static int sAddArray(string $key, array $values)
|
||||
* @method static \Redis|array|false sDiff(string $key, string ...$other_keys)
|
||||
* @method static \Redis|int|false sDiffStore(string $dst, string $key, string ...$other_keys)
|
||||
* @method static \Redis|array|false sInter(array|string $key, string ...$other_keys)
|
||||
* @method static \Redis|int|false sintercard(array $keys, int $limit = -1)
|
||||
* @method static \Redis|int|false sInterStore(array|string $key, string ...$other_keys)
|
||||
* @method static \Redis|array|false sMembers(string $key)
|
||||
* @method static \Redis|array|false sMisMember(string $key, string $member, string ...$other_members)
|
||||
* @method static \Redis|bool sMove(string $src, string $dst, mixed $value)
|
||||
* @method static \Redis|array|string|false sPop(string $key, int $count = 0)
|
||||
* @method static mixed sRandMember(string $key, int $count = 0)
|
||||
* @method static \Redis|array|false sUnion(string $key, string ...$other_keys)
|
||||
* @method static \Redis|int|false sUnionStore(string $dst, string $key, string ...$other_keys)
|
||||
* @method static \Redis|bool save()
|
||||
* @method static array|false scan(string|int|null $iterator, string|null $pattern = null, int $count = 0, string|null $type = null)
|
||||
* @method static \Redis|int|false scard(string $key)
|
||||
* @method static mixed script(string $command, mixed ...$args)
|
||||
* @method static \Redis|bool select(int $db)
|
||||
* @method static \Redis|string|bool set(string $key, mixed $value, mixed $options = null)
|
||||
* @method static \Redis|int|false setBit(string $key, int $idx, bool $value)
|
||||
* @method static \Redis|int|false setRange(string $key, int $index, string $value)
|
||||
* @method static bool setOption(int $option, mixed $value)
|
||||
* @method static void setex(string $key, int $expire, mixed $value)
|
||||
* @method static \Redis|bool setnx(string $key, mixed $value)
|
||||
* @method static \Redis|bool sismember(string $key, mixed $value)
|
||||
* @method static \Redis|bool replicaof(string|null $host = null, int $port = 6379)
|
||||
* @method static \Redis|int|false touch(array|string $key_or_array, string ...$more_keys)
|
||||
* @method static mixed slowlog(string $operation, int $length = 0)
|
||||
* @method static mixed sort(string $key, array|null $options = null)
|
||||
* @method static mixed sort_ro(string $key, array|null $options = null)
|
||||
* @method static \Redis|int|false srem(string $key, mixed $value, mixed ...$other_values)
|
||||
* @method static array|false sscan(string $key, string|int|null $iterator, string|null $pattern = null, int $count = 0)
|
||||
* @method static bool ssubscribe(array $channels, callable $cb)
|
||||
* @method static \Redis|int|false strlen(string $key)
|
||||
* @method static \Redis|array|bool sunsubscribe(array $channels)
|
||||
* @method static \Redis|bool swapdb(int $src, int $dst)
|
||||
* @method static \Redis|array time()
|
||||
* @method static \Redis|int|false ttl(string $key)
|
||||
* @method static \Redis|int|false type(string $key)
|
||||
* @method static \Redis|int|false unlink(array|string $key, string ...$other_keys)
|
||||
* @method static \Redis|array|bool unsubscribe(array $channels)
|
||||
* @method static \Redis|bool unwatch()
|
||||
* @method static \Redis|bool watch(array|string $key, string ...$other_keys)
|
||||
* @method static int|false wait(int $numreplicas, int $timeout)
|
||||
* @method static int|false xack(string $key, string $group, array $ids)
|
||||
* @method static \Redis|string|false xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false, bool $nomkstream = false)
|
||||
* @method static \Redis|array|bool xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false)
|
||||
* @method static \Redis|array|bool xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options)
|
||||
* @method static \Redis|int|false xdel(string $key, array $ids)
|
||||
* @method static mixed xgroup(string $operation, string|null $key = null, string|null $group = null, string|null $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2)
|
||||
* @method static mixed xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1)
|
||||
* @method static \Redis|int|false xlen(string $key)
|
||||
* @method static \Redis|array|false xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null)
|
||||
* @method static \Redis|array|bool xrange(string $key, string $start, string $end, int $count = -1)
|
||||
* @method static \Redis|array|bool xread(array $streams, int $count = -1, int $block = -1)
|
||||
* @method static \Redis|array|bool xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1)
|
||||
* @method static \Redis|array|bool xrevrange(string $key, string $end, string $start, int $count = -1)
|
||||
* @method static \Redis|int|false vadd(string $key, array $values, mixed $element, array|null $options = null)
|
||||
* @method static \Redis|array|false vsim(string $key, mixed $member, array|null $options = null)
|
||||
* @method static \Redis|int|false vcard(string $key)
|
||||
* @method static \Redis|int|false vdim(string $key)
|
||||
* @method static \Redis|array|false vinfo(string $key)
|
||||
* @method static \Redis|bool vismember(string $key, mixed $member)
|
||||
* @method static \Redis|array|false vemb(string $key, mixed $member, bool $raw = false)
|
||||
* @method static \Redis|array|string|false vrandmember(string $key, int $count = 0)
|
||||
* @method static \Redis|array|false vrange(string $key, string $min, string $max, int $count = -1)
|
||||
* @method static \Redis|int|false vrem(string $key, mixed $member)
|
||||
* @method static \Redis|int|false vsetattr(string $key, mixed $member, array|string $attributes)
|
||||
* @method static \Redis|array|string|false vgetattr(string $key, mixed $member, bool $decode = true)
|
||||
* @method static \Redis|array|false vlinks(string $key, mixed $member, bool $withscores = false)
|
||||
* @method static \Redis|int|false xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1)
|
||||
* @method static \Redis|int|float|false zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)
|
||||
* @method static \Redis|int|false zCard(string $key)
|
||||
* @method static \Redis|int|false zCount(string $key, string|int $start, string|int $end)
|
||||
* @method static \Redis|float|false zIncrBy(string $key, float $value, mixed $member)
|
||||
* @method static \Redis|int|false zLexCount(string $key, string $min, string $max)
|
||||
* @method static \Redis|array|false zMscore(string $key, mixed $member, mixed ...$other_members)
|
||||
* @method static \Redis|array|false zPopMax(string $key, int|null $count = null)
|
||||
* @method static \Redis|array|false zPopMin(string $key, int|null $count = null)
|
||||
* @method static \Redis|array|false zRange(string $key, string|int $start, string|int $end, array|bool|null $options = null)
|
||||
* @method static \Redis|array|false zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1)
|
||||
* @method static \Redis|array|false zRangeByScore(string $key, string $start, string $end, array $options = [])
|
||||
* @method static \Redis|int|false zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = null)
|
||||
* @method static \Redis|array|string zRandMember(string $key, array|null $options = null)
|
||||
* @method static \Redis|int|false zRank(string $key, mixed $member)
|
||||
* @method static \Redis|int|false zRem(mixed $key, mixed $member, mixed ...$other_members)
|
||||
* @method static \Redis|int|false zRemRangeByLex(string $key, string $min, string $max)
|
||||
* @method static \Redis|int|false zRemRangeByRank(string $key, int $start, int $end)
|
||||
* @method static \Redis|int|false zRemRangeByScore(string $key, string $start, string $end)
|
||||
* @method static \Redis|array|false zRevRange(string $key, int $start, int $end, mixed $scores = null)
|
||||
* @method static \Redis|array|false zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1)
|
||||
* @method static \Redis|array|false zRevRangeByScore(string $key, string $max, string $min, array|bool $options = [])
|
||||
* @method static \Redis|int|false zRevRank(string $key, mixed $member)
|
||||
* @method static \Redis|float|false zScore(string $key, mixed $member)
|
||||
* @method static \Redis|array|false zdiff(array $keys, array|null $options = null)
|
||||
* @method static \Redis|int|false zdiffstore(string $dst, array $keys)
|
||||
* @method static \Redis|array|false zinter(array $keys, array|null $weights = null, array|null $options = null)
|
||||
* @method static \Redis|int|false zintercard(array $keys, int $limit = -1)
|
||||
* @method static \Redis|int|false zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)
|
||||
* @method static \Redis|array|false zscan(string $key, string|int|null $iterator, string|null $pattern = null, int $count = 0)
|
||||
* @method static \Redis|array|false zunion(array $keys, array|null $weights = null, array|null $options = null)
|
||||
* @method static \Redis|int|false zunionstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)
|
||||
*
|
||||
* @see \Illuminate\Redis\RedisManager
|
||||
*/
|
||||
|
||||
@@ -29,10 +29,10 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static string|null ip()
|
||||
* @method static array ips()
|
||||
* @method static string|null userAgent()
|
||||
* @method static array getAcceptableContentTypes()
|
||||
* @method static \Illuminate\Http\Request merge(array $input)
|
||||
* @method static \Illuminate\Http\Request mergeIfMissing(array $input)
|
||||
* @method static \Illuminate\Http\Request replace(array $input)
|
||||
* @method static mixed get(string $key, mixed $default = null)
|
||||
* @method static \Symfony\Component\HttpFoundation\InputBag|mixed json(string|null $key = null, mixed $default = null)
|
||||
* @method static \Illuminate\Http\Request createFrom(\Illuminate\Http\Request $from, \Illuminate\Http\Request|null $to = null)
|
||||
* @method static \Illuminate\Http\Request createFromBase(\Symfony\Component\HttpFoundation\Request $request)
|
||||
@@ -65,6 +65,8 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static string normalizeQueryString(string|null $qs)
|
||||
* @method static void enableHttpMethodParameterOverride()
|
||||
* @method static bool getHttpMethodParameterOverride()
|
||||
* @method static void setAllowedHttpMethodOverride(string[]|null $methods)
|
||||
* @method static string[]|null getAllowedHttpMethodOverride()
|
||||
* @method static bool hasPreviousSession()
|
||||
* @method static void setSession(\Symfony\Component\HttpFoundation\Session\SessionInterface $session)
|
||||
* @method static array getClientIps()
|
||||
@@ -92,8 +94,8 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static string getRealMethod()
|
||||
* @method static string|null getMimeType(string $format)
|
||||
* @method static string[] getMimeTypes(string $format)
|
||||
* @method static string|null getFormat(string|null $mimeType)
|
||||
* @method static void setFormat(string|null $format, string|string[] $mimeTypes)
|
||||
* @method static string|null getFormat(string|null $mimeType, bool $subtypeFallback = null)
|
||||
* @method static void setFormat(string $format, string|string[] $mimeTypes)
|
||||
* @method static string|null getRequestFormat(string|null $default = 'html')
|
||||
* @method static void setRequestFormat(string|null $format)
|
||||
* @method static string|null getContentTypeFormat()
|
||||
@@ -115,7 +117,6 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static string[] getLanguages()
|
||||
* @method static string[] getCharsets()
|
||||
* @method static string[] getEncodings()
|
||||
* @method static string[] getAcceptableContentTypes()
|
||||
* @method static bool isXmlHttpRequest()
|
||||
* @method static bool preferSafeContent()
|
||||
* @method static bool isFromTrustedProxy()
|
||||
@@ -125,10 +126,12 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool isJson()
|
||||
* @method static bool expectsJson()
|
||||
* @method static bool wantsJson()
|
||||
* @method static bool wantsMarkdown()
|
||||
* @method static bool accepts(string|array $contentTypes)
|
||||
* @method static string|null prefers(string|array $contentTypes)
|
||||
* @method static bool acceptsAnyContentType()
|
||||
* @method static bool acceptsJson()
|
||||
* @method static bool acceptsMarkdown()
|
||||
* @method static bool acceptsHtml()
|
||||
* @method static bool matchesType(string $actual, string $type)
|
||||
* @method static string format(string $default = 'html')
|
||||
@@ -144,7 +147,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static array keys()
|
||||
* @method static array all(mixed $keys = null)
|
||||
* @method static mixed input(string|null $key = null, mixed $default = null)
|
||||
* @method static \Illuminate\Support\Fluent fluent(array|string|null $key = null)
|
||||
* @method static \Illuminate\Support\Fluent fluent(array|string|null $key = null, array $default = [])
|
||||
* @method static string|array|null query(string|null $key = null, string|array|null $default = null)
|
||||
* @method static string|array|null post(string|null $key = null, string|array|null $default = null)
|
||||
* @method static bool hasCookie(string $key)
|
||||
@@ -169,8 +172,10 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool boolean(string|null $key = null, bool $default = false)
|
||||
* @method static int integer(string $key, int $default = 0)
|
||||
* @method static float float(string $key, float $default = 0)
|
||||
* @method static float|int clamp(string $key, int|float $min, int|float $max, int|float $default = 0)
|
||||
* @method static \Illuminate\Support\Carbon|null date(string $key, string|null $format = null, \UnitEnum|string|null $tz = null)
|
||||
* @method static \BackedEnum|null enum(string $key, string $enumClass, \BackedEnum|null $default = null)
|
||||
* @method static \Carbon\CarbonInterval|null interval(string $key, \Carbon\Unit|string|null $unit = null)
|
||||
* @method static \BackedEnum|\BackedEnum|null enum(string $key, string $enumClass, \BackedEnum|null $default = null)
|
||||
* @method static \BackedEnum[] enums(string $key, string $enumClass)
|
||||
* @method static array array(array|string|null $key = null)
|
||||
* @method static \Illuminate\Support\Collection collect(array|string|null $key = null)
|
||||
|
||||
@@ -14,7 +14,7 @@ use Illuminate\Console\Scheduling\Schedule as ConsoleSchedule;
|
||||
* @method static bool serverShouldRun(\Illuminate\Console\Scheduling\Event $event, \DateTimeInterface $time)
|
||||
* @method static \Illuminate\Support\Collection dueEvents(\Illuminate\Contracts\Foundation\Application $app)
|
||||
* @method static \Illuminate\Console\Scheduling\Event[] events()
|
||||
* @method static \Illuminate\Console\Scheduling\Schedule useCache(string $store)
|
||||
* @method static \Illuminate\Console\Scheduling\Schedule useCache(\UnitEnum|string $store)
|
||||
* @method static void macro(string $name, object|callable $macro)
|
||||
* @method static void mixin(object $mixin, bool $replace = true)
|
||||
* @method static bool hasMacro(string $name)
|
||||
@@ -76,6 +76,7 @@ use Illuminate\Console\Scheduling\Schedule as ConsoleSchedule;
|
||||
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes monthlyOn(int $dayOfMonth = 1, string $time = '0:0')
|
||||
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceMonthly(int $first = 1, int $second = 16, string $time = '0:0')
|
||||
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes lastDayOfMonth(string $time = '0:0')
|
||||
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes daysOfMonth(array|int ...$days)
|
||||
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes quarterly()
|
||||
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes quarterlyOn(int $dayOfQuarter = 1, string $time = '0:0')
|
||||
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes yearly()
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool hasColumns(string $table, array $columns)
|
||||
* @method static void whenTableHasColumn(string $table, string $column, \Closure $callback)
|
||||
* @method static void whenTableDoesntHaveColumn(string $table, string $column, \Closure $callback)
|
||||
* @method static void whenTableHasIndex(string $table, string|array $index, \Closure $callback, string|null $type = null)
|
||||
* @method static void whenTableDoesntHaveIndex(string $table, string|array $index, \Closure $callback, string|null $type = null)
|
||||
* @method static string getColumnType(string $table, string $column, bool $fullDefinition = false)
|
||||
* @method static array getColumnListing(string $table)
|
||||
* @method static array getColumns(string $table)
|
||||
@@ -40,6 +42,8 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool enableForeignKeyConstraints()
|
||||
* @method static bool disableForeignKeyConstraints()
|
||||
* @method static mixed withoutForeignKeyConstraints(\Closure $callback)
|
||||
* @method static void ensureVectorExtensionExists(string|null $schema = null)
|
||||
* @method static void ensureExtensionExists(string $name, string|null $schema = null)
|
||||
* @method static string[]|null getCurrentSchemaListing()
|
||||
* @method static string|null getCurrentSchemaName()
|
||||
* @method static array parseSchemaAndTable(string $reference, string|bool|null $withDefaultSchema = null)
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static int defaultRouteBlockLockSeconds()
|
||||
* @method static int defaultRouteBlockWaitSeconds()
|
||||
* @method static array getSessionConfig()
|
||||
* @method static string getDefaultDriver()
|
||||
* @method static string|null getDefaultDriver()
|
||||
* @method static void setDefaultDriver(string $name)
|
||||
* @method static mixed driver(string|null $driver = null)
|
||||
* @method static \Illuminate\Session\SessionManager extend(string $driver, \Closure $callback)
|
||||
@@ -22,27 +22,28 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static array all()
|
||||
* @method static array only(array $keys)
|
||||
* @method static array except(array $keys)
|
||||
* @method static bool exists(string|array $key)
|
||||
* @method static bool missing(string|array $key)
|
||||
* @method static bool has(string|array $key)
|
||||
* @method static bool hasAny(string|array $key)
|
||||
* @method static mixed get(string $key, mixed $default = null)
|
||||
* @method static mixed pull(string $key, mixed $default = null)
|
||||
* @method static bool exists(\UnitEnum|string|array $key)
|
||||
* @method static bool missing(\UnitEnum|string|array $key)
|
||||
* @method static bool has(\UnitEnum|string|array $key)
|
||||
* @method static bool hasAny(\UnitEnum|string|array $key)
|
||||
* @method static mixed get(\UnitEnum|string $key, mixed $default = null)
|
||||
* @method static mixed pull(\UnitEnum|string $key, mixed $default = null)
|
||||
* @method static bool hasOldInput(string|null $key = null)
|
||||
* @method static mixed getOldInput(string|null $key = null, mixed $default = null)
|
||||
* @method static void replace(array $attributes)
|
||||
* @method static void put(string|array $key, mixed $value = null)
|
||||
* @method static mixed remember(string $key, \Closure $callback)
|
||||
* @method static void push(string $key, mixed $value)
|
||||
* @method static mixed increment(string $key, int $amount = 1)
|
||||
* @method static int decrement(string $key, int $amount = 1)
|
||||
* @method static void flash(string $key, mixed $value = true)
|
||||
* @method static void now(string $key, mixed $value)
|
||||
* @method static void put(\UnitEnum|string|array $key, mixed $value = null)
|
||||
* @method static mixed remember(\UnitEnum|string $key, \Closure $callback)
|
||||
* @method static void push(\UnitEnum|string $key, mixed $value)
|
||||
* @method static mixed increment(\UnitEnum|string $key, int $amount = 1)
|
||||
* @method static int decrement(\UnitEnum|string $key, int $amount = 1)
|
||||
* @method static void flash(\UnitEnum|string $key, mixed $value = true)
|
||||
* @method static void now(\UnitEnum|string $key, mixed $value)
|
||||
* @method static void reflash()
|
||||
* @method static void keep(mixed $keys = null)
|
||||
* @method static void flashInput(array $value)
|
||||
* @method static mixed remove(string $key)
|
||||
* @method static void forget(string|array $keys)
|
||||
* @method static \Illuminate\Contracts\Cache\Repository cache()
|
||||
* @method static mixed remove(\UnitEnum|string $key)
|
||||
* @method static void forget(\UnitEnum|string|array $keys)
|
||||
* @method static void flush()
|
||||
* @method static bool invalidate()
|
||||
* @method static bool regenerate(bool $destroy = false)
|
||||
@@ -61,6 +62,8 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static \Illuminate\Support\Uri previousUri()
|
||||
* @method static string|null previousUrl()
|
||||
* @method static void setPreviousUrl(string $url)
|
||||
* @method static string|null previousRoute()
|
||||
* @method static void setPreviousRoute(string|null $route)
|
||||
* @method static void passwordConfirmed()
|
||||
* @method static \SessionHandlerInterface getHandler()
|
||||
* @method static \SessionHandlerInterface setHandler(\SessionHandlerInterface $handler)
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace Illuminate\Support\Facades;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
|
||||
use function Illuminate\Support\enum_value;
|
||||
|
||||
/**
|
||||
* @method static \Illuminate\Contracts\Filesystem\Filesystem drive(string|null $name = null)
|
||||
* @method static \Illuminate\Contracts\Filesystem\Filesystem disk(\UnitEnum|string|null $name = null)
|
||||
@@ -61,6 +63,7 @@ use Illuminate\Filesystem\Filesystem;
|
||||
* @method static string|false mimeType(string $path)
|
||||
* @method static string url(string $path)
|
||||
* @method static bool providesTemporaryUrls()
|
||||
* @method static bool providesTemporaryUploadUrls()
|
||||
* @method static string temporaryUrl(string $path, \DateTimeInterface $expiration, array $options = [])
|
||||
* @method static array temporaryUploadUrl(string $path, \DateTimeInterface $expiration, array $options = [])
|
||||
* @method static \League\Flysystem\FilesystemOperator getDriver()
|
||||
@@ -68,6 +71,7 @@ use Illuminate\Filesystem\Filesystem;
|
||||
* @method static array getConfig()
|
||||
* @method static void serveUsing(\Closure $callback)
|
||||
* @method static void buildTemporaryUrlsUsing(\Closure $callback)
|
||||
* @method static void buildTemporaryUploadUrlsUsing(\Closure $callback)
|
||||
* @method static \Illuminate\Filesystem\FilesystemAdapter|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
|
||||
* @method static \Illuminate\Filesystem\FilesystemAdapter|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
|
||||
* @method static void macro(string $name, object|callable $macro)
|
||||
@@ -90,13 +94,13 @@ class Storage extends Facade
|
||||
/**
|
||||
* Replace the given disk with a local testing disk.
|
||||
*
|
||||
* @param string|null $disk
|
||||
* @param \UnitEnum|string|null $disk
|
||||
* @param array $config
|
||||
* @return \Illuminate\Contracts\Filesystem\Filesystem
|
||||
* @return \Illuminate\Filesystem\LocalFilesystemAdapter
|
||||
*/
|
||||
public static function fake($disk = null, array $config = [])
|
||||
{
|
||||
$root = self::getRootPath($disk = $disk ?: static::$app['config']->get('filesystems.default'));
|
||||
$root = self::getRootPath($disk = enum_value($disk) ?: static::$app['config']->get('filesystems.default'));
|
||||
|
||||
if ($token = ParallelTesting::token()) {
|
||||
$root = "{$root}_test_{$token}";
|
||||
@@ -108,21 +112,27 @@ class Storage extends Facade
|
||||
self::buildDiskConfiguration($disk, $config, root: $root)
|
||||
));
|
||||
|
||||
return tap($fake)->buildTemporaryUrlsUsing(function ($path, $expiration) {
|
||||
return URL::to($path.'?expiration='.$expiration->getTimestamp());
|
||||
return tap($fake, function ($fake) {
|
||||
$fake->buildTemporaryUrlsUsing(function ($path, $expiration) {
|
||||
return URL::to($path.'?expiration='.$expiration->getTimestamp());
|
||||
});
|
||||
|
||||
$fake->buildTemporaryUploadUrlsUsing(function ($path, $expiration) {
|
||||
return ['url' => URL::to($path.'?expiration='.$expiration->getTimestamp()), 'headers' => []];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the given disk with a persistent local testing disk.
|
||||
*
|
||||
* @param string|null $disk
|
||||
* @param \UnitEnum|string|null $disk
|
||||
* @param array $config
|
||||
* @return \Illuminate\Contracts\Filesystem\Filesystem
|
||||
* @return \Illuminate\Filesystem\LocalFilesystemAdapter
|
||||
*/
|
||||
public static function persistentFake($disk = null, array $config = [])
|
||||
{
|
||||
$disk = $disk ?: static::$app['config']->get('filesystems.default');
|
||||
$disk = enum_value($disk) ?: static::$app['config']->get('filesystems.default');
|
||||
|
||||
static::set($disk, $fake = static::createLocalDriver(
|
||||
self::buildDiskConfiguration($disk, $config, root: self::getRootPath($disk))
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static void startPrepend(string $section, string $content = '')
|
||||
* @method static string stopPrepend()
|
||||
* @method static string yieldPushContent(string $section, string $default = '')
|
||||
* @method static bool isStackEmpty(string $section)
|
||||
* @method static void flushStacks()
|
||||
* @method static void startTranslation(array $replacements = [])
|
||||
* @method static string renderTranslation()
|
||||
|
||||
5
plugins/vendor/illuminate/support/Fluent.php
vendored
5
plugins/vendor/illuminate/support/Fluent.php
vendored
@@ -153,7 +153,7 @@ class Fluent implements Arrayable, ArrayAccess, IteratorAggregate, Jsonable, Jso
|
||||
/**
|
||||
* Get data from the fluent instance.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|null $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -206,8 +206,7 @@ class Fluent implements Arrayable, ArrayAccess, IteratorAggregate, Jsonable, Jso
|
||||
/**
|
||||
* Convert the fluent instance to pretty print formatted JSON.
|
||||
*
|
||||
* @params int $options
|
||||
*
|
||||
* @param int $options
|
||||
* @return string
|
||||
*/
|
||||
public function toPrettyJson(int $options = 0)
|
||||
|
||||
@@ -67,7 +67,7 @@ trait InteractsWithTime
|
||||
* Given a start time, format the total run time for human readability.
|
||||
*
|
||||
* @param float $startTime
|
||||
* @param float $endTime
|
||||
* @param float|null $endTime
|
||||
* @return string
|
||||
*/
|
||||
protected function runTimeForHumans($startTime, $endTime = null)
|
||||
|
||||
4
plugins/vendor/illuminate/support/Js.php
vendored
4
plugins/vendor/illuminate/support/Js.php
vendored
@@ -93,6 +93,8 @@ class Js implements Htmlable, Stringable
|
||||
/**
|
||||
* Encode the given data as JSON.
|
||||
*
|
||||
* Invalid UTF-8 sequences are replaced with <20> instead of throwing.
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param int $flags
|
||||
* @param int $depth
|
||||
@@ -110,7 +112,7 @@ class Js implements Htmlable, Stringable
|
||||
$data = $data->toArray();
|
||||
}
|
||||
|
||||
return json_encode($data, $flags | static::REQUIRED_FLAGS, $depth);
|
||||
return json_encode($data, $flags | static::REQUIRED_FLAGS | JSON_INVALID_UTF8_SUBSTITUTE, $depth);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,7 @@ abstract class Manager
|
||||
/**
|
||||
* Get the default driver name.
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
abstract public function getDefaultDriver();
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ class MessageBag implements Jsonable, JsonSerializable, MessageBagContract, Mess
|
||||
$all = [];
|
||||
|
||||
foreach ($this->messages as $key => $messages) {
|
||||
$all = array_merge($all, $this->transform($messages, $format, $key));
|
||||
array_push($all, ...$this->transform($messages, $format, $key));
|
||||
}
|
||||
|
||||
return $all;
|
||||
@@ -434,8 +434,7 @@ class MessageBag implements Jsonable, JsonSerializable, MessageBagContract, Mess
|
||||
/**
|
||||
* Convert the object to pretty print formatted JSON.
|
||||
*
|
||||
* @params int $options
|
||||
*
|
||||
* @param int $options
|
||||
* @return string
|
||||
*/
|
||||
public function toPrettyJson(int $options = 0)
|
||||
|
||||
36
plugins/vendor/illuminate/support/Number.php
vendored
36
plugins/vendor/illuminate/support/Number.php
vendored
@@ -56,7 +56,7 @@ class Number
|
||||
* @param string|null $locale
|
||||
* @return int|float|false
|
||||
*/
|
||||
public static function parse(string $string, ?int $type = NumberFormatter::TYPE_DOUBLE, ?string $locale = null): int|float
|
||||
public static function parse(string $string, ?int $type = NumberFormatter::TYPE_DOUBLE, ?string $locale = null): int|float|false
|
||||
{
|
||||
static::ensureIntlExtensionIsInstalled();
|
||||
|
||||
@@ -72,7 +72,7 @@ class Number
|
||||
* @param string|null $locale
|
||||
* @return int|false
|
||||
*/
|
||||
public static function parseInt(string $string, ?string $locale = null): int
|
||||
public static function parseInt(string $string, ?string $locale = null): int|false
|
||||
{
|
||||
return self::parse($string, NumberFormatter::TYPE_INT32, $locale);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ class Number
|
||||
* @param string|null $locale
|
||||
* @return float|false
|
||||
*/
|
||||
public static function parseFloat(string $string, ?string $locale = null): float
|
||||
public static function parseFloat(string $string, ?string $locale = null): float|false
|
||||
{
|
||||
return self::parse($string, NumberFormatter::TYPE_DOUBLE, $locale);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ class Number
|
||||
|
||||
$unitCount = count($units);
|
||||
|
||||
for ($i = 0; ($bytes / 1024) > 0.9 && ($i < $unitCount - 1); $i++) {
|
||||
for ($i = 0; (abs($bytes) / 1024) > 0.9 && ($i < $unitCount - 1); $i++) {
|
||||
$bytes /= 1024;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class Number
|
||||
* @param int|float $number
|
||||
* @param int $precision
|
||||
* @param int|null $maxPrecision
|
||||
* @return bool|string
|
||||
* @return string|false
|
||||
*/
|
||||
public static function abbreviate(int|float $number, int $precision = 0, ?int $maxPrecision = null)
|
||||
{
|
||||
@@ -277,7 +277,7 @@ class Number
|
||||
}
|
||||
|
||||
switch (true) {
|
||||
case floatval($number) === 0.0:
|
||||
case (float) $number === 0.0:
|
||||
return $precision > 0 ? static::format(0, $precision, $maxPrecision) : '0';
|
||||
case $number < 0:
|
||||
return sprintf('-%s', static::summarize(abs($number), $precision, $maxPrecision, $units));
|
||||
@@ -312,10 +312,16 @@ class Number
|
||||
* @param int|float $by
|
||||
* @param int|float $start
|
||||
* @param int|float $offset
|
||||
* @return array
|
||||
* @return list<array{int|float, int|float}>
|
||||
*/
|
||||
public static function pairs(int|float $to, int|float $by, int|float $start = 0, int|float $offset = 1)
|
||||
{
|
||||
if ($by == 0) {
|
||||
throw new \InvalidArgumentException('The $by argument must not be zero.');
|
||||
}
|
||||
|
||||
$by = abs($by);
|
||||
|
||||
$output = [];
|
||||
|
||||
for ($lower = $start; $lower < $to; $lower += $by) {
|
||||
@@ -339,15 +345,21 @@ class Number
|
||||
*/
|
||||
public static function trim(int|float $number)
|
||||
{
|
||||
if (is_infinite($number) || is_nan($number)) {
|
||||
return $number;
|
||||
}
|
||||
|
||||
return json_decode(json_encode($number));
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the given callback using the given locale.
|
||||
*
|
||||
* @template TReturn
|
||||
*
|
||||
* @param string $locale
|
||||
* @param callable $callback
|
||||
* @return mixed
|
||||
* @param callable(): TReturn $callback
|
||||
* @return TReturn
|
||||
*/
|
||||
public static function withLocale(string $locale, callable $callback)
|
||||
{
|
||||
@@ -365,9 +377,11 @@ class Number
|
||||
/**
|
||||
* Execute the given callback using the given currency.
|
||||
*
|
||||
* @template TReturn
|
||||
*
|
||||
* @param string $currency
|
||||
* @param callable $callback
|
||||
* @return mixed
|
||||
* @param callable(): TReturn $callback
|
||||
* @return TReturn
|
||||
*/
|
||||
public static function withCurrency(string $currency, callable $callback)
|
||||
{
|
||||
|
||||
211
plugins/vendor/illuminate/support/Reflector.php
vendored
211
plugins/vendor/illuminate/support/Reflector.php
vendored
@@ -1,211 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Support;
|
||||
|
||||
use ReflectionAttribute;
|
||||
use ReflectionClass;
|
||||
use ReflectionEnum;
|
||||
use ReflectionMethod;
|
||||
use ReflectionNamedType;
|
||||
use ReflectionUnionType;
|
||||
|
||||
class Reflector
|
||||
{
|
||||
/**
|
||||
* This is a PHP 7.4 compatible implementation of is_callable.
|
||||
*
|
||||
* @param mixed $var
|
||||
* @param bool $syntaxOnly
|
||||
* @return bool
|
||||
*/
|
||||
public static function isCallable($var, $syntaxOnly = false)
|
||||
{
|
||||
if (! is_array($var)) {
|
||||
return is_callable($var, $syntaxOnly);
|
||||
}
|
||||
|
||||
if (! isset($var[0], $var[1]) || ! is_string($var[1] ?? null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($syntaxOnly &&
|
||||
(is_string($var[0]) || is_object($var[0])) &&
|
||||
is_string($var[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$class = is_object($var[0]) ? get_class($var[0]) : $var[0];
|
||||
|
||||
$method = $var[1];
|
||||
|
||||
if (! class_exists($class)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (method_exists($class, $method)) {
|
||||
return (new ReflectionMethod($class, $method))->isPublic();
|
||||
}
|
||||
|
||||
if (is_object($var[0]) && method_exists($class, '__call')) {
|
||||
return (new ReflectionMethod($class, '__call'))->isPublic();
|
||||
}
|
||||
|
||||
if (! is_object($var[0]) && method_exists($class, '__callStatic')) {
|
||||
return (new ReflectionMethod($class, '__callStatic'))->isPublic();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the specified class attribute, optionally following an inheritance chain.
|
||||
*
|
||||
* @template TAttribute of object
|
||||
*
|
||||
* @param object|class-string $objectOrClass
|
||||
* @param class-string<TAttribute> $attribute
|
||||
* @return TAttribute|null
|
||||
*/
|
||||
public static function getClassAttribute($objectOrClass, $attribute, $ascend = false)
|
||||
{
|
||||
return static::getClassAttributes($objectOrClass, $attribute, $ascend)->flatten()->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the specified class attribute(s), optionally following an inheritance chain.
|
||||
*
|
||||
* @template TTarget of object
|
||||
* @template TAttribute of object
|
||||
*
|
||||
* @param TTarget|class-string<TTarget> $objectOrClass
|
||||
* @param class-string<TAttribute> $attribute
|
||||
* @return ($includeParents is true ? Collection<class-string<contravariant TTarget>, Collection<int, TAttribute>> : Collection<int, TAttribute>)
|
||||
*/
|
||||
public static function getClassAttributes($objectOrClass, $attribute, $includeParents = false)
|
||||
{
|
||||
$reflectionClass = new ReflectionClass($objectOrClass);
|
||||
|
||||
$attributes = [];
|
||||
|
||||
do {
|
||||
$attributes[$reflectionClass->name] = new Collection(array_map(
|
||||
fn (ReflectionAttribute $reflectionAttribute) => $reflectionAttribute->newInstance(),
|
||||
$reflectionClass->getAttributes($attribute)
|
||||
));
|
||||
} while ($includeParents && false !== $reflectionClass = $reflectionClass->getParentClass());
|
||||
|
||||
return $includeParents ? new Collection($attributes) : array_first($attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class name of the given parameter's type, if possible.
|
||||
*
|
||||
* @param \ReflectionParameter $parameter
|
||||
* @return string|null
|
||||
*/
|
||||
public static function getParameterClassName($parameter)
|
||||
{
|
||||
$type = $parameter->getType();
|
||||
|
||||
if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
return static::getTypeName($parameter, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class names of the given parameter's type, including union types.
|
||||
*
|
||||
* @param \ReflectionParameter $parameter
|
||||
* @return array
|
||||
*/
|
||||
public static function getParameterClassNames($parameter)
|
||||
{
|
||||
$type = $parameter->getType();
|
||||
|
||||
if (! $type instanceof ReflectionUnionType) {
|
||||
return array_filter([static::getParameterClassName($parameter)]);
|
||||
}
|
||||
|
||||
$unionTypes = [];
|
||||
|
||||
foreach ($type->getTypes() as $listedType) {
|
||||
if (! $listedType instanceof ReflectionNamedType || $listedType->isBuiltin()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$unionTypes[] = static::getTypeName($parameter, $listedType);
|
||||
}
|
||||
|
||||
return array_filter($unionTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the given type's class name.
|
||||
*
|
||||
* @param \ReflectionParameter $parameter
|
||||
* @param \ReflectionNamedType $type
|
||||
* @return string
|
||||
*/
|
||||
protected static function getTypeName($parameter, $type)
|
||||
{
|
||||
$name = $type->getName();
|
||||
|
||||
if (! is_null($class = $parameter->getDeclaringClass())) {
|
||||
if ($name === 'self') {
|
||||
return $class->getName();
|
||||
}
|
||||
|
||||
if ($name === 'parent' && $parent = $class->getParentClass()) {
|
||||
return $parent->getName();
|
||||
}
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the parameter's type is a subclass of the given type.
|
||||
*
|
||||
* @param \ReflectionParameter $parameter
|
||||
* @param string $className
|
||||
* @return bool
|
||||
*/
|
||||
public static function isParameterSubclassOf($parameter, $className)
|
||||
{
|
||||
$paramClassName = static::getParameterClassName($parameter);
|
||||
|
||||
return $paramClassName
|
||||
&& (class_exists($paramClassName) || interface_exists($paramClassName))
|
||||
&& (new ReflectionClass($paramClassName))->isSubclassOf($className);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the parameter's type is a Backed Enum with a string backing type.
|
||||
*
|
||||
* @param \ReflectionParameter $parameter
|
||||
* @return bool
|
||||
*/
|
||||
public static function isParameterBackedEnumWithStringBackingType($parameter)
|
||||
{
|
||||
if (! $parameter->getType() instanceof ReflectionNamedType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$backedEnumClass = $parameter->getType()?->getName();
|
||||
|
||||
if (is_null($backedEnumClass)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (enum_exists($backedEnumClass)) {
|
||||
$reflectionBackedEnum = new ReflectionEnum($backedEnumClass);
|
||||
|
||||
return $reflectionBackedEnum->isBacked()
|
||||
&& $reflectionBackedEnum->getBackingType()->getName() == 'string';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,13 @@ abstract class ServiceProvider
|
||||
*/
|
||||
public static array $optimizeClearCommands = [];
|
||||
|
||||
/**
|
||||
* Commands that should be run during the "reload" command.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
public static array $reloadCommands = [];
|
||||
|
||||
/**
|
||||
* Create a new service provider instance.
|
||||
*
|
||||
@@ -482,6 +489,39 @@ abstract class ServiceProvider
|
||||
* @return void
|
||||
*/
|
||||
protected function optimizes(?string $optimize = null, ?string $clear = null, ?string $key = null)
|
||||
{
|
||||
$key = $this->getProviderKey($key);
|
||||
|
||||
if ($optimize) {
|
||||
static::$optimizeCommands[$key] = $optimize;
|
||||
}
|
||||
|
||||
if ($clear) {
|
||||
static::$optimizeClearCommands[$key] = $clear;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands that should run on "reload".
|
||||
*
|
||||
* @param string|null $reload
|
||||
* @param string|null $key
|
||||
* @return void
|
||||
*/
|
||||
protected function reloads(string $reload, ?string $key = null)
|
||||
{
|
||||
$key = $this->getProviderKey($key);
|
||||
|
||||
static::$reloadCommands[$key] = $reload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a short descriptive key for the current service provider.
|
||||
*
|
||||
* @param string|null $key
|
||||
* @return string
|
||||
*/
|
||||
protected function getProviderKey(?string $key = null): string
|
||||
{
|
||||
$key ??= (string) Str::of(get_class($this))
|
||||
->classBasename()
|
||||
@@ -494,13 +534,7 @@ abstract class ServiceProvider
|
||||
$key = class_basename(get_class($this));
|
||||
}
|
||||
|
||||
if ($optimize) {
|
||||
static::$optimizeCommands[$key] = $optimize;
|
||||
}
|
||||
|
||||
if ($clear) {
|
||||
static::$optimizeClearCommands[$key] = $clear;
|
||||
}
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -547,7 +581,7 @@ abstract class ServiceProvider
|
||||
* Add the given provider to the application's provider bootstrap file.
|
||||
*
|
||||
* @param string $provider
|
||||
* @param string $path
|
||||
* @param string|null $path
|
||||
* @return bool
|
||||
*/
|
||||
public static function addProviderToBootstrapFile(string $provider, ?string $path = null)
|
||||
@@ -572,6 +606,51 @@ abstract class ServiceProvider
|
||||
|
||||
$content = '<?php
|
||||
|
||||
return [
|
||||
'.$providers.'
|
||||
];';
|
||||
|
||||
file_put_contents($path, $content.PHP_EOL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a provider from the application's provider bootstrap file.
|
||||
*
|
||||
* @param string|array $providersToRemove
|
||||
* @param string|null $path
|
||||
* @param bool $strict
|
||||
* @return bool
|
||||
*/
|
||||
public static function removeProviderFromBootstrapFile(string|array $providersToRemove, ?string $path = null, bool $strict = false)
|
||||
{
|
||||
$path ??= app()->getBootstrapProvidersPath();
|
||||
|
||||
if (! file_exists($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (function_exists('opcache_invalidate')) {
|
||||
opcache_invalidate($path, true);
|
||||
}
|
||||
|
||||
$providersToRemove = Arr::wrap($providersToRemove);
|
||||
|
||||
$providers = (new Collection(require $path))
|
||||
->unique()
|
||||
->sort()
|
||||
->values()
|
||||
->when(
|
||||
$strict,
|
||||
static fn (Collection $providerCollection) => $providerCollection->reject(fn (string $p) => in_array($p, $providersToRemove, true)),
|
||||
static fn (Collection $providerCollection) => $providerCollection->reject(fn (string $p) => Str::contains($p, $providersToRemove))
|
||||
)
|
||||
->map(fn ($p) => ' '.$p.'::class,')
|
||||
->implode(PHP_EOL);
|
||||
|
||||
$content = '<?php
|
||||
|
||||
return [
|
||||
'.$providers.'
|
||||
];';
|
||||
|
||||
209
plugins/vendor/illuminate/support/Str.php
vendored
209
plugins/vendor/illuminate/support/Str.php
vendored
@@ -34,42 +34,42 @@ class Str
|
||||
/**
|
||||
* The cache of snake-cased words.
|
||||
*
|
||||
* @var array
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static $snakeCache = [];
|
||||
|
||||
/**
|
||||
* The cache of camel-cased words.
|
||||
*
|
||||
* @var array
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static $camelCache = [];
|
||||
|
||||
/**
|
||||
* The cache of studly-cased words.
|
||||
*
|
||||
* @var array
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static $studlyCache = [];
|
||||
|
||||
/**
|
||||
* The callback that should be used to generate UUIDs.
|
||||
*
|
||||
* @var callable|null
|
||||
* @var (callable(): \Ramsey\Uuid\UuidInterface)|null
|
||||
*/
|
||||
protected static $uuidFactory;
|
||||
|
||||
/**
|
||||
* The callback that should be used to generate ULIDs.
|
||||
*
|
||||
* @var callable|null
|
||||
* @var (callable(): \Symfony\Component\Uid\Ulid)|null
|
||||
*/
|
||||
protected static $ulidFactory;
|
||||
|
||||
/**
|
||||
* The callback that should be used to generate random strings.
|
||||
*
|
||||
* @var callable|null
|
||||
* @var (callable(int): string)|null
|
||||
*/
|
||||
protected static $randomStringFactory;
|
||||
|
||||
@@ -109,13 +109,13 @@ class Str
|
||||
return $subject;
|
||||
}
|
||||
|
||||
$position = strrpos($subject, (string) $search);
|
||||
$position = mb_strrpos($subject, $search);
|
||||
|
||||
if ($position === false) {
|
||||
return $subject;
|
||||
}
|
||||
|
||||
return substr($subject, $position + strlen($search));
|
||||
return static::substr($subject, $position + static::length($search));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,7 +221,7 @@ class Str
|
||||
* Convert a value to camel case.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @return ($value is '' ? '' : string)
|
||||
*/
|
||||
public static function camel($value)
|
||||
{
|
||||
@@ -254,14 +254,14 @@ class Str
|
||||
* Remove the given string(s) if it exists at the start of the haystack.
|
||||
*
|
||||
* @param string $subject
|
||||
* @param string|array $needle
|
||||
* @param string|string[] $needle
|
||||
* @return string
|
||||
*/
|
||||
public static function chopStart($subject, $needle)
|
||||
{
|
||||
foreach ((array) $needle as $n) {
|
||||
if (str_starts_with($subject, $n)) {
|
||||
return substr($subject, strlen($n));
|
||||
if ($n !== '' && str_starts_with($subject, $n)) {
|
||||
return mb_substr($subject, mb_strlen($n));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,14 +272,14 @@ class Str
|
||||
* Remove the given string(s) if it exists at the end of the haystack.
|
||||
*
|
||||
* @param string $subject
|
||||
* @param string|array $needle
|
||||
* @param string|string[] $needle
|
||||
* @return string
|
||||
*/
|
||||
public static function chopEnd($subject, $needle)
|
||||
{
|
||||
foreach ((array) $needle as $n) {
|
||||
if (str_ends_with($subject, $n)) {
|
||||
return substr($subject, 0, -strlen($n));
|
||||
if ($n !== '' && str_ends_with($subject, $n)) {
|
||||
return mb_substr($subject, 0, -mb_strlen($n));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ class Str
|
||||
* @param string $haystack
|
||||
* @param string|iterable<string> $needles
|
||||
* @param bool $ignoreCase
|
||||
* @return bool
|
||||
* @return ($needles is array{} ? false : ($haystack is non-empty-string ? bool : false))
|
||||
*/
|
||||
public static function contains($haystack, $needles, $ignoreCase = false)
|
||||
{
|
||||
@@ -327,7 +327,7 @@ class Str
|
||||
* @param string $haystack
|
||||
* @param iterable<string> $needles
|
||||
* @param bool $ignoreCase
|
||||
* @return bool
|
||||
* @return ($needles is array{} ? false : ($haystack is non-empty-string ? bool : false))
|
||||
*/
|
||||
public static function containsAll($haystack, $needles, $ignoreCase = false)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ class Str
|
||||
* @param string $haystack
|
||||
* @param string|iterable<string> $needles
|
||||
* @param bool $ignoreCase
|
||||
* @return bool
|
||||
* @return ($needles is array{} ? true : ($haystack is non-empty-string ? bool : true))
|
||||
*/
|
||||
public static function doesntContain($haystack, $needles, $ignoreCase = false)
|
||||
{
|
||||
@@ -357,9 +357,9 @@ class Str
|
||||
* Convert the case of a string.
|
||||
*
|
||||
* @param string $string
|
||||
* @param int $mode
|
||||
* @param MB_CASE_UPPER|MB_CASE_LOWER|MB_CASE_TITLE|MB_CASE_FOLD|MB_CASE_UPPER_SIMPLE|MB_CASE_LOWER_SIMPLE|MB_CASE_TITLE_SIMPLE|MB_CASE_FOLD_SIMPLE $mode
|
||||
* @param string|null $encoding
|
||||
* @return string
|
||||
* @return ($string is '' ? '' : string)
|
||||
*/
|
||||
public static function convertCase(string $string, int $mode = MB_CASE_FOLD, ?string $encoding = 'UTF-8')
|
||||
{
|
||||
@@ -371,7 +371,7 @@ class Str
|
||||
*
|
||||
* @param string $string
|
||||
* @param array<string>|string $characters
|
||||
* @return string
|
||||
* @return ($string is '' ? '' : string)
|
||||
*/
|
||||
public static function deduplicate(string $string, array|string $characters = ' ')
|
||||
{
|
||||
@@ -391,7 +391,7 @@ class Str
|
||||
*
|
||||
* @param string $haystack
|
||||
* @param string|iterable<string> $needles
|
||||
* @return bool
|
||||
* @return ($needles is array{} ? false : ($haystack is non-empty-string ? bool : false))
|
||||
*/
|
||||
public static function endsWith($haystack, $needles)
|
||||
{
|
||||
@@ -417,7 +417,7 @@ class Str
|
||||
*
|
||||
* @param string $haystack
|
||||
* @param string|iterable<string> $needles
|
||||
* @return bool
|
||||
* @return ($needles is array{} ? true : ($haystack is non-empty-string ? bool : true))
|
||||
*/
|
||||
public static function doesntEndWith($haystack, $needles)
|
||||
{
|
||||
@@ -429,7 +429,7 @@ class Str
|
||||
*
|
||||
* @param string $text
|
||||
* @param string $phrase
|
||||
* @param array $options
|
||||
* @param array{radius?: int|float, omission?: string} $options
|
||||
* @return string|null
|
||||
*/
|
||||
public static function excerpt($text, $phrase = '', $options = [])
|
||||
@@ -465,7 +465,7 @@ class Str
|
||||
*
|
||||
* @param string $value
|
||||
* @param string $cap
|
||||
* @return string
|
||||
* @return ($value is '' ? ($cap is '' ? '' : non-empty-string) : non-empty-string)
|
||||
*/
|
||||
public static function finish($value, $cap)
|
||||
{
|
||||
@@ -480,7 +480,7 @@ class Str
|
||||
* @param string $value
|
||||
* @param string $before
|
||||
* @param string|null $after
|
||||
* @return string
|
||||
* @return ($value is '' ? ($before is '' ? ($after is '' ? '' : ($after is null ? '' : non-empty-string)) : non-empty-string) : non-empty-string)
|
||||
*/
|
||||
public static function wrap($value, $before, $after = null)
|
||||
{
|
||||
@@ -569,6 +569,8 @@ class Str
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*
|
||||
* @phpstan-assert-if-true =non-empty-string $value
|
||||
*/
|
||||
public static function isJson($value)
|
||||
{
|
||||
@@ -583,8 +585,10 @@ class Str
|
||||
* Determine if a given value is a valid URL.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param array $protocols
|
||||
* @param string[] $protocols
|
||||
* @return bool
|
||||
*
|
||||
* @phpstan-assert-if-true =non-empty-string $value
|
||||
*/
|
||||
public static function isUrl($value, array $protocols = [])
|
||||
{
|
||||
@@ -605,10 +609,21 @@ class Str
|
||||
(LARAVEL_PROTOCOLS):// # protocol
|
||||
(((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+)@)? # basic auth
|
||||
(
|
||||
([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
|
||||
| # or
|
||||
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address
|
||||
| # or
|
||||
(?:
|
||||
(?:
|
||||
(?:[\pL\pN\pS\pM\-\_]++\.)+
|
||||
(?:
|
||||
(?:xn--[a-z0-9-]++) # punycode in tld
|
||||
|
|
||||
(?:[\pL\pN\pM]++) # no punycode in tld
|
||||
)
|
||||
) # a multi-level domain name
|
||||
|
|
||||
[a-z0-9\-\_]++ # a single-level domain name
|
||||
)\.?
|
||||
| # or
|
||||
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address
|
||||
| # or
|
||||
\[
|
||||
(?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))
|
||||
\] # an IPv6 address
|
||||
@@ -628,6 +643,8 @@ class Str
|
||||
* @param mixed $value
|
||||
* @param int<0, 8>|'nil'|'max'|null $version
|
||||
* @return bool
|
||||
*
|
||||
* @phpstan-assert-if-true =non-empty-string $value
|
||||
*/
|
||||
public static function isUuid($value, $version = null)
|
||||
{
|
||||
@@ -669,6 +686,8 @@ class Str
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*
|
||||
* @phpstan-assert-if-true =non-empty-string $value
|
||||
*/
|
||||
public static function isUlid($value)
|
||||
{
|
||||
@@ -683,7 +702,7 @@ class Str
|
||||
* Convert a string to kebab case.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @return ($value is '' ? '' : string)
|
||||
*/
|
||||
public static function kebab($value)
|
||||
{
|
||||
@@ -695,7 +714,7 @@ class Str
|
||||
*
|
||||
* @param string $value
|
||||
* @param string|null $encoding
|
||||
* @return int
|
||||
* @return non-negative-int
|
||||
*/
|
||||
public static function length($value, $encoding = null)
|
||||
{
|
||||
@@ -736,7 +755,7 @@ class Str
|
||||
* Convert the given string to lower-case.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @return ($value is '' ? '' : non-empty-string&lowercase-string)
|
||||
*/
|
||||
public static function lower($value)
|
||||
{
|
||||
@@ -767,8 +786,8 @@ class Str
|
||||
*
|
||||
* @param string $string
|
||||
* @param array $options
|
||||
* @param array $extensions
|
||||
* @return string
|
||||
* @param \League\CommonMark\Extension\ExtensionInterface[] $extensions
|
||||
* @return ($string is '' ? '' : string)
|
||||
*/
|
||||
public static function markdown($string, array $options = [], array $extensions = [])
|
||||
{
|
||||
@@ -788,8 +807,8 @@ class Str
|
||||
*
|
||||
* @param string $string
|
||||
* @param array $options
|
||||
* @param array $extensions
|
||||
* @return string
|
||||
* @param \League\CommonMark\Extension\ExtensionInterface[] $extensions
|
||||
* @return ($string is '' ? '' : string)
|
||||
*/
|
||||
public static function inlineMarkdown($string, array $options = [], array $extensions = [])
|
||||
{
|
||||
@@ -866,7 +885,7 @@ class Str
|
||||
*
|
||||
* @param string|iterable<string> $pattern
|
||||
* @param string $value
|
||||
* @return bool
|
||||
* @return ($pattern is array{} ? false : bool)
|
||||
*/
|
||||
public static function isMatch($pattern, $value)
|
||||
{
|
||||
@@ -988,6 +1007,10 @@ class Str
|
||||
*/
|
||||
public static function plural($value, $count = 2, $prependCount = false)
|
||||
{
|
||||
if (is_countable($count)) {
|
||||
$count = count($count);
|
||||
}
|
||||
|
||||
return ($prependCount ? Number::format($count).' ' : '').Pluralizer::plural($value, $count);
|
||||
}
|
||||
|
||||
@@ -1027,7 +1050,7 @@ class Str
|
||||
* @param bool $numbers
|
||||
* @param bool $symbols
|
||||
* @param bool $spaces
|
||||
* @return string
|
||||
* @return ($letters is false ? ($numbers is true ? ($symbols is false ? ($spaces is false ? numeric-string : string) : string) : string) : string)
|
||||
*/
|
||||
public static function password($length = 32, $letters = true, $numbers = true, $symbols = true, $spaces = false)
|
||||
{
|
||||
@@ -1069,7 +1092,7 @@ class Str
|
||||
* @param string $needle
|
||||
* @param int $offset
|
||||
* @param string|null $encoding
|
||||
* @return int|false
|
||||
* @return ($haystack is '' ? false : ($needle is '' ? false : int|false))
|
||||
*/
|
||||
public static function position($haystack, $needle, $offset = 0, $encoding = null)
|
||||
{
|
||||
@@ -1104,7 +1127,7 @@ class Str
|
||||
/**
|
||||
* Set the callable that will be used to generate random strings.
|
||||
*
|
||||
* @param callable|null $factory
|
||||
* @param (callable(int): string)|null $factory
|
||||
* @return void
|
||||
*/
|
||||
public static function createRandomStringsUsing(?callable $factory = null)
|
||||
@@ -1115,8 +1138,8 @@ class Str
|
||||
/**
|
||||
* Set the sequence that will be used to generate random strings.
|
||||
*
|
||||
* @param array $sequence
|
||||
* @param callable|null $whenMissing
|
||||
* @param string[] $sequence
|
||||
* @param (callable(int): string)|null $whenMissing
|
||||
* @return void
|
||||
*/
|
||||
public static function createRandomStringsUsingSequence(array $sequence, $whenMissing = null)
|
||||
@@ -1216,7 +1239,7 @@ class Str
|
||||
* @param string|iterable<string> $replace
|
||||
* @param string|iterable<string> $subject
|
||||
* @param bool $caseSensitive
|
||||
* @return string|string[]
|
||||
* @return ($subject is string ? string : string[])
|
||||
*/
|
||||
public static function replace($search, $replace, $subject, $caseSensitive = true)
|
||||
{
|
||||
@@ -1336,11 +1359,11 @@ class Str
|
||||
/**
|
||||
* Replace the patterns matching the given regular expression.
|
||||
*
|
||||
* @param array|string $pattern
|
||||
* @param \Closure|string[]|string $replace
|
||||
* @param array|string $subject
|
||||
* @param string|string[] $pattern
|
||||
* @param (\Closure(array): string)|string[]|string $replace
|
||||
* @param string[]|string $subject
|
||||
* @param int $limit
|
||||
* @return string|string[]|null
|
||||
* @return ($subject is array ? string[]|null : string|null)
|
||||
*/
|
||||
public static function replaceMatches($pattern, $replace, $subject, $limit = -1)
|
||||
{
|
||||
@@ -1386,7 +1409,7 @@ class Str
|
||||
*
|
||||
* @param string $value
|
||||
* @param string $prefix
|
||||
* @return string
|
||||
* @return ($value is '' ? ($prefix is '' ? '' : non-empty-string): non-empty-string)
|
||||
*/
|
||||
public static function start($value, $prefix)
|
||||
{
|
||||
@@ -1399,7 +1422,7 @@ class Str
|
||||
* Convert the given string to upper-case.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @return ($value is '' ? '' : non-empty-string&uppercase-string)
|
||||
*/
|
||||
public static function upper($value)
|
||||
{
|
||||
@@ -1436,6 +1459,24 @@ class Str
|
||||
return implode(' ', array_filter(explode('_', $collapsed)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "initials" representing each word in the provided string, optionally capitalizing.
|
||||
*
|
||||
* @param string $value
|
||||
* @param bool $capitalize
|
||||
* @return string
|
||||
*/
|
||||
public static function initials($value, $capitalize = false)
|
||||
{
|
||||
$parts = mb_split("\s+", $value);
|
||||
|
||||
$parts = array_map(fn ($part) => mb_substr($part, 0, 1), $parts);
|
||||
|
||||
$initials = implode('', $parts);
|
||||
|
||||
return $capitalize ? static::upper($initials) : $initials;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given string to APA-style title case.
|
||||
*
|
||||
@@ -1452,7 +1493,7 @@ class Str
|
||||
|
||||
$minorWords = [
|
||||
'and', 'as', 'but', 'for', 'if', 'nor', 'or', 'so', 'yet', 'a', 'an',
|
||||
'the', 'at', 'by', 'for', 'in', 'of', 'off', 'on', 'per', 'to', 'up', 'via',
|
||||
'the', 'at', 'by', 'in', 'of', 'off', 'on', 'per', 'to', 'up', 'via',
|
||||
'et', 'ou', 'un', 'une', 'la', 'le', 'les', 'de', 'du', 'des', 'par', 'à',
|
||||
];
|
||||
|
||||
@@ -1627,7 +1668,9 @@ class Str
|
||||
*
|
||||
* @param string $haystack
|
||||
* @param string|iterable<string> $needles
|
||||
* @return bool
|
||||
* @return ($needles is array{} ? false : ($haystack is non-empty-string ? bool : false))
|
||||
*
|
||||
* @phpstan-assert-if-true =non-empty-string $haystack
|
||||
*/
|
||||
public static function startsWith($haystack, $needles)
|
||||
{
|
||||
@@ -1653,7 +1696,9 @@ class Str
|
||||
*
|
||||
* @param string $haystack
|
||||
* @param string|iterable<string> $needles
|
||||
* @return bool
|
||||
* @return ($needles is array{} ? true : ($haystack is non-empty-string ? bool : true))
|
||||
*
|
||||
* @phpstan-assert-if-false =non-empty-string $haystack
|
||||
*/
|
||||
public static function doesntStartWith($haystack, $needles)
|
||||
{
|
||||
@@ -1664,7 +1709,7 @@ class Str
|
||||
* Convert a value to studly caps case.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @return ($value is '' ? '' : string)
|
||||
*/
|
||||
public static function studly($value)
|
||||
{
|
||||
@@ -1685,7 +1730,7 @@ class Str
|
||||
* Convert a value to Pascal case.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @return ($value is '' ? '' : string)
|
||||
*/
|
||||
public static function pascal($value)
|
||||
{
|
||||
@@ -1736,16 +1781,18 @@ class Str
|
||||
public static function substrReplace($string, $replace, $offset = 0, $length = null)
|
||||
{
|
||||
if ($length === null) {
|
||||
$length = strlen($string);
|
||||
$length = static::length($string);
|
||||
}
|
||||
|
||||
return substr_replace($string, $replace, $offset, $length);
|
||||
return mb_substr($string, 0, $offset)
|
||||
.$replace
|
||||
.mb_substr(mb_substr($string, $offset), $length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Swap multiple keywords in a string with other keywords.
|
||||
*
|
||||
* @param array $map
|
||||
* @param array<string, string> $map
|
||||
* @param string $subject
|
||||
* @return string
|
||||
*/
|
||||
@@ -1774,7 +1821,7 @@ class Str
|
||||
* Convert the given string to Base64 encoding.
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @return ($string is '' ? '' : string)
|
||||
*/
|
||||
public static function toBase64($string): string
|
||||
{
|
||||
@@ -1786,7 +1833,7 @@ class Str
|
||||
*
|
||||
* @param string $string
|
||||
* @param bool $strict
|
||||
* @return string|false
|
||||
* @return ($strict is true ? ($string is '' ? '' : string|false) : ($string is '' ? '' : string))
|
||||
*/
|
||||
public static function fromBase64($string, $strict = false)
|
||||
{
|
||||
@@ -1797,7 +1844,7 @@ class Str
|
||||
* Make a string's first character lowercase.
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @return ($string is '' ? '' : non-empty-string)
|
||||
*/
|
||||
public static function lcfirst($string)
|
||||
{
|
||||
@@ -1808,18 +1855,34 @@ class Str
|
||||
* Make a string's first character uppercase.
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @return ($string is '' ? '' : non-empty-string)
|
||||
*/
|
||||
public static function ucfirst($string)
|
||||
{
|
||||
return static::upper(static::substr($string, 0, 1)).static::substr($string, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Capitalize the first character of each word in a string.
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $separators
|
||||
* @return ($string is '' ? '' : non-empty-string)
|
||||
*/
|
||||
public static function ucwords($string, $separators = " \t\r\n\f\v")
|
||||
{
|
||||
$pattern = '/(^|['.preg_quote($separators, '/').'])(\p{Ll})/u';
|
||||
|
||||
return preg_replace_callback($pattern, function ($matches) {
|
||||
return $matches[1].mb_strtoupper($matches[2]);
|
||||
}, $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Split a string into pieces by uppercase characters.
|
||||
*
|
||||
* @param string $string
|
||||
* @return string[]
|
||||
* @return ($string is '' ? array{} : string[])
|
||||
*/
|
||||
public static function ucsplit($string)
|
||||
{
|
||||
@@ -1831,7 +1894,7 @@ class Str
|
||||
*
|
||||
* @param string $string
|
||||
* @param string|null $characters
|
||||
* @return int
|
||||
* @return non-negative-int
|
||||
*/
|
||||
public static function wordCount($string, $characters = null)
|
||||
{
|
||||
@@ -1905,7 +1968,7 @@ class Str
|
||||
/**
|
||||
* Set the callable that will be used to generate UUIDs.
|
||||
*
|
||||
* @param callable|null $factory
|
||||
* @param (callable(): \Ramsey\Uuid\UuidInterface)|null $factory
|
||||
* @return void
|
||||
*/
|
||||
public static function createUuidsUsing(?callable $factory = null)
|
||||
@@ -1916,8 +1979,8 @@ class Str
|
||||
/**
|
||||
* Set the sequence that will be used to generate UUIDs.
|
||||
*
|
||||
* @param array $sequence
|
||||
* @param callable|null $whenMissing
|
||||
* @param \Ramsey\Uuid\UuidInterface[] $sequence
|
||||
* @param (callable(): \Ramsey\Uuid\UuidInterface)|null $whenMissing
|
||||
* @return void
|
||||
*/
|
||||
public static function createUuidsUsingSequence(array $sequence, $whenMissing = null)
|
||||
@@ -1950,7 +2013,7 @@ class Str
|
||||
/**
|
||||
* Always return the same UUID when generating new UUIDs.
|
||||
*
|
||||
* @param \Closure|null $callback
|
||||
* @param (\Closure(\Ramsey\Uuid\UuidInterface): mixed)|null $callback
|
||||
* @return \Ramsey\Uuid\UuidInterface
|
||||
*/
|
||||
public static function freezeUuids(?Closure $callback = null)
|
||||
@@ -2012,7 +2075,7 @@ class Str
|
||||
/**
|
||||
* Set the callable that will be used to generate ULIDs.
|
||||
*
|
||||
* @param callable|null $factory
|
||||
* @param (callable(): \Symfony\Component\Uid\Ulid)|null $factory
|
||||
* @return void
|
||||
*/
|
||||
public static function createUlidsUsing(?callable $factory = null)
|
||||
@@ -2023,8 +2086,8 @@ class Str
|
||||
/**
|
||||
* Set the sequence that will be used to generate ULIDs.
|
||||
*
|
||||
* @param array $sequence
|
||||
* @param callable|null $whenMissing
|
||||
* @param \Symfony\Component\Uid\Ulid[] $sequence
|
||||
* @param (callable(): \Symfony\Component\Uid\Ulid)|null $whenMissing
|
||||
* @return void
|
||||
*/
|
||||
public static function createUlidsUsingSequence(array $sequence, $whenMissing = null)
|
||||
@@ -2057,7 +2120,7 @@ class Str
|
||||
/**
|
||||
* Always return the same ULID when generating new ULIDs.
|
||||
*
|
||||
* @param Closure|null $callback
|
||||
* @param (Closure(Ulid): mixed)|null $callback
|
||||
* @return Ulid
|
||||
*/
|
||||
public static function freezeUlids(?Closure $callback = null)
|
||||
|
||||
47
plugins/vendor/illuminate/support/Stringable.php
vendored
47
plugins/vendor/illuminate/support/Stringable.php
vendored
@@ -222,6 +222,18 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
return Str::containsAll($this->value, $needles, $ignoreCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a given string doesn't contain a given substring.
|
||||
*
|
||||
* @param string|iterable<string> $needles
|
||||
* @param bool $ignoreCase
|
||||
* @return bool
|
||||
*/
|
||||
public function doesntContain($needles, $ignoreCase = false)
|
||||
{
|
||||
return Str::doesntContain($this->value, $needles, $ignoreCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the case of a string.
|
||||
*
|
||||
@@ -237,12 +249,12 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
/**
|
||||
* Replace consecutive instances of a given character with a single character.
|
||||
*
|
||||
* @param string $character
|
||||
* @param array<string>|string $characters
|
||||
* @return static
|
||||
*/
|
||||
public function deduplicate(string $character = ' ')
|
||||
public function deduplicate(array|string $characters = ' ')
|
||||
{
|
||||
return new static(Str::deduplicate($this->value, $character));
|
||||
return new static(Str::deduplicate($this->value, $characters));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -879,6 +891,16 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
return new static(Str::headline($this->value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given string to only its initials.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function initials()
|
||||
{
|
||||
return new static(Str::initials($this->value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given string to APA-style title case.
|
||||
*
|
||||
@@ -1045,7 +1067,7 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
/**
|
||||
* Trim the string of the given characters.
|
||||
*
|
||||
* @param string $characters
|
||||
* @param string|null $characters
|
||||
* @return static
|
||||
*/
|
||||
public function trim($characters = null)
|
||||
@@ -1056,7 +1078,7 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
/**
|
||||
* Left trim the string of the given characters.
|
||||
*
|
||||
* @param string $characters
|
||||
* @param string|null $characters
|
||||
* @return static
|
||||
*/
|
||||
public function ltrim($characters = null)
|
||||
@@ -1067,7 +1089,7 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
/**
|
||||
* Right trim the string of the given characters.
|
||||
*
|
||||
* @param string $characters
|
||||
* @param string|null $characters
|
||||
* @return static
|
||||
*/
|
||||
public function rtrim($characters = null)
|
||||
@@ -1095,6 +1117,17 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
return new static(Str::ucfirst($this->value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Capitalize the first character of each word in a string.
|
||||
*
|
||||
* @param string $separators
|
||||
* @return static
|
||||
*/
|
||||
public function ucwords($separators = " \t\r\n\f\v")
|
||||
{
|
||||
return new static(Str::ucwords($this->value, $separators));
|
||||
}
|
||||
|
||||
/**
|
||||
* Split a string by uppercase characters.
|
||||
*
|
||||
@@ -1470,7 +1503,7 @@ class Stringable implements JsonSerializable, ArrayAccess, BaseStringable
|
||||
*/
|
||||
public function toFloat()
|
||||
{
|
||||
return floatval($this->value);
|
||||
return (float) $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -137,7 +137,6 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
* Assert if a job was pushed exactly once.
|
||||
*
|
||||
* @param string|\Closure $command
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
public function assertDispatchedOnce($command)
|
||||
@@ -488,7 +487,7 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
/**
|
||||
* Create a new assertion about a chained batch.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @param \Closure(\Illuminate\Bus\PendingBatch): bool $callback
|
||||
* @return \Illuminate\Support\Testing\Fakes\ChainedBatchTruthTest
|
||||
*/
|
||||
public function chainedBatch(Closure $callback)
|
||||
@@ -499,11 +498,13 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
/**
|
||||
* Assert if a batch was dispatched based on a truth-test callback.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @param array|callable(\Illuminate\Bus\PendingBatch): bool $callback
|
||||
* @return void
|
||||
*/
|
||||
public function assertBatched(callable $callback)
|
||||
public function assertBatched(callable|array $callback)
|
||||
{
|
||||
$callback = is_array($callback) ? fn (PendingBatchFake $batch) => $batch->hasJobs($callback) : $callback;
|
||||
|
||||
PHPUnit::assertTrue(
|
||||
$this->batched($callback)->count() > 0,
|
||||
'The expected batch was not dispatched.'
|
||||
@@ -606,8 +607,8 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
/**
|
||||
* Get all of the pending batches matching a truth-test callback.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return \Illuminate\Support\Collection
|
||||
* @param callable(\Illuminate\Bus\PendingBatch): bool $callback
|
||||
* @return \Illuminate\Support\Collection<int, \Illuminate\Bus\PendingBatch>
|
||||
*/
|
||||
public function batched(callable $callback)
|
||||
{
|
||||
|
||||
@@ -9,14 +9,14 @@ class ChainedBatchTruthTest
|
||||
/**
|
||||
* The underlying truth test.
|
||||
*
|
||||
* @var \Closure
|
||||
* @var \Closure(\Illuminate\Bus\PendingBatch): bool
|
||||
*/
|
||||
protected $callback;
|
||||
|
||||
/**
|
||||
* Create a new truth test instance.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @param \Closure(\Illuminate\Bus\PendingBatch): bool $callback
|
||||
*/
|
||||
public function __construct(Closure $callback)
|
||||
{
|
||||
|
||||
@@ -151,7 +151,6 @@ class EventFake implements Dispatcher, Fake
|
||||
* Assert if an event was dispatched exactly once.
|
||||
*
|
||||
* @param string $event
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
public function assertDispatchedOnce($event)
|
||||
|
||||
@@ -113,7 +113,7 @@ class ExceptionHandlerFake implements ExceptionHandler, Fake
|
||||
{
|
||||
try {
|
||||
$this->assertReported($exception);
|
||||
} catch (ExpectationFailedException $e) {
|
||||
} catch (ExpectationFailedException) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class MailFake implements Factory, Fake, Mailer, MailQueue
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
protected function assertSentTimes($mailable, $times = 1)
|
||||
public function assertSentTimes($mailable, $times = 1)
|
||||
{
|
||||
$count = $this->sent($mailable)->count();
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ class NotificationFake implements Fake, NotificationDispatcher, NotificationFact
|
||||
}
|
||||
|
||||
PHPUnit::assertEmpty(
|
||||
$this->notifications[get_class($notifiable)][$notifiable->getKey()] ?? [],
|
||||
$this->notifications[get_class($notifiable)][$notifiable->getKey() ?? ''] ?? [],
|
||||
'Notifications were sent unexpectedly.',
|
||||
);
|
||||
}
|
||||
@@ -314,7 +314,7 @@ class NotificationFake implements Fake, NotificationDispatcher, NotificationFact
|
||||
|
||||
foreach ($notifiables as $notifiable) {
|
||||
if (! $notification->id) {
|
||||
$notification->id = Str::uuid()->toString();
|
||||
$notification->id = (string) Str::uuid();
|
||||
}
|
||||
|
||||
$notifiableChannels = $channels ?: $notification->via($notifiable);
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
|
||||
namespace Illuminate\Support\Testing\Fakes;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Bus\PendingBatch;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Traits\ReflectsClosures;
|
||||
|
||||
class PendingBatchFake extends PendingBatch
|
||||
{
|
||||
use ReflectsClosures;
|
||||
|
||||
/**
|
||||
* The fake bus instance.
|
||||
*
|
||||
@@ -23,7 +27,7 @@ class PendingBatchFake extends PendingBatch
|
||||
public function __construct(BusFake $bus, Collection $jobs)
|
||||
{
|
||||
$this->bus = $bus;
|
||||
$this->jobs = $jobs;
|
||||
$this->jobs = $jobs->filter()->values();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,4 +49,39 @@ class PendingBatchFake extends PendingBatch
|
||||
{
|
||||
return $this->bus->recordPendingBatch($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the jobs in the batch match the given jobs.
|
||||
*
|
||||
* @param array $expectedJobs
|
||||
* @return bool
|
||||
*/
|
||||
public function hasJobs(array $expectedJobs)
|
||||
{
|
||||
if (count($this->jobs) !== count($expectedJobs)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($expectedJobs as $index => $expectedJob) {
|
||||
if ($expectedJob instanceof Closure) {
|
||||
$expectedType = $this->firstClosureParameterType($expectedJob);
|
||||
|
||||
if (! $this->jobs[$index] instanceof $expectedType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $expectedJob($this->jobs[$index])) {
|
||||
return false;
|
||||
}
|
||||
} elseif (is_string($expectedJob)) {
|
||||
if ($expectedJob != get_class($this->jobs[$index])) {
|
||||
return false;
|
||||
}
|
||||
} elseif (serialize($expectedJob) != serialize($this->jobs[$index])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ namespace Illuminate\Support\Testing\Fakes;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Closure;
|
||||
use Illuminate\Bus\UniqueLock;
|
||||
use Illuminate\Contracts\Cache\Repository as Cache;
|
||||
use Illuminate\Contracts\Queue\Queue;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Events\CallQueuedListener;
|
||||
use Illuminate\Queue\CallQueuedClosure;
|
||||
use Illuminate\Queue\QueueManager;
|
||||
@@ -55,6 +58,13 @@ class QueueFake extends QueueManager implements Fake, Queue
|
||||
*/
|
||||
protected $rawPushes = [];
|
||||
|
||||
/**
|
||||
* All of the unique jobs that were pushed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $uniqueJobs = [];
|
||||
|
||||
/**
|
||||
* Indicates if items should be serialized and restored when pushed to the queue.
|
||||
*
|
||||
@@ -121,7 +131,7 @@ class QueueFake extends QueueManager implements Fake, Queue
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
protected function assertPushedTimes($job, $times = 1)
|
||||
public function assertPushedTimes($job, $times = 1)
|
||||
{
|
||||
$count = $this->pushed($job)->count();
|
||||
|
||||
@@ -477,6 +487,10 @@ class QueueFake extends QueueManager implements Fake, Queue
|
||||
'queue' => $queue,
|
||||
'data' => $data,
|
||||
];
|
||||
|
||||
if ($job instanceof ShouldBeUnique) {
|
||||
$this->uniqueJobs[] = $job;
|
||||
}
|
||||
} else {
|
||||
is_object($job) && isset($job->connection)
|
||||
? $this->queue->connection($job->connection)->push($job, $data, $queue)
|
||||
@@ -650,6 +664,22 @@ class QueueFake extends QueueManager implements Fake, Queue
|
||||
return unserialize(serialize($job));
|
||||
}
|
||||
|
||||
/**
|
||||
* Release the locks for all unique jobs that were pushed.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function releaseUniqueJobLocks()
|
||||
{
|
||||
$lock = new UniqueLock($this->app->make(Cache::class));
|
||||
|
||||
foreach ($this->uniqueJobs as $job) {
|
||||
$lock->release($job);
|
||||
}
|
||||
|
||||
$this->uniqueJobs = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the connection name for the queue.
|
||||
*
|
||||
|
||||
@@ -36,7 +36,7 @@ class Timebox
|
||||
$exception = $caught;
|
||||
}
|
||||
|
||||
$remainder = intval($microseconds - ((microtime(true) - $start) * 1000000));
|
||||
$remainder = (int) ($microseconds - ((microtime(true) - $start) * 1_000_000));
|
||||
|
||||
if (! $this->earlyReturn && $remainder > 0) {
|
||||
$this->usleep($remainder);
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
|
||||
namespace Illuminate\Support\Traits;
|
||||
|
||||
use Carbon\CarbonInterval;
|
||||
use Carbon\Unit;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Number;
|
||||
use Illuminate\Support\Str;
|
||||
use stdClass;
|
||||
|
||||
@@ -269,7 +272,7 @@ trait InteractsWithData
|
||||
*/
|
||||
public function integer($key, $default = 0)
|
||||
{
|
||||
return intval($this->data($key, $default));
|
||||
return (int) $this->data($key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,7 +284,21 @@ trait InteractsWithData
|
||||
*/
|
||||
public function float($key, $default = 0.0)
|
||||
{
|
||||
return floatval($this->data($key, $default));
|
||||
return (float) $this->data($key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve data clamped between min and max values.
|
||||
*
|
||||
* @param string $key
|
||||
* @param int|float $min
|
||||
* @param int|float $max
|
||||
* @param int|float $default
|
||||
* @return float|int
|
||||
*/
|
||||
public function clamp($key, $min, $max, $default = 0)
|
||||
{
|
||||
return Number::clamp($this->data($key, $default), $min, $max);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,15 +326,40 @@ trait InteractsWithData
|
||||
return Date::createFromFormat($format, $this->data($key), $tz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve data from the instance as a CarbonInterval instance.
|
||||
*
|
||||
* @param string $key
|
||||
* @param \Carbon\Unit|string|null $unit
|
||||
* @return \Carbon\CarbonInterval|null
|
||||
*/
|
||||
public function interval($key, $unit = null)
|
||||
{
|
||||
if ($this->isNotFilled($key)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$value = $this->data($key);
|
||||
|
||||
if (is_null($unit)) {
|
||||
return CarbonInterval::make($value);
|
||||
}
|
||||
|
||||
$unit = $unit instanceof Unit ? $unit : Unit::fromName($unit);
|
||||
|
||||
return $unit->interval((float) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve data from the instance as an enum.
|
||||
*
|
||||
* @template TEnum of \BackedEnum
|
||||
* @template TDefault of TEnum|null
|
||||
*
|
||||
* @param string $key
|
||||
* @param class-string<TEnum> $enumClass
|
||||
* @param TEnum|null $default
|
||||
* @return TEnum|null
|
||||
* @param TDefault $default
|
||||
* @return TEnum|TDefault
|
||||
*/
|
||||
public function enum($key, $enumClass, $default = null)
|
||||
{
|
||||
@@ -357,7 +399,7 @@ trait InteractsWithData
|
||||
*/
|
||||
protected function isBackedEnum($enumClass)
|
||||
{
|
||||
return enum_exists($enumClass) && method_exists($enumClass, 'tryFrom');
|
||||
return is_a($enumClass, \BackedEnum::class, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Support\Traits;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Reflector;
|
||||
use ReflectionFunction;
|
||||
use RuntimeException;
|
||||
|
||||
trait ReflectsClosures
|
||||
{
|
||||
/**
|
||||
* Get the class name of the first parameter of the given Closure.
|
||||
*
|
||||
* @param \Closure $closure
|
||||
* @return string
|
||||
*
|
||||
* @throws \ReflectionException
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
protected function firstClosureParameterType(Closure $closure)
|
||||
{
|
||||
$types = array_values($this->closureParameterTypes($closure));
|
||||
|
||||
if (! $types) {
|
||||
throw new RuntimeException('The given Closure has no parameters.');
|
||||
}
|
||||
|
||||
if ($types[0] === null) {
|
||||
throw new RuntimeException('The first parameter of the given Closure is missing a type hint.');
|
||||
}
|
||||
|
||||
return $types[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class names of the first parameter of the given Closure, including union types.
|
||||
*
|
||||
* @param \Closure $closure
|
||||
* @return array
|
||||
*
|
||||
* @throws \ReflectionException
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
protected function firstClosureParameterTypes(Closure $closure)
|
||||
{
|
||||
$reflection = new ReflectionFunction($closure);
|
||||
|
||||
$types = (new Collection($reflection->getParameters()))
|
||||
->mapWithKeys(function ($parameter) {
|
||||
if ($parameter->isVariadic()) {
|
||||
return [$parameter->getName() => null];
|
||||
}
|
||||
|
||||
return [$parameter->getName() => Reflector::getParameterClassNames($parameter)];
|
||||
})
|
||||
->filter()
|
||||
->values()
|
||||
->all();
|
||||
|
||||
if (empty($types)) {
|
||||
throw new RuntimeException('The given Closure has no parameters.');
|
||||
}
|
||||
|
||||
if (isset($types[0]) && empty($types[0])) {
|
||||
throw new RuntimeException('The first parameter of the given Closure is missing a type hint.');
|
||||
}
|
||||
|
||||
return $types[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class names / types of the parameters of the given Closure.
|
||||
*
|
||||
* @param \Closure $closure
|
||||
* @return array
|
||||
*
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
protected function closureParameterTypes(Closure $closure)
|
||||
{
|
||||
$reflection = new ReflectionFunction($closure);
|
||||
|
||||
return (new Collection($reflection->getParameters()))
|
||||
->mapWithKeys(function ($parameter) {
|
||||
if ($parameter->isVariadic()) {
|
||||
return [$parameter->getName() => null];
|
||||
}
|
||||
|
||||
return [$parameter->getName() => Reflector::getParameterClassName($parameter)];
|
||||
})
|
||||
->all();
|
||||
}
|
||||
}
|
||||
12
plugins/vendor/illuminate/support/Uri.php
vendored
12
plugins/vendor/illuminate/support/Uri.php
vendored
@@ -115,6 +115,14 @@ class Uri implements Htmlable, JsonSerializable, Responsable, Stringable
|
||||
return new static(call_user_func(static::$urlGeneratorResolver)->action($action, $parameters, $absolute));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URI's authority.
|
||||
*/
|
||||
public function authority(): ?string
|
||||
{
|
||||
return $this->uri->getAuthority();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URI's scheme.
|
||||
*/
|
||||
@@ -161,8 +169,10 @@ class Uri implements Htmlable, JsonSerializable, Responsable, Stringable
|
||||
* Get the URI's path.
|
||||
*
|
||||
* Empty or missing paths are returned as a single "/".
|
||||
*
|
||||
* @return non-empty-string
|
||||
*/
|
||||
public function path(): ?string
|
||||
public function path(): string
|
||||
{
|
||||
$path = trim((string) $this->uri->getPath(), '/');
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ namespace Illuminate\Support;
|
||||
|
||||
use ArrayIterator;
|
||||
use Illuminate\Contracts\Support\ValidatedData;
|
||||
use Illuminate\Support\Traits\Dumpable;
|
||||
use Illuminate\Support\Traits\InteractsWithData;
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
use Traversable;
|
||||
|
||||
class ValidatedInput implements ValidatedData
|
||||
{
|
||||
use InteractsWithData;
|
||||
use Dumpable, InteractsWithData;
|
||||
|
||||
/**
|
||||
* The underlying input.
|
||||
@@ -97,30 +97,15 @@ class ValidatedInput implements ValidatedData
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump the validated inputs items and end the script.
|
||||
*
|
||||
* @param mixed ...$keys
|
||||
* @return never
|
||||
*/
|
||||
public function dd(...$keys)
|
||||
{
|
||||
$this->dump(...$keys);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump the items.
|
||||
*
|
||||
* @param mixed $keys
|
||||
* @param mixed ...$keys
|
||||
* @return $this
|
||||
*/
|
||||
public function dump($keys = [])
|
||||
public function dump(...$keys)
|
||||
{
|
||||
$keys = is_array($keys) ? $keys : func_get_args();
|
||||
|
||||
VarDumper::dump(count($keys) > 0 ? $this->only($keys) : $this->all());
|
||||
dump(count($keys) > 0 ? $this->only($keys) : $this->all());
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -161,6 +146,7 @@ class ValidatedInput implements ValidatedData
|
||||
/**
|
||||
* Determine if an input item is set.
|
||||
*
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($name)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"illuminate/conditionable": "^12.0",
|
||||
"illuminate/contracts": "^12.0",
|
||||
"illuminate/macroable": "^12.0",
|
||||
"illuminate/reflection": "^12.0",
|
||||
"nesbot/carbon": "^3.8.4",
|
||||
"symfony/polyfill-php83": "^1.33",
|
||||
"symfony/polyfill-php85": "^1.33",
|
||||
|
||||
108
plugins/vendor/illuminate/support/functions.php
vendored
108
plugins/vendor/illuminate/support/functions.php
vendored
@@ -2,8 +2,11 @@
|
||||
|
||||
namespace Illuminate\Support;
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Carbon\CarbonInterval;
|
||||
use Illuminate\Support\Defer\DeferredCallback;
|
||||
use Illuminate\Support\Defer\DeferredCallbackCollection;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Symfony\Component\Process\PhpExecutableFinder;
|
||||
|
||||
if (! function_exists('Illuminate\Support\defer')) {
|
||||
@@ -47,3 +50,108 @@ if (! function_exists('Illuminate\Support\artisan_binary')) {
|
||||
return defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan';
|
||||
}
|
||||
}
|
||||
|
||||
// Time functions...
|
||||
|
||||
if (! function_exists('Illuminate\Support\now')) {
|
||||
/**
|
||||
* Create a new Carbon instance for the current time.
|
||||
*
|
||||
* @param \DateTimeZone|\UnitEnum|string|null $tz
|
||||
* @return \Illuminate\Support\Carbon
|
||||
*/
|
||||
function now($tz = null): CarbonInterface
|
||||
{
|
||||
return Date::now(enum_value($tz));
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\microseconds')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of microseconds.
|
||||
*/
|
||||
function microseconds(int|float $microseconds): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::microseconds($microseconds);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\milliseconds')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of milliseconds.
|
||||
*/
|
||||
function milliseconds(int|float $milliseconds): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::milliseconds($milliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\seconds')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of seconds.
|
||||
*/
|
||||
function seconds(int|float $seconds): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::seconds($seconds);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\minutes')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of minutes.
|
||||
*/
|
||||
function minutes(int|float $minutes): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::minutes($minutes);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\hours')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of hours.
|
||||
*/
|
||||
function hours(int|float $hours): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::hours($hours);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\days')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of days.
|
||||
*/
|
||||
function days(int|float $days): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::days($days);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\weeks')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of weeks.
|
||||
*/
|
||||
function weeks(int $weeks): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::weeks($weeks);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\months')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of months.
|
||||
*/
|
||||
function months(int $months): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::months($months);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('Illuminate\Support\years')) {
|
||||
/**
|
||||
* Get the current date / time plus the given number of years.
|
||||
*/
|
||||
function years(int $years): CarbonInterval
|
||||
{
|
||||
return CarbonInterval::years($years);
|
||||
}
|
||||
}
|
||||
|
||||
33
plugins/vendor/illuminate/support/helpers.php
vendored
33
plugins/vendor/illuminate/support/helpers.php
vendored
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Carbon\CarbonInterval;
|
||||
use Illuminate\Contracts\Support\DeferringDisplayableValue;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -127,7 +128,7 @@ if (! function_exists('e')) {
|
||||
}
|
||||
|
||||
if ($value instanceof Htmlable) {
|
||||
return $value->toHtml();
|
||||
return $value->toHtml() ?? '';
|
||||
}
|
||||
|
||||
if ($value instanceof BackedEnum) {
|
||||
@@ -232,7 +233,7 @@ if (! function_exists('laravel_cloud')) {
|
||||
function laravel_cloud(): bool
|
||||
{
|
||||
return ($_ENV['LARAVEL_CLOUD'] ?? false) === '1' ||
|
||||
($_SERVER['LARAVEL_CLOUD'] ?? false) === '1';
|
||||
($_SERVER['LARAVEL_CLOUD'] ?? false) === '1';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,9 +289,7 @@ if (! function_exists('preg_replace_array')) {
|
||||
function preg_replace_array($pattern, array $replacements, $subject): string
|
||||
{
|
||||
return preg_replace_callback($pattern, function () use (&$replacements) {
|
||||
foreach ($replacements as $value) {
|
||||
return array_shift($replacements);
|
||||
}
|
||||
return array_shift($replacements);
|
||||
}, $subject);
|
||||
}
|
||||
}
|
||||
@@ -303,7 +302,7 @@ if (! function_exists('retry')) {
|
||||
*
|
||||
* @param int|array<int, int> $times
|
||||
* @param callable(int): TValue $callback
|
||||
* @param int|\Closure(int, \Throwable): int $sleepMilliseconds
|
||||
* @param CarbonInterval|int|\Closure(int, \Throwable): CarbonInterval|int $sleepMilliseconds
|
||||
* @param (callable(\Throwable): bool)|null $when
|
||||
* @return TValue
|
||||
*
|
||||
@@ -335,7 +334,11 @@ if (! function_exists('retry')) {
|
||||
$sleepMilliseconds = $backoff[$attempts - 1] ?? $sleepMilliseconds;
|
||||
|
||||
if ($sleepMilliseconds) {
|
||||
Sleep::usleep(value($sleepMilliseconds, $attempts, $e) * 1000);
|
||||
$duration = value($sleepMilliseconds, $attempts, $e);
|
||||
|
||||
$duration instanceof CarbonInterval
|
||||
? Sleep::usleep($duration->totalMicroseconds)
|
||||
: Sleep::usleep($duration * 1000);
|
||||
}
|
||||
|
||||
goto beginning;
|
||||
@@ -398,11 +401,13 @@ if (! function_exists('throw_if')) {
|
||||
* Throw the given exception if the given condition is true.
|
||||
*
|
||||
* @template TValue
|
||||
* @template TParams of mixed
|
||||
* @template TException of \Throwable
|
||||
* @template TExceptionValue of TException|class-string<TException>|string
|
||||
*
|
||||
* @param TValue $condition
|
||||
* @param TException|class-string<TException>|string $exception
|
||||
* @param mixed ...$parameters
|
||||
* @param Closure(TParams): TExceptionValue|TExceptionValue $exception
|
||||
* @param TParams ...$parameters
|
||||
* @return ($condition is true ? never : ($condition is non-empty-mixed ? never : TValue))
|
||||
*
|
||||
* @throws TException
|
||||
@@ -410,6 +415,10 @@ if (! function_exists('throw_if')) {
|
||||
function throw_if($condition, $exception = 'RuntimeException', ...$parameters)
|
||||
{
|
||||
if ($condition) {
|
||||
if ($exception instanceof Closure) {
|
||||
$exception = $exception(...$parameters);
|
||||
}
|
||||
|
||||
if (is_string($exception) && class_exists($exception)) {
|
||||
$exception = new $exception(...$parameters);
|
||||
}
|
||||
@@ -426,11 +435,13 @@ if (! function_exists('throw_unless')) {
|
||||
* Throw the given exception unless the given condition is true.
|
||||
*
|
||||
* @template TValue
|
||||
* @template TParams of mixed
|
||||
* @template TException of \Throwable
|
||||
* @template TExceptionValue of TException|class-string<TException>|string
|
||||
*
|
||||
* @param TValue $condition
|
||||
* @param TException|class-string<TException>|string $exception
|
||||
* @param mixed ...$parameters
|
||||
* @param Closure(TParams): TExceptionValue|TExceptionValue $exception
|
||||
* @param TParams ...$parameters
|
||||
* @return ($condition is false ? never : ($condition is non-empty-mixed ? TValue : never))
|
||||
*
|
||||
* @throws TException
|
||||
|
||||
Reference in New Issue
Block a user