This commit is contained in:
RafficMohammed
2023-02-17 13:25:50 +05:30
parent 2381fd7cf5
commit 67950fc78f
891 changed files with 102300 additions and 138477 deletions

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()

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)

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)

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()

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)

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 = [])

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)

View File

@@ -59,6 +59,7 @@ use Illuminate\Filesystem\Filesystem;
* @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()

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)) {

View File

@@ -259,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

View File

@@ -28,8 +28,6 @@ class Pluralizer
* @var string[]
*/
public static $uncountable = [
'cattle',
'kin',
'recommended',
'related',
];

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));
}
/**

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)

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,

View File

@@ -85,21 +85,23 @@ 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, 'handle'];
}
}
}
if ($actualListener === $expectedListener ||
if ($actualListener === $normalizedListener ||
($actualListener instanceof Closure &&
$expectedListener === Closure::class)) {
$normalizedListener === Closure::class)) {
PHPUnit::assertTrue(true);
return;

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",