Framework Update

This commit is contained in:
2024-01-31 22:15:08 +08:00
parent b5ff5e8b5f
commit 20678a6a0c
1459 changed files with 25954 additions and 16153 deletions
+8 -8
View File
@@ -19,18 +19,18 @@ use InvalidArgumentException;
* @method \Illuminate\Support\Carbon createFromTimestampUTC($timestamp)
* @method \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null)
* @method \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
* @method \Illuminate\Support\Carbon disableHumanDiffOption($humanDiffOption)
* @method \Illuminate\Support\Carbon enableHumanDiffOption($humanDiffOption)
* @method void disableHumanDiffOption($humanDiffOption)
* @method void enableHumanDiffOption($humanDiffOption)
* @method mixed executeWithLocale($locale, $func)
* @method \Illuminate\Support\Carbon fromSerialized($value)
* @method array getAvailableLocales()
* @method array getDays()
* @method int getHumanDiffOptions()
* @method array getIsoUnits()
* @method \Illuminate\Support\Carbon getLastErrors()
* @method array getLastErrors()
* @method string getLocale()
* @method int getMidDayAt()
* @method \Illuminate\Support\Carbon getTestNow()
* @method \Illuminate\Support\Carbon|null getTestNow()
* @method \Symfony\Component\Translation\TranslatorInterface getTranslator()
* @method int getWeekEndsAt()
* @method int getWeekStartsAt()
@@ -42,7 +42,7 @@ use InvalidArgumentException;
* @method \Illuminate\Support\Carbon instance($date)
* @method bool isImmutable()
* @method bool isModifiableUnit($unit)
* @method \Illuminate\Support\Carbon isMutable()
* @method bool isMutable()
* @method bool isStrictModeEnabled()
* @method bool localeHasDiffOneDayWords($locale)
* @method bool localeHasDiffSyntax($locale)
@@ -61,13 +61,13 @@ use InvalidArgumentException;
* @method void resetToStringFormat()
* @method void resetYearsOverflow()
* @method void serializeUsing($callback)
* @method \Illuminate\Support\Carbon setHumanDiffOptions($humanDiffOptions)
* @method void setHumanDiffOptions($humanDiffOptions)
* @method bool setLocale($locale)
* @method void setMidDayAt($hour)
* @method void setTestNow($testNow = null)
* @method void setToStringFormat($format)
* @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator)
* @method \Illuminate\Support\Carbon setUtf8($utf8)
* @method void setUtf8($utf8)
* @method void setWeekEndsAt($day)
* @method void setWeekStartsAt($day)
* @method void setWeekendDays($days)
@@ -77,7 +77,7 @@ use InvalidArgumentException;
* @method \Illuminate\Support\Carbon today($tz = null)
* @method \Illuminate\Support\Carbon tomorrow($tz = null)
* @method void useMonthsOverflow($monthsOverflow = true)
* @method \Illuminate\Support\Carbon useStrictMode($strictModeEnabled = true)
* @method void useStrictMode($strictModeEnabled = true)
* @method void useYearsOverflow($yearsOverflow = true)
* @method \Illuminate\Support\Carbon yesterday($tz = null)
*/
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace Illuminate\Support\Exceptions;
use RuntimeException;
class MathException extends RuntimeException
{
//
}
+1 -1
View File
@@ -104,7 +104,7 @@ namespace Illuminate\Support\Facades;
* @method static mixed rebinding(string $abstract, \Closure $callback)
* @method static mixed refresh(string $abstract, mixed $target, string $method)
* @method static \Closure wrap(\Closure $callback, array $parameters = [])
* @method static mixed call(callable|string $callback, array<string, mixed> $parameters = [], string|null $defaultMethod = null)
* @method static mixed call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null)
* @method static \Closure factory(string $abstract)
* @method static mixed makeWith(string|callable $abstract, array $parameters = [])
* @method static mixed get(string $id)
+1 -1
View File
@@ -13,7 +13,7 @@ namespace Illuminate\Support\Facades;
* @method static void extend(callable $compiler)
* @method static array getExtensions()
* @method static void if(string $name, callable $callback)
* @method static bool check(string $name, array ...$parameters)
* @method static bool check(string $name, mixed ...$parameters)
* @method static void component(string $class, string|null $alias = null, string $prefix = '')
* @method static void components(array $components, string $prefix = '')
* @method static array getClassComponentAliases()
+3 -3
View File
@@ -22,14 +22,14 @@ use Illuminate\Support\Testing\Fakes\BusFake;
* @method static \Illuminate\Bus\Dispatcher map(array $map)
* @method static void except(array|string $jobsToDispatch)
* @method static void assertDispatched(string|\Closure $command, callable|int|null $callback = null)
* @method static void assertDispatchedTimes(string $command, int $times = 1)
* @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()
* @method static void assertDispatchedSync(string|\Closure $command, callable|int|null $callback = null)
* @method static void assertDispatchedSyncTimes(string $command, int $times = 1)
* @method static void assertDispatchedSyncTimes(string|\Closure $command, int $times = 1)
* @method static void assertNotDispatchedSync(string|\Closure $command, callable|null $callback = null)
* @method static void assertDispatchedAfterResponse(string|\Closure $command, callable|int|null $callback = null)
* @method static void assertDispatchedAfterResponseTimes(string $command, int $times = 1)
* @method static void assertDispatchedAfterResponseTimes(string|\Closure $command, int $times = 1)
* @method static void assertNotDispatchedAfterResponse(string|\Closure $command, callable|null $callback = null)
* @method static void assertChained(array $expectedChain)
* @method static void assertDispatchedWithoutChain(string|\Closure $command, callable|null $callback = null)
+7 -5
View File
@@ -12,12 +12,12 @@ namespace Illuminate\Support\Facades;
* @method static \Illuminate\Cache\CacheManager forgetDriver(array|string|null $name = null)
* @method static void purge(string|null $name = null)
* @method static \Illuminate\Cache\CacheManager extend(string $driver, \Closure $callback)
* @method static bool has(string $key)
* @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 mixed get(array|string $key, mixed|\Closure $default = null)
* @method static array many(array $keys)
* @method static iterable getMultiple(iterable<string> $keys, mixed $default = null)
* @method static mixed pull(string $key, mixed $default = null)
* @method static iterable getMultiple(iterable $keys, mixed $default = null)
* @method static mixed pull(array|string $key, mixed|\Closure $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 bool putMany(array $values, \DateTimeInterface|\DateInterval|int|null $ttl = null)
@@ -31,7 +31,7 @@ namespace Illuminate\Support\Facades;
* @method static mixed rememberForever(string $key, \Closure $callback)
* @method static bool forget(string $key)
* @method static bool delete(string $key)
* @method static bool deleteMultiple(iterable<string> $keys)
* @method static bool deleteMultiple(iterable $keys)
* @method static bool clear()
* @method static \Illuminate\Cache\TaggedCache tags(array|mixed $names)
* @method static bool supportsTags()
@@ -51,6 +51,8 @@ namespace Illuminate\Support\Facades;
* @method static \Illuminate\Contracts\Cache\Lock restoreLock(string $name, string $owner)
*
* @see \Illuminate\Cache\CacheManager
*
* @mixin \Illuminate\Cache\Repository
*/
class Cache extends Facade
{
+2 -2
View File
@@ -8,10 +8,10 @@ namespace Illuminate\Support\Facades;
* @method static \Symfony\Component\HttpFoundation\Cookie forget(string $name, string|null $path = null, string|null $domain = null)
* @method static bool hasQueued(string $key, string|null $path = null)
* @method static \Symfony\Component\HttpFoundation\Cookie|null queued(string $key, mixed $default = null, string|null $path = null)
* @method static void queue(array ...$parameters)
* @method static void queue(mixed ...$parameters)
* @method static void expire(string $name, string|null $path = null, string|null $domain = null)
* @method static void unqueue(string $name, string|null $path = null)
* @method static \Illuminate\Cookie\CookieJar setDefaultPathAndDomain(string $path, string $domain, bool $secure = false, string|null $sameSite = null)
* @method static \Illuminate\Cookie\CookieJar setDefaultPathAndDomain(string $path, string|null $domain, bool|null $secure = false, string|null $sameSite = null)
* @method static \Symfony\Component\HttpFoundation\Cookie[] getQueuedCookies()
* @method static \Illuminate\Cookie\CookieJar flushQueuedCookies()
* @method static void macro(string $name, object|callable $macro)
+1 -1
View File
@@ -15,7 +15,7 @@ namespace Illuminate\Support\Facades;
* @method static string[] availableDrivers()
* @method static void extend(string $name, callable $resolver)
* @method static void forgetExtension(string $name)
* @method static array<string, \Illuminate\Database\Connection> getConnections()
* @method static array getConnections()
* @method static void setReconnector(callable $reconnector)
* @method static \Illuminate\Database\DatabaseManager setApplication(\Illuminate\Contracts\Foundation\Application $app)
* @method static void macro(string $name, object|callable $macro)
+8 -8
View File
@@ -23,18 +23,18 @@ use Illuminate\Support\DateFactory;
* @method static \Illuminate\Support\Carbon createFromTimestampUTC($timestamp)
* @method static \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null)
* @method static \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
* @method static \Illuminate\Support\Carbon disableHumanDiffOption($humanDiffOption)
* @method static \Illuminate\Support\Carbon enableHumanDiffOption($humanDiffOption)
* @method static void disableHumanDiffOption($humanDiffOption)
* @method static void enableHumanDiffOption($humanDiffOption)
* @method static mixed executeWithLocale($locale, $func)
* @method static \Illuminate\Support\Carbon fromSerialized($value)
* @method static array getAvailableLocales()
* @method static array getDays()
* @method static int getHumanDiffOptions()
* @method static array getIsoUnits()
* @method static \Illuminate\Support\Carbon getLastErrors()
* @method static array getLastErrors()
* @method static string getLocale()
* @method static int getMidDayAt()
* @method static \Illuminate\Support\Carbon getTestNow()
* @method static \Illuminate\Support\Carbon|null getTestNow()
* @method static \Symfony\Component\Translation\TranslatorInterface getTranslator()
* @method static int getWeekEndsAt()
* @method static int getWeekStartsAt()
@@ -46,7 +46,7 @@ use Illuminate\Support\DateFactory;
* @method static \Illuminate\Support\Carbon instance($date)
* @method static bool isImmutable()
* @method static bool isModifiableUnit($unit)
* @method static \Illuminate\Support\Carbon isMutable()
* @method static bool isMutable()
* @method static bool isStrictModeEnabled()
* @method static bool localeHasDiffOneDayWords($locale)
* @method static bool localeHasDiffSyntax($locale)
@@ -65,13 +65,13 @@ use Illuminate\Support\DateFactory;
* @method static void resetToStringFormat()
* @method static void resetYearsOverflow()
* @method static void serializeUsing($callback)
* @method static \Illuminate\Support\Carbon setHumanDiffOptions($humanDiffOptions)
* @method static void setHumanDiffOptions($humanDiffOptions)
* @method static bool setLocale($locale)
* @method static void setMidDayAt($hour)
* @method static void setTestNow($testNow = null)
* @method static void setToStringFormat($format)
* @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator)
* @method static \Illuminate\Support\Carbon setUtf8($utf8)
* @method static void setUtf8($utf8)
* @method static void setWeekEndsAt($day)
* @method static void setWeekStartsAt($day)
* @method static void setWeekendDays($days)
@@ -81,7 +81,7 @@ use Illuminate\Support\DateFactory;
* @method static \Illuminate\Support\Carbon today($tz = null)
* @method static \Illuminate\Support\Carbon tomorrow($tz = null)
* @method static void useMonthsOverflow($monthsOverflow = true)
* @method static \Illuminate\Support\Carbon useStrictMode($strictModeEnabled = true)
* @method static void useStrictMode($strictModeEnabled = true)
* @method static void useYearsOverflow($yearsOverflow = true)
* @method static \Illuminate\Support\Carbon yesterday($tz = null)
*
+3 -3
View File
@@ -12,7 +12,7 @@ namespace Illuminate\Support\Facades;
* @method static \Illuminate\Support\LazyCollection lines(string $path)
* @method static string hash(string $path, string $algorithm = 'md5')
* @method static int|bool put(string $path, string $contents, bool $lock = false)
* @method static void replace(string $path, string $content)
* @method static void replace(string $path, string $content, int|null $mode = null)
* @method static void replaceInFile(array|string $search, array|string $replace, string $path)
* @method static int prepend(string $path, string $data)
* @method static int append(string $path, string $data)
@@ -48,8 +48,8 @@ namespace Illuminate\Support\Facades;
* @method static bool deleteDirectory(string $directory, bool $preserve = false)
* @method static bool deleteDirectories(string $directory)
* @method static bool cleanDirectory(string $directory)
* @method static \Illuminate\Filesystem\Filesystem|mixed when((\Closure(\Illuminate\Filesystem\Filesystem): mixed)|mixed $value = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $callback = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $default = null)
* @method static \Illuminate\Filesystem\Filesystem|mixed unless((\Closure(\Illuminate\Filesystem\Filesystem): mixed)|mixed $value = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $callback = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $default = null)
* @method static \Illuminate\Filesystem\Filesystem|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
* @method static \Illuminate\Filesystem\Filesystem|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
* @method static void macro(string $name, object|callable $macro)
* @method static void mixin(object $mixin, bool $replace = true)
* @method static bool hasMacro(string $name)
+2 -2
View File
@@ -28,8 +28,8 @@ use Illuminate\Contracts\Auth\Access\Gate as GateContract;
* @method static array abilities()
* @method static array policies()
* @method static \Illuminate\Auth\Access\Gate setContainer(\Illuminate\Contracts\Container\Container $container)
* @method static \Illuminate\Auth\Access\Response denyWithStatus(int $status, ?string $message = null, ?int $code = null)
* @method static \Illuminate\Auth\Access\Response denyAsNotFound(?string $message = null, ?int $code = null)
* @method static \Illuminate\Auth\Access\Response denyWithStatus(int $status, string|null $message = null, int|null $code = null)
* @method static \Illuminate\Auth\Access\Response denyAsNotFound(string|null $message = null, int|null $code = null)
*
* @see \Illuminate\Auth\Access\Gate
*/
+10 -9
View File
@@ -37,6 +37,7 @@ use Illuminate\Http\Client\Factory;
* @method static \Illuminate\Http\Client\PendingRequest withDigestAuth(string $username, string $password)
* @method static \Illuminate\Http\Client\PendingRequest withToken(string $token, string $type = 'Bearer')
* @method static \Illuminate\Http\Client\PendingRequest withUserAgent(string $userAgent)
* @method static \Illuminate\Http\Client\PendingRequest withUrlParameters(array $parameters = [])
* @method static \Illuminate\Http\Client\PendingRequest withCookies(array $cookies, string $domain)
* @method static \Illuminate\Http\Client\PendingRequest maxRedirects(int $max)
* @method static \Illuminate\Http\Client\PendingRequest withoutRedirecting()
@@ -53,14 +54,14 @@ use Illuminate\Http\Client\Factory;
* @method static \Illuminate\Http\Client\PendingRequest throwUnless(bool $condition)
* @method static \Illuminate\Http\Client\PendingRequest dump()
* @method static \Illuminate\Http\Client\PendingRequest dd()
* @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 $data = [])
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface patch(string $url, array $data = [])
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface put(string $url, array $data = [])
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface delete(string $url, array $data = [])
* @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 $data = [])
* @method static \Illuminate\Http\Client\Response patch(string $url, array $data = [])
* @method static \Illuminate\Http\Client\Response put(string $url, array $data = [])
* @method static \Illuminate\Http\Client\Response delete(string $url, array $data = [])
* @method static array pool(callable $callback)
* @method static \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface send(string $method, string $url, array $options = [])
* @method static \Illuminate\Http\Client\Response 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()
@@ -76,8 +77,8 @@ use Illuminate\Http\Client\Factory;
* @method static \Illuminate\Http\Client\PendingRequest setClient(\GuzzleHttp\Client $client)
* @method static \Illuminate\Http\Client\PendingRequest setHandler(callable $handler)
* @method static array getOptions()
* @method static \Illuminate\Http\Client\PendingRequest|mixed when((\Closure(\Illuminate\Http\Client\PendingRequest): mixed)|mixed $value = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $callback = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $default = null)
* @method static \Illuminate\Http\Client\PendingRequest|mixed unless((\Closure(\Illuminate\Http\Client\PendingRequest): mixed)|mixed $value = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $callback = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $default = null)
* @method static \Illuminate\Http\Client\PendingRequest|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
* @method static \Illuminate\Http\Client\PendingRequest|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
*
* @see \Illuminate\Http\Client\Factory
*/
+1
View File
@@ -22,6 +22,7 @@ namespace Illuminate\Support\Facades;
* @method static string getFallback()
* @method static void setFallback(string $fallback)
* @method static void setLoaded(array $loaded)
* @method static void stringable(callable|string $class, callable|null $handler = null)
* @method static void setParsedKey(string $key, array $parsed)
* @method static void flushParsedKeys()
* @method static void macro(string $name, object|callable $macro)
+1 -1
View File
@@ -13,7 +13,7 @@ namespace Illuminate\Support\Facades;
* @method static string|null getDefaultDriver()
* @method static void setDefaultDriver(string $name)
* @method static \Illuminate\Log\LogManager extend(string $driver, \Closure $callback)
* @method static \Illuminate\Log\LogManager forgetChannel(string|null $driver = null)
* @method static void forgetChannel(string|null $driver = null)
* @method static array getChannels()
* @method static void emergency(string $message, array $context = [])
* @method static void alert(string $message, array $context = [])
+3 -2
View File
@@ -35,7 +35,7 @@ namespace Illuminate\Support\Facades;
* @method static \Symfony\Component\HttpFoundation\ParameterBag|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)
* @method static \Illuminate\Http\Request duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
* @method static \Illuminate\Http\Request duplicate(array|null $query = null, array|null $request = null, array|null $attributes = null, array|null $cookies = null, array|null $files = null, array|null $server = null)
* @method static bool hasSession(bool $skipIfUninitialized = false)
* @method static \Symfony\Component\HttpFoundation\Session\SessionInterface getSession()
* @method static \Illuminate\Contracts\Session\Session session()
@@ -106,6 +106,7 @@ namespace Illuminate\Support\Facades;
* @method static bool isMethodCacheable()
* @method static string|null getProtocolVersion()
* @method static string|resource getContent(bool $asResource = false)
* @method static \Symfony\Component\HttpFoundation\InputBag getPayload()
* @method static array getETags()
* @method static bool isNoCache()
* @method static string|null getPreferredFormat(string|null $default = 'html')
@@ -158,7 +159,7 @@ namespace Illuminate\Support\Facades;
* @method static int integer(string $key, int $default = 0)
* @method static float float(string $key, float $default = 0)
* @method static \Illuminate\Support\Carbon|null date(string $key, string|null $format = null, string|null $tz = null)
* @method static object|null enum(string $key, class-string<object> $enumClass)
* @method static object|null enum(string $key, string $enumClass)
* @method static \Illuminate\Support\Collection collect(array|string|null $key = null)
* @method static array only(array|mixed $keys)
* @method static array except(array|mixed $keys)
+2 -2
View File
@@ -10,8 +10,8 @@ use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract;
* @method static \Illuminate\Http\Response view(string|array $view, array $data = [], int $status = 200, array $headers = [])
* @method static \Illuminate\Http\JsonResponse json(mixed $data = [], int $status = 200, array $headers = [], int $options = 0)
* @method static \Illuminate\Http\JsonResponse jsonp(string $callback, mixed $data = [], int $status = 200, array $headers = [], int $options = 0)
* @method static \Symfony\Component\HttpFoundation\StreamedResponse stream(\Closure $callback, int $status = 200, array $headers = [])
* @method static \Symfony\Component\HttpFoundation\StreamedResponse streamDownload(\Closure $callback, string|null $name = null, array $headers = [], string|null $disposition = 'attachment')
* @method static \Symfony\Component\HttpFoundation\StreamedResponse stream(callable $callback, int $status = 200, array $headers = [])
* @method static \Symfony\Component\HttpFoundation\StreamedResponse streamDownload(callable $callback, string|null $name = null, array $headers = [], string|null $disposition = 'attachment')
* @method static \Symfony\Component\HttpFoundation\BinaryFileResponse download(\SplFileInfo|string $file, string|null $name = null, array $headers = [], string|null $disposition = 'attachment')
* @method static \Symfony\Component\HttpFoundation\BinaryFileResponse file(\SplFileInfo|string $file, array $headers = [])
* @method static \Illuminate\Http\RedirectResponse redirectTo(string $path, int $status = 302, array $headers = [], bool|null $secure = null)
+1
View File
@@ -29,6 +29,7 @@ namespace Illuminate\Support\Facades;
* @method static void rename(string $from, string $to)
* @method static bool enableForeignKeyConstraints()
* @method static bool disableForeignKeyConstraints()
* @method static mixed withoutForeignKeyConstraints(\Closure $callback)
* @method static \Illuminate\Database\Connection getConnection()
* @method static \Illuminate\Database\Schema\Builder setConnection(\Illuminate\Database\Connection $connection)
* @method static void blueprintResolver(\Closure $resolver)
+3 -3
View File
@@ -47,8 +47,8 @@ namespace Illuminate\Support\Facades;
* @method static string getName()
* @method static void setName(string $name)
* @method static string getId()
* @method static void setId(string $id)
* @method static bool isValidId(string $id)
* @method static void setId(string|null $id)
* @method static bool isValidId(string|null $id)
* @method static void setExists(bool $value)
* @method static string token()
* @method static void regenerateToken()
@@ -56,7 +56,7 @@ namespace Illuminate\Support\Facades;
* @method static void setPreviousUrl(string $url)
* @method static void passwordConfirmed()
* @method static \SessionHandlerInterface getHandler()
* @method static void setHandler(\SessionHandlerInterface $handler)
* @method static \SessionHandlerInterface setHandler(\SessionHandlerInterface $handler)
* @method static bool handlerNeedsRequest()
* @method static void setRequestOnHandler(\Illuminate\Http\Request $request)
* @method static void macro(string $name, object|callable $macro)
+37
View File
@@ -41,6 +41,43 @@ use Illuminate\Filesystem\Filesystem;
* @method static array allDirectories(string|null $directory = null)
* @method static bool makeDirectory(string $path)
* @method static bool deleteDirectory(string $directory)
* @method static \Illuminate\Filesystem\FilesystemAdapter assertExists(string|array $path, string|null $content = null)
* @method static \Illuminate\Filesystem\FilesystemAdapter assertMissing(string|array $path)
* @method static \Illuminate\Filesystem\FilesystemAdapter assertDirectoryEmpty(string $path)
* @method static bool missing(string $path)
* @method static bool fileExists(string $path)
* @method static bool fileMissing(string $path)
* @method static bool directoryExists(string $path)
* @method static bool directoryMissing(string $path)
* @method static string path(string $path)
* @method static \Symfony\Component\HttpFoundation\StreamedResponse response(string $path, string|null $name = null, array $headers = [], string|null $disposition = 'inline')
* @method static \Symfony\Component\HttpFoundation\StreamedResponse download(string $path, string|null $name = null, array $headers = [])
* @method static string|false putFile(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, mixed $options = [])
* @method static string|false putFileAs(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, string $name, mixed $options = [])
* @method static string|false checksum(string $path, array $options = [])
* @method static string|false mimeType(string $path)
* @method static string url(string $path)
* @method static bool providesTemporaryUrls()
* @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()
* @method static \League\Flysystem\FilesystemAdapter getAdapter()
* @method static array getConfig()
* @method static void buildTemporaryUrlsUsing(\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)
* @method static void mixin(object $mixin, bool $replace = true)
* @method static bool hasMacro(string $name)
* @method static void flushMacros()
* @method static mixed macroCall(string $method, array $parameters)
* @method static bool has(string $location)
* @method static string read(string $location)
* @method static \League\Flysystem\DirectoryListing listContents(string $location, bool $deep = false)
* @method static int fileSize(string $path)
* @method static string visibility(string $path)
* @method static void write(string $location, string $contents, array $config = [])
* @method static void createDirectory(string $location, array $config = [])
*
* @see \Illuminate\Filesystem\FilesystemManager
*/
+4 -4
View File
@@ -5,16 +5,16 @@ namespace Illuminate\Support\Facades;
/**
* @method static array preloadedAssets()
* @method static string|null cspNonce()
* @method static string useCspNonce(?string $nonce = null)
* @method static string useCspNonce(string|null $nonce = null)
* @method static \Illuminate\Foundation\Vite useIntegrityKey(string|false $key)
* @method static \Illuminate\Foundation\Vite withEntryPoints(array $entryPoints)
* @method static \Illuminate\Foundation\Vite useManifestFilename(string $filename)
* @method static string hotFile()
* @method static \Illuminate\Foundation\Vite useHotFile(string $path)
* @method static \Illuminate\Foundation\Vite useBuildDirectory(string $path)
* @method static \Illuminate\Foundation\Vite useScriptTagAttributes((callable(string, string, ?array, ?array): array)|array $attributes)
* @method static \Illuminate\Foundation\Vite useStyleTagAttributes((callable(string, string, ?array, ?array): array)|array $attributes)
* @method static \Illuminate\Foundation\Vite usePreloadTagAttributes((callable(string, string, ?array, ?array): array|false)|array|false $attributes)
* @method static \Illuminate\Foundation\Vite useScriptTagAttributes(callable|array $attributes)
* @method static \Illuminate\Foundation\Vite useStyleTagAttributes(callable|array $attributes)
* @method static \Illuminate\Foundation\Vite usePreloadTagAttributes(callable|array|false $attributes)
* @method static \Illuminate\Support\HtmlString|void reactRefresh()
* @method static string asset(string $asset, string|null $buildDirectory = null)
* @method static string|null manifestHash(string|null $buildDirectory = null)
+5
View File
@@ -2,6 +2,7 @@
namespace Illuminate\Support;
use BackedEnum;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\Support\Jsonable;
@@ -69,6 +70,10 @@ class Js implements Htmlable
return $data->toHtml();
}
if ($data instanceof BackedEnum) {
$data = $data->value;
}
$json = $this->jsonEncode($data, $flags, $depth);
if (is_string($data)) {
+4 -3
View File
@@ -45,7 +45,8 @@ class Lottery
* Create a new Lottery instance.
*
* @param int|float $chances
* @param ?int $outOf
* @param int|null $outOf
* @return void
*/
public function __construct($chances, $outOf = null)
{
@@ -62,7 +63,7 @@ class Lottery
* Create a new Lottery instance.
*
* @param int|float $chances
* @param ?int $outOf
* @param int|null $outOf
* @return static
*/
public static function odds($chances, $outOf = null)
@@ -258,7 +259,7 @@ class Lottery
}
/**
* Set the factory that should be used to deterine the lottery results.
* Set the factory that should be used to determine the lottery results.
*
* @param callable $factory
* @return void
-2
View File
@@ -28,8 +28,6 @@ class Pluralizer
* @var string[]
*/
public static $uncountable = [
'cattle',
'kin',
'recommended',
'related',
];
+4 -2
View File
@@ -735,7 +735,9 @@ class Str
while (($len = strlen($string)) < $length) {
$size = $length - $len;
$bytes = random_bytes($size);
$bytesSize = (int) ceil($size / 3) * 3;
$bytes = random_bytes($bytesSize);
$string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size);
}
@@ -1073,7 +1075,7 @@ class Str
*/
public static function squish($value)
{
return preg_replace('~(\s|\x{3164})+~u', ' ', preg_replace('~^[\s]+|[\s]+$~u', '', $value));
return preg_replace('~(\s|\x{3164})+~u', ' ', preg_replace('~^[\s\x{FEFF}]+|[\s\x{FEFF}]+$~u', '', $value));
}
/**
+2 -2
View File
@@ -57,7 +57,7 @@ class Stringable implements JsonSerializable
/**
* Append the given values to the string.
*
* @param array $values
* @param string ...$values
* @return static
*/
public function append(...$values)
@@ -545,7 +545,7 @@ class Stringable implements JsonSerializable
/**
* Prepend the given values to the string.
*
* @param array $values
* @param string ...$values
* @return static
*/
public function prepend(...$values)
+3 -1
View File
@@ -79,7 +79,9 @@ class BatchFake extends Batch
*/
public function add($jobs)
{
$this->added[] = array_merge($this->added, $jobs);
foreach ($jobs as $job) {
$this->added[] = $job;
}
return $this;
}
+26 -8
View File
@@ -127,15 +127,21 @@ class BusFake implements QueueingDispatcher
/**
* Assert if a job was pushed a number of times.
*
* @param string $command
* @param string|\Closure $command
* @param int $times
* @return void
*/
public function assertDispatchedTimes($command, $times = 1)
{
$count = $this->dispatched($command)->count() +
$this->dispatchedAfterResponse($command)->count() +
$this->dispatchedSync($command)->count();
$callback = null;
if ($command instanceof Closure) {
[$command, $callback] = [$this->firstClosureParameterType($command), $command];
}
$count = $this->dispatched($command, $callback)->count() +
$this->dispatchedAfterResponse($command, $callback)->count() +
$this->dispatchedSync($command, $callback)->count();
PHPUnit::assertSame(
$times, $count,
@@ -200,13 +206,19 @@ class BusFake implements QueueingDispatcher
/**
* Assert if a job was pushed synchronously a number of times.
*
* @param string $command
* @param string|\Closure $command
* @param int $times
* @return void
*/
public function assertDispatchedSyncTimes($command, $times = 1)
{
$count = $this->dispatchedSync($command)->count();
$callback = null;
if ($command instanceof Closure) {
[$command, $callback] = [$this->firstClosureParameterType($command), $command];
}
$count = $this->dispatchedSync($command, $callback)->count();
PHPUnit::assertSame(
$times, $count,
@@ -259,13 +271,19 @@ class BusFake implements QueueingDispatcher
/**
* Assert if a job was pushed after the response was sent a number of times.
*
* @param string $command
* @param string|\Closure $command
* @param int $times
* @return void
*/
public function assertDispatchedAfterResponseTimes($command, $times = 1)
{
$count = $this->dispatchedAfterResponse($command)->count();
$callback = null;
if ($command instanceof Closure) {
[$command, $callback] = [$this->firstClosureParameterType($command), $command];
}
$count = $this->dispatchedAfterResponse($command, $callback)->count();
PHPUnit::assertSame(
$times, $count,
+9 -4
View File
@@ -85,21 +85,26 @@ class EventFake implements Dispatcher
$actualListener = (new ReflectionFunction($listenerClosure))
->getStaticVariables()['listener'];
$normalizedListener = $expectedListener;
if (is_string($actualListener) && Str::contains($actualListener, '@')) {
$actualListener = Str::parseCallback($actualListener);
if (is_string($expectedListener)) {
if (Str::contains($expectedListener, '@')) {
$expectedListener = Str::parseCallback($expectedListener);
$normalizedListener = Str::parseCallback($expectedListener);
} else {
$expectedListener = [$expectedListener, 'handle'];
$normalizedListener = [
$expectedListener,
method_exists($expectedListener, 'handle') ? 'handle' : '__invoke',
];
}
}
}
if ($actualListener === $expectedListener ||
if ($actualListener === $normalizedListener ||
($actualListener instanceof Closure &&
$expectedListener === Closure::class)) {
$normalizedListener === Closure::class)) {
PHPUnit::assertTrue(true);
return;
+4 -2
View File
@@ -14,9 +14,11 @@ class Timebox
/**
* Invoke the given callback within the specified timebox minimum.
*
* @param callable $callback
* @template TCallReturnType
*
* @param (callable($this): TCallReturnType) $callback
* @param int $microseconds
* @return mixed
* @return TCallReturnType
*/
public function call(callable $callback, int $microseconds)
{
+2 -1
View File
@@ -15,7 +15,8 @@
],
"require": {
"php": "^8.0.2",
"ext-json": "*",
"ext-ctype": "*",
"ext-filter": "*",
"ext-mbstring": "*",
"doctrine/inflector": "^2.0",
"illuminate/collections": "^9.0",
+3 -2
View File
@@ -412,10 +412,11 @@ if (! function_exists('with')) {
* Return the given value, optionally passed through the given callback.
*
* @template TValue
* @template TReturn
*
* @param TValue $value
* @param (callable(TValue): TValue)|null $callback
* @return TValue
* @param (callable(TValue): (TReturn))|null $callback
* @return ($callback is null ? TValue : TReturn)
*/
function with($value, callable $callback = null)
{