Framework Update
This commit is contained in:
Vendored
+2
-2
@@ -19,7 +19,7 @@ trait Batchable
|
||||
/**
|
||||
* The fake batch, if applicable.
|
||||
*
|
||||
* @var \Illuminate\Support\Testing\BatchFake
|
||||
* @var \Illuminate\Support\Testing\Fakes\BatchFake
|
||||
*/
|
||||
private $fakeBatch;
|
||||
|
||||
@@ -77,7 +77,7 @@ trait Batchable
|
||||
* @param \Carbon\CarbonImmutable $createdAt
|
||||
* @param \Carbon\CarbonImmutable|null $cancelledAt
|
||||
* @param \Carbon\CarbonImmutable|null $finishedAt
|
||||
* @return array{0: $this, 1: \Illuminate\Support\Testing\BatchFake}
|
||||
* @return array{0: $this, 1: \Illuminate\Support\Testing\Fakes\BatchFake}
|
||||
*/
|
||||
public function withFakeBatch(string $id = '',
|
||||
string $name = '',
|
||||
|
||||
Vendored
+1
-1
@@ -263,7 +263,7 @@ class Dispatcher implements QueueingDispatcher
|
||||
public function dispatchAfterResponse($command, $handler = null)
|
||||
{
|
||||
$this->container->terminating(function () use ($command, $handler) {
|
||||
$this->dispatchNow($command, $handler);
|
||||
$this->dispatchSync($command, $handler);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+37
-4
@@ -617,7 +617,7 @@ class Arr
|
||||
*
|
||||
* @param array $array
|
||||
* @param int|null $number
|
||||
* @param bool|false $preserveKeys
|
||||
* @param bool $preserveKeys
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
@@ -731,6 +731,18 @@ class Arr
|
||||
return Collection::make($array)->sortBy($callback)->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the array in descending order using the given callback or "dot" notation.
|
||||
*
|
||||
* @param array $array
|
||||
* @param callable|array|string|null $callback
|
||||
* @return array
|
||||
*/
|
||||
public static function sortDesc($array, $callback = null)
|
||||
{
|
||||
return Collection::make($array)->sortByDesc($callback)->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively sort an array by keys and values.
|
||||
*
|
||||
@@ -783,6 +795,29 @@ class Arr
|
||||
return implode(' ', $classes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditionally compile styles from an array into a style list.
|
||||
*
|
||||
* @param array $array
|
||||
* @return string
|
||||
*/
|
||||
public static function toCssStyles($array)
|
||||
{
|
||||
$styleList = static::wrap($array);
|
||||
|
||||
$styles = [];
|
||||
|
||||
foreach ($styleList as $class => $constraint) {
|
||||
if (is_numeric($class)) {
|
||||
$styles[] = Str::finish($constraint, ';');
|
||||
} elseif ($constraint) {
|
||||
$styles[] = Str::finish($class, ';');
|
||||
}
|
||||
}
|
||||
|
||||
return implode(' ', $styles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the array using the given callback.
|
||||
*
|
||||
@@ -803,9 +838,7 @@ class Arr
|
||||
*/
|
||||
public static function whereNotNull($array)
|
||||
{
|
||||
return static::where($array, function ($value) {
|
||||
return ! is_null($value);
|
||||
});
|
||||
return static::where($array, fn ($value) => ! is_null($value));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+46
-21
@@ -84,11 +84,9 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
{
|
||||
$callback = $this->valueRetriever($callback);
|
||||
|
||||
$items = $this->map(function ($value) use ($callback) {
|
||||
return $callback($value);
|
||||
})->filter(function ($value) {
|
||||
return ! is_null($value);
|
||||
});
|
||||
$items = $this
|
||||
->map(fn ($value) => $callback($value))
|
||||
->filter(fn ($value) => ! is_null($value));
|
||||
|
||||
if ($count = $items->count()) {
|
||||
return $items->sum() / $count;
|
||||
@@ -349,14 +347,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
protected function duplicateComparator($strict)
|
||||
{
|
||||
if ($strict) {
|
||||
return function ($a, $b) {
|
||||
return $a === $b;
|
||||
};
|
||||
return fn ($a, $b) => $a === $b;
|
||||
}
|
||||
|
||||
return function ($a, $b) {
|
||||
return $a == $b;
|
||||
};
|
||||
return fn ($a, $b) => $a == $b;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,7 +373,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
/**
|
||||
* Run a filter over each of the items.
|
||||
*
|
||||
* @param (callable(TValue, TKey): bool)|null $callback
|
||||
* @param (callable(TValue, TKey): bool)|null $callback
|
||||
* @return static
|
||||
*/
|
||||
public function filter(callable $callback = null)
|
||||
@@ -627,6 +621,41 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
return new static(array_intersect($this->items, $this->getArrayableItems($items)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items, using the callback.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
|
||||
* @param callable(TValue, TValue): int $callback
|
||||
* @return static
|
||||
*/
|
||||
public function intersectUsing($items, callable $callback)
|
||||
{
|
||||
return new static(array_uintersect($this->items, $this->getArrayableItems($items), $callback));
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items with additional index check.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
|
||||
* @return static
|
||||
*/
|
||||
public function intersectAssoc($items)
|
||||
{
|
||||
return new static(array_intersect_assoc($this->items, $this->getArrayableItems($items)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items with additional index check, using the callback.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
|
||||
* @param callable(TValue, TValue): int $callback
|
||||
* @return static
|
||||
*/
|
||||
public function intersectAssocUsing($items, callable $callback)
|
||||
{
|
||||
return new static(array_intersect_uassoc($this->items, $this->getArrayableItems($items), $callback));
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items by key.
|
||||
*
|
||||
@@ -719,7 +748,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
*
|
||||
* @param string|int|array<array-key, string> $value
|
||||
* @param string|null $key
|
||||
* @return static<int, mixed>
|
||||
* @return static<array-key, mixed>
|
||||
*/
|
||||
public function pluck($value, $key = null)
|
||||
{
|
||||
@@ -872,7 +901,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
/**
|
||||
* Get the items with the specified keys.
|
||||
*
|
||||
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string $keys
|
||||
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string|null $keys
|
||||
* @return static
|
||||
*/
|
||||
public function only($keys)
|
||||
@@ -1598,13 +1627,9 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
*/
|
||||
public function zip($items)
|
||||
{
|
||||
$arrayableItems = array_map(function ($items) {
|
||||
return $this->getArrayableItems($items);
|
||||
}, func_get_args());
|
||||
$arrayableItems = array_map(fn ($items) => $this->getArrayableItems($items), func_get_args());
|
||||
|
||||
$params = array_merge([function () {
|
||||
return new static(func_get_args());
|
||||
}, $this->items], $arrayableItems);
|
||||
$params = array_merge([fn () => new static(func_get_args()), $this->items], $arrayableItems);
|
||||
|
||||
return new static(array_map(...$params));
|
||||
}
|
||||
@@ -1646,7 +1671,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
/**
|
||||
* Count the number of items in the collection by a field or using a callback.
|
||||
*
|
||||
* @param (callable(TValue, TKey): mixed)|string|null $countBy
|
||||
* @param (callable(TValue, TKey): array-key)|string|null $countBy
|
||||
* @return static<array-key, int>
|
||||
*/
|
||||
public function countBy($countBy = null)
|
||||
|
||||
+3
-4
@@ -51,11 +51,10 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
/**
|
||||
* Wrap the given value in a collection if applicable.
|
||||
*
|
||||
* @template TWrapKey of array-key
|
||||
* @template TWrapValue
|
||||
*
|
||||
* @param iterable<TWrapKey, TWrapValue> $value
|
||||
* @return static<TWrapKey, TWrapValue>
|
||||
* @param iterable<array-key, TWrapValue>|TWrapValue $value
|
||||
* @return static<array-key, TWrapValue>
|
||||
*/
|
||||
public static function wrap($value);
|
||||
|
||||
@@ -1168,7 +1167,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
/**
|
||||
* Count the number of items in the collection by a field or using a callback.
|
||||
*
|
||||
* @param (callable(TValue, TKey): mixed)|string|null $countBy
|
||||
* @param (callable(TValue, TKey): array-key)|string|null $countBy
|
||||
* @return static<array-key, int>
|
||||
*/
|
||||
public function countBy($countBy = null);
|
||||
|
||||
+47
-8
@@ -292,7 +292,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
/**
|
||||
* Count the number of items in the collection by a field or using a callback.
|
||||
*
|
||||
* @param (callable(TValue, TKey): mixed)|string|null $countBy
|
||||
* @param (callable(TValue, TKey): array-key)|string|null $countBy
|
||||
* @return static<array-key, int>
|
||||
*/
|
||||
public function countBy($countBy = null)
|
||||
@@ -430,9 +430,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
public function filter(callable $callback = null)
|
||||
{
|
||||
if (is_null($callback)) {
|
||||
$callback = function ($value) {
|
||||
return (bool) $value;
|
||||
};
|
||||
$callback = fn ($value) => (bool) $value;
|
||||
}
|
||||
|
||||
return new static(function () use ($callback) {
|
||||
@@ -632,6 +630,41 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
return $this->passthru('intersect', func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items, using the callback.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
|
||||
* @param callable(TValue, TValue): int $callback
|
||||
* @return static
|
||||
*/
|
||||
public function intersectUsing()
|
||||
{
|
||||
return $this->passthru('intersectUsing', func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items with additional index check.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
|
||||
* @return static
|
||||
*/
|
||||
public function intersectAssoc($items)
|
||||
{
|
||||
return $this->passthru('intersectAssoc', func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items with additional index check, using the callback.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
|
||||
* @param callable(TValue, TValue): int $callback
|
||||
* @return static
|
||||
*/
|
||||
public function intersectAssocUsing($items, callable $callback)
|
||||
{
|
||||
return $this->passthru('intersectAssocUsing', func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect the collection with the given items by key.
|
||||
*
|
||||
@@ -1465,9 +1498,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
/** @var callable(TValue, TKey): bool $callback */
|
||||
$callback = $this->useAsCallable($value) ? $value : $this->equality($value);
|
||||
|
||||
return $this->takeUntil(function ($item, $key) use ($callback) {
|
||||
return ! $callback($item, $key);
|
||||
});
|
||||
return $this->takeUntil(fn ($item, $key) => ! $callback($item, $key));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1636,7 +1667,15 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
return new ArrayIterator($source);
|
||||
}
|
||||
|
||||
return $source();
|
||||
if (is_callable($source)) {
|
||||
$maybeTraversable = $source();
|
||||
|
||||
return $maybeTraversable instanceof Traversable
|
||||
? $maybeTraversable
|
||||
: new ArrayIterator(Arr::wrap($maybeTraversable));
|
||||
}
|
||||
|
||||
return new ArrayIterator((array) $source);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -114,11 +114,10 @@ trait EnumeratesValues
|
||||
/**
|
||||
* Wrap the given value in a collection if applicable.
|
||||
*
|
||||
* @template TWrapKey of array-key
|
||||
* @template TWrapValue
|
||||
*
|
||||
* @param iterable<TWrapKey, TWrapValue> $value
|
||||
* @return static<TWrapKey, TWrapValue>
|
||||
* @param iterable<array-key, TWrapValue>|TWrapValue $value
|
||||
* @return static<array-key, TWrapValue>
|
||||
*/
|
||||
public static function wrap($value)
|
||||
{
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ if (! function_exists('collect')) {
|
||||
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|null $value
|
||||
* @return \Illuminate\Support\Collection<TKey, TValue>
|
||||
*/
|
||||
function collect($value = null)
|
||||
function collect($value = [])
|
||||
{
|
||||
return new Collection($value);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ if (! function_exists('value')) {
|
||||
* Return the default value of the given value.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param mixed $args
|
||||
* @param mixed ...$args
|
||||
* @return mixed
|
||||
*/
|
||||
function value($value, ...$args)
|
||||
|
||||
@@ -13,7 +13,7 @@ trait Conditionable
|
||||
* @template TWhenParameter
|
||||
* @template TWhenReturnType
|
||||
*
|
||||
* @param (\Closure($this): TWhenParameter)|TWhenParameter|null $value
|
||||
* @param (\Closure($this): TWhenParameter)|TWhenParameter|null $value
|
||||
* @param (callable($this, TWhenParameter): TWhenReturnType)|null $callback
|
||||
* @param (callable($this, TWhenParameter): TWhenReturnType)|null $default
|
||||
* @return $this|TWhenReturnType
|
||||
|
||||
+23
-13
@@ -631,9 +631,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
*/
|
||||
public function wrap(Closure $callback, array $parameters = [])
|
||||
{
|
||||
return function () use ($callback, $parameters) {
|
||||
return $this->call($callback, $parameters);
|
||||
};
|
||||
return fn () => $this->call($callback, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -648,7 +646,25 @@ class Container implements ArrayAccess, ContainerContract
|
||||
*/
|
||||
public function call($callback, array $parameters = [], $defaultMethod = null)
|
||||
{
|
||||
return BoundMethod::call($this, $callback, $parameters, $defaultMethod);
|
||||
$pushedToBuildStack = false;
|
||||
|
||||
if (is_array($callback) && ! in_array(
|
||||
$className = (is_string($callback[0]) ? $callback[0] : get_class($callback[0])),
|
||||
$this->buildStack,
|
||||
true
|
||||
)) {
|
||||
$this->buildStack[] = $className;
|
||||
|
||||
$pushedToBuildStack = true;
|
||||
}
|
||||
|
||||
$result = BoundMethod::call($this, $callback, $parameters, $defaultMethod);
|
||||
|
||||
if ($pushedToBuildStack) {
|
||||
array_pop($this->buildStack);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -659,9 +675,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
*/
|
||||
public function factory($abstract)
|
||||
{
|
||||
return function () use ($abstract) {
|
||||
return $this->make($abstract);
|
||||
};
|
||||
return fn () => $this->make($abstract);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1065,9 +1079,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
return $this->make($className);
|
||||
}
|
||||
|
||||
return array_map(function ($abstract) {
|
||||
return $this->resolve($abstract);
|
||||
}, $concrete);
|
||||
return array_map(fn ($abstract) => $this->resolve($abstract), $concrete);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1428,9 +1440,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
*/
|
||||
public function offsetSet($key, $value): void
|
||||
{
|
||||
$this->bind($key, $value instanceof Closure ? $value : function () use ($value) {
|
||||
return $value;
|
||||
});
|
||||
$this->bind($key, $value instanceof Closure ? $value : fn () => $value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+17
-9
@@ -10,9 +10,11 @@ interface Repository extends CacheInterface
|
||||
/**
|
||||
* Retrieve an item from the cache and delete it.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
* @template TCacheValue
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param TCacheValue|(\Closure(): TCacheValue) $default
|
||||
* @return (TCacheValue is null ? mixed : TCacheValue)
|
||||
*/
|
||||
public function pull($key, $default = null);
|
||||
|
||||
@@ -66,28 +68,34 @@ interface Repository extends CacheInterface
|
||||
/**
|
||||
* Get an item from the cache, or execute the given Closure and store the result.
|
||||
*
|
||||
* @template TCacheValue
|
||||
*
|
||||
* @param string $key
|
||||
* @param \DateTimeInterface|\DateInterval|int|null $ttl
|
||||
* @param \Closure $callback
|
||||
* @return mixed
|
||||
* @param \Closure(): TCacheValue $callback
|
||||
* @return TCacheValue
|
||||
*/
|
||||
public function remember($key, $ttl, Closure $callback);
|
||||
|
||||
/**
|
||||
* Get an item from the cache, or execute the given Closure and store the result forever.
|
||||
*
|
||||
* @template TCacheValue
|
||||
*
|
||||
* @param string $key
|
||||
* @param \Closure $callback
|
||||
* @return mixed
|
||||
* @param \Closure(): TCacheValue $callback
|
||||
* @return TCacheValue
|
||||
*/
|
||||
public function sear($key, Closure $callback);
|
||||
|
||||
/**
|
||||
* Get an item from the cache, or execute the given Closure and store the result forever.
|
||||
*
|
||||
* @template TCacheValue
|
||||
*
|
||||
* @param string $key
|
||||
* @param \Closure $callback
|
||||
* @return mixed
|
||||
* @param \Closure(): TCacheValue $callback
|
||||
* @return TCacheValue
|
||||
*/
|
||||
public function rememberForever($key, Closure $callback);
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Contracts\Console;
|
||||
|
||||
interface PromptsForMissingInput
|
||||
{
|
||||
//
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ interface QueueingFactory extends Factory
|
||||
/**
|
||||
* Queue a cookie to send with the next response.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param mixed ...$parameters
|
||||
* @return void
|
||||
*/
|
||||
public function queue(...$parameters);
|
||||
|
||||
@@ -8,8 +8,7 @@ interface Castable
|
||||
* Get the name of the caster class to use when casting from / to this cast target.
|
||||
*
|
||||
* @param array $arguments
|
||||
* @return string
|
||||
* @return string|\Illuminate\Contracts\Database\Eloquent\CastsAttributes|\Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes
|
||||
* @return class-string<CastsAttributes|CastsInboundAttributes>|CastsAttributes|CastsInboundAttributes
|
||||
*/
|
||||
public static function castUsing(array $arguments);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
namespace Illuminate\Contracts\Database\Eloquent;
|
||||
|
||||
/**
|
||||
* @template TGet
|
||||
* @template TSet
|
||||
*/
|
||||
interface CastsAttributes
|
||||
{
|
||||
/**
|
||||
@@ -11,7 +15,7 @@ interface CastsAttributes
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param array $attributes
|
||||
* @return mixed
|
||||
* @return TGet|null
|
||||
*/
|
||||
public function get($model, string $key, $value, array $attributes);
|
||||
|
||||
@@ -20,7 +24,7 @@ interface CastsAttributes
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Model $model
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param TSet|null $value
|
||||
* @param array $attributes
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ interface Application extends Container
|
||||
/**
|
||||
* Get or check the current application environment.
|
||||
*
|
||||
* @param string|array $environments
|
||||
* @param string|array ...$environments
|
||||
* @return string|bool
|
||||
*/
|
||||
public function environment(...$environments);
|
||||
|
||||
+2
-2
@@ -60,7 +60,7 @@ interface ResponseFactory
|
||||
/**
|
||||
* Create a new streamed response instance.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @param callable $callback
|
||||
* @param int $status
|
||||
* @param array $headers
|
||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||
@@ -70,7 +70,7 @@ interface ResponseFactory
|
||||
/**
|
||||
* Create a new streamed response instance as a file download.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @param callable $callback
|
||||
* @param string|null $name
|
||||
* @param array $headers
|
||||
* @param string|null $disposition
|
||||
|
||||
+14
-1
@@ -118,12 +118,25 @@ abstract class Connection
|
||||
$time = round((microtime(true) - $start) * 1000, 2);
|
||||
|
||||
if (isset($this->events)) {
|
||||
$this->event(new CommandExecuted($method, $parameters, $time, $this));
|
||||
$this->event(new CommandExecuted(
|
||||
$method, $this->parseParametersForEvent($parameters), $time, $this
|
||||
));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the command's parameters for event dispatching.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return array
|
||||
*/
|
||||
protected function parseParametersForEvent(array $parameters)
|
||||
{
|
||||
return $parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire the given event if possible.
|
||||
*
|
||||
|
||||
@@ -105,7 +105,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
|
||||
* Get the value of the given hash fields.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $dictionary
|
||||
* @param mixed ...$dictionary
|
||||
* @return array
|
||||
*/
|
||||
public function hmget($key, ...$dictionary)
|
||||
@@ -121,7 +121,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
|
||||
* Set the given hash fields to their respective values.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $dictionary
|
||||
* @param mixed ...$dictionary
|
||||
* @return int
|
||||
*/
|
||||
public function hmset($key, ...$dictionary)
|
||||
@@ -166,7 +166,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
|
||||
/**
|
||||
* Removes and returns the first element of the list stored at key.
|
||||
*
|
||||
* @param mixed $arguments
|
||||
* @param mixed ...$arguments
|
||||
* @return array|null
|
||||
*/
|
||||
public function blpop(...$arguments)
|
||||
@@ -179,7 +179,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
|
||||
/**
|
||||
* Removes and returns the last element of the list stored at key.
|
||||
*
|
||||
* @param mixed $arguments
|
||||
* @param mixed ...$arguments
|
||||
* @return array|null
|
||||
*/
|
||||
public function brpop(...$arguments)
|
||||
@@ -205,7 +205,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
|
||||
* Add one or more members to a sorted set or update its score if it already exists.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $dictionary
|
||||
* @param mixed ...$dictionary
|
||||
* @return int
|
||||
*/
|
||||
public function zadd($key, ...$dictionary)
|
||||
@@ -426,7 +426,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
|
||||
*
|
||||
* @param string $script
|
||||
* @param int $numkeys
|
||||
* @param mixed $arguments
|
||||
* @param mixed ...$arguments
|
||||
* @return mixed
|
||||
*/
|
||||
public function evalsha($script, $numkeys, ...$arguments)
|
||||
@@ -441,7 +441,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
|
||||
*
|
||||
* @param string $script
|
||||
* @param int $numberOfKeys
|
||||
* @param dynamic $arguments
|
||||
* @param dynamic ...$arguments
|
||||
* @return mixed
|
||||
*/
|
||||
public function eval($script, $numberOfKeys, ...$arguments)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Illuminate\Redis\Connections;
|
||||
|
||||
use Predis\Command\Redis\FLUSHDB;
|
||||
use Predis\Command\ServerFlushDatabase;
|
||||
|
||||
class PredisClusterConnection extends PredisConnection
|
||||
@@ -13,8 +14,12 @@ class PredisClusterConnection extends PredisConnection
|
||||
*/
|
||||
public function flushdb()
|
||||
{
|
||||
$this->client->executeCommandOnNodes(
|
||||
tap(new ServerFlushDatabase)->setArguments(func_get_args())
|
||||
);
|
||||
$command = class_exists(ServerFlushDatabase::class)
|
||||
? ServerFlushDatabase::class
|
||||
: FLUSHDB::class;
|
||||
|
||||
foreach ($this->client as $node) {
|
||||
$node->executeCommand(tap(new $command)->setArguments(func_get_args()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Illuminate\Redis\Connections;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Redis\Connection as ConnectionContract;
|
||||
use Predis\Command\Argument\ArrayableArgument;
|
||||
|
||||
/**
|
||||
* @mixin \Predis\Client
|
||||
@@ -50,4 +51,20 @@ class PredisConnection extends Connection implements ConnectionContract
|
||||
|
||||
unset($loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the command's parameters for event dispatching.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return array
|
||||
*/
|
||||
protected function parseParametersForEvent(array $parameters)
|
||||
{
|
||||
return collect($parameters)
|
||||
->transform(function ($parameter) {
|
||||
return $parameter instanceof ArrayableArgument
|
||||
? $parameter->toArray()
|
||||
: $parameter;
|
||||
})->all();
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -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)
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Support\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class MathException extends RuntimeException
|
||||
{
|
||||
//
|
||||
}
|
||||
+1
-1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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)
|
||||
|
||||
Vendored
+5
@@ -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
@@ -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
@@ -28,8 +28,6 @@ class Pluralizer
|
||||
* @var string[]
|
||||
*/
|
||||
public static $uncountable = [
|
||||
'cattle',
|
||||
'kin',
|
||||
'recommended',
|
||||
'related',
|
||||
];
|
||||
|
||||
Vendored
+4
-2
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user