🔧
This commit is contained in:
@@ -29,7 +29,7 @@ class AuthorizationException extends Exception
|
||||
* @param \Throwable|null $previous
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($message = null, $code = null, Throwable $previous = null)
|
||||
public function __construct($message = null, $code = null, ?Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message ?? 'This action is unauthorized.', 0, $previous);
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class Gate implements GateContract
|
||||
array $policies = [],
|
||||
array $beforeCallbacks = [],
|
||||
array $afterCallbacks = [],
|
||||
callable $guessPolicyNamesUsingCallback = null)
|
||||
?callable $guessPolicyNamesUsingCallback = null)
|
||||
{
|
||||
$this->policies = $policies;
|
||||
$this->container = $container;
|
||||
@@ -224,7 +224,7 @@ class Gate implements GateContract
|
||||
* @param array|null $abilities
|
||||
* @return $this
|
||||
*/
|
||||
public function resource($name, $class, array $abilities = null)
|
||||
public function resource($name, $class, ?array $abilities = null)
|
||||
{
|
||||
$abilities = $abilities ?: [
|
||||
'viewAny' => 'viewAny',
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php
vendored
Normal file → Executable file
@@ -25,7 +25,7 @@ class ResetPassword extends Notification
|
||||
/**
|
||||
* The callback that should be used to build the mail message.
|
||||
*
|
||||
* @var (\Closure(mixed, string): \Illuminate\Notifications\Messages\MailMessage)|null
|
||||
* @var (\Closure(mixed, string): \Illuminate\Notifications\Messages\MailMessage|\Illuminate\Contracts\Mail\Mailable)|null
|
||||
*/
|
||||
public static $toMailCallback;
|
||||
|
||||
@@ -114,7 +114,7 @@ class ResetPassword extends Notification
|
||||
/**
|
||||
* Set a callback that should be used when building the notification mail message.
|
||||
*
|
||||
* @param \Closure(mixed, string): \Illuminate\Notifications\Messages\MailMessage $callback
|
||||
* @param \Closure(mixed, string): (\Illuminate\Notifications\Messages\MailMessage|\Illuminate\Contracts\Mail\Mailable) $callback
|
||||
* @return void
|
||||
*/
|
||||
public static function toMailUsing($callback)
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php
vendored
Normal file → Executable file
2
vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php
vendored
Normal file → Executable file
2
vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php
vendored
Normal file → Executable file
@@ -45,7 +45,7 @@ class PasswordBroker implements PasswordBrokerContract
|
||||
* @param \Closure|null $callback
|
||||
* @return string
|
||||
*/
|
||||
public function sendResetLink(array $credentials, Closure $callback = null)
|
||||
public function sendResetLink(array $credentials, ?Closure $callback = null)
|
||||
{
|
||||
// First we will check to see if we found a user at the given credentials and
|
||||
// if we did not we will redirect back to this current URI with a piece of
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php
vendored
Normal file → Executable file
@@ -33,7 +33,7 @@ class RequestGuard implements Guard
|
||||
* @param \Illuminate\Contracts\Auth\UserProvider|null $provider
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(callable $callback, Request $request, UserProvider $provider = null)
|
||||
public function __construct(callable $callback, Request $request, ?UserProvider $provider = null)
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->callback = $callback;
|
||||
|
||||
@@ -123,8 +123,8 @@ class SessionGuard implements StatefulGuard, SupportsBasicAuth
|
||||
public function __construct($name,
|
||||
UserProvider $provider,
|
||||
Session $session,
|
||||
Request $request = null,
|
||||
Timebox $timebox = null)
|
||||
?Request $request = null,
|
||||
?Timebox $timebox = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->session = $session;
|
||||
|
||||
@@ -92,7 +92,7 @@ class TokenGuard implements Guard
|
||||
/**
|
||||
* Get the token for the current request.
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTokenForRequest()
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ class BroadcastManager implements FactoryContract
|
||||
* @param array|null $attributes
|
||||
* @return void
|
||||
*/
|
||||
public function routes(array $attributes = null)
|
||||
public function routes(?array $attributes = null)
|
||||
{
|
||||
if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) {
|
||||
return;
|
||||
@@ -86,7 +86,7 @@ class BroadcastManager implements FactoryContract
|
||||
* @param array|null $attributes
|
||||
* @return void
|
||||
*/
|
||||
public function userRoutes(array $attributes = null)
|
||||
public function userRoutes(?array $attributes = null)
|
||||
{
|
||||
if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) {
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ class BroadcastManager implements FactoryContract
|
||||
* @param array|null $attributes
|
||||
* @return void
|
||||
*/
|
||||
public function channelRoutes(array $attributes = null)
|
||||
public function channelRoutes(?array $attributes = null)
|
||||
{
|
||||
$this->routes($attributes);
|
||||
}
|
||||
@@ -273,6 +273,17 @@ class BroadcastManager implements FactoryContract
|
||||
return $this->customCreators[$config['driver']]($this->app, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of the driver.
|
||||
*
|
||||
* @param array $config
|
||||
* @return \Illuminate\Contracts\Broadcasting\Broadcaster
|
||||
*/
|
||||
protected function createReverbDriver(array $config)
|
||||
{
|
||||
return $this->createPusherDriver($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of the driver.
|
||||
*
|
||||
|
||||
@@ -232,4 +232,15 @@ class AblyBroadcaster extends Broadcaster
|
||||
{
|
||||
return $this->ably;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the underlying Ably SDK instance.
|
||||
*
|
||||
* @param \Ably\AblyRest $ably
|
||||
* @return void
|
||||
*/
|
||||
public function setAbly($ably)
|
||||
{
|
||||
$this->ably = $ably;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ class Batch implements Arrayable, JsonSerializable
|
||||
* @param \Throwable|null $e
|
||||
* @return void
|
||||
*/
|
||||
protected function invokeHandlerCallback($handler, Batch $batch, Throwable $e = null)
|
||||
protected function invokeHandlerCallback($handler, Batch $batch, ?Throwable $e = null)
|
||||
{
|
||||
try {
|
||||
return $handler($batch, $e);
|
||||
|
||||
@@ -35,7 +35,7 @@ trait Batchable
|
||||
}
|
||||
|
||||
if ($this->batchId) {
|
||||
return Container::getInstance()->make(BatchRepository::class)->find($this->batchId);
|
||||
return Container::getInstance()->make(BatchRepository::class)?->find($this->batchId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ trait Batchable
|
||||
* @param int $failedJobs
|
||||
* @param array $failedJobIds
|
||||
* @param array $options
|
||||
* @param \Carbon\CarbonImmutable $createdAt
|
||||
* @param \Carbon\CarbonImmutable|null $createdAt
|
||||
* @param \Carbon\CarbonImmutable|null $cancelledAt
|
||||
* @param \Carbon\CarbonImmutable|null $finishedAt
|
||||
* @return array{0: $this, 1: \Illuminate\Support\Testing\Fakes\BatchFake}
|
||||
@@ -86,7 +86,7 @@ trait Batchable
|
||||
int $failedJobs = 0,
|
||||
array $failedJobIds = [],
|
||||
array $options = [],
|
||||
CarbonImmutable $createdAt = null,
|
||||
?CarbonImmutable $createdAt = null,
|
||||
?CarbonImmutable $cancelledAt = null,
|
||||
?CarbonImmutable $finishedAt = null)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ use Carbon\CarbonImmutable;
|
||||
use Closure;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Connection;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Database\PostgresConnection;
|
||||
use Illuminate\Database\Query\Expression;
|
||||
use Illuminate\Support\Str;
|
||||
use Throwable;
|
||||
|
||||
class DatabaseBatchRepository implements PrunableBatchRepository
|
||||
{
|
||||
@@ -352,7 +352,7 @@ class DatabaseBatchRepository implements PrunableBatchRepository
|
||||
|
||||
try {
|
||||
return unserialize($serialized);
|
||||
} catch (ModelNotFoundException) {
|
||||
} catch (Throwable) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class Dispatcher implements QueueingDispatcher
|
||||
* @param \Closure|null $queueResolver
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Container $container, Closure $queueResolver = null)
|
||||
public function __construct(Container $container, ?Closure $queueResolver = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->queueResolver = $queueResolver;
|
||||
|
||||
@@ -74,6 +74,31 @@ class PendingBatch
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a callback to be executed when the batch is stored.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function before($callback)
|
||||
{
|
||||
$this->options['before'][] = $callback instanceof Closure
|
||||
? new SerializableClosure($callback)
|
||||
: $callback;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "before" callbacks that have been registered with the pending batch.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function beforeCallbacks()
|
||||
{
|
||||
return $this->options['before'] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a callback to be executed after a job in the batch have executed successfully.
|
||||
*
|
||||
@@ -282,7 +307,7 @@ class PendingBatch
|
||||
$repository = $this->container->make(BatchRepository::class);
|
||||
|
||||
try {
|
||||
$batch = $repository->store($this);
|
||||
$batch = $this->store($repository);
|
||||
|
||||
$batch = $batch->add($this->jobs);
|
||||
} catch (Throwable $e) {
|
||||
@@ -309,7 +334,7 @@ class PendingBatch
|
||||
{
|
||||
$repository = $this->container->make(BatchRepository::class);
|
||||
|
||||
$batch = $repository->store($this);
|
||||
$batch = $this->store($repository);
|
||||
|
||||
if ($batch) {
|
||||
$this->container->terminating(function () use ($batch) {
|
||||
@@ -366,4 +391,27 @@ class PendingBatch
|
||||
{
|
||||
return ! value($boolean) ? $this->dispatch() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the batch using the given repository.
|
||||
*
|
||||
* @param \Illuminate\Bus\BatchRepository $repository
|
||||
* @return \Illuminate\Bus\Batch
|
||||
*/
|
||||
protected function store($repository)
|
||||
{
|
||||
$batch = $repository->store($this);
|
||||
|
||||
collect($this->beforeCallbacks())->each(function ($handler) use ($batch) {
|
||||
try {
|
||||
return $handler($batch);
|
||||
} catch (Throwable $e) {
|
||||
if (function_exists('report')) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return $batch;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +199,11 @@ trait Queueable
|
||||
*/
|
||||
public function prependToChain($job)
|
||||
{
|
||||
$job = match (true) {
|
||||
$job instanceof PendingBatch => new ChainedBatch($job),
|
||||
default => $job,
|
||||
};
|
||||
|
||||
$this->chained = Arr::prepend($this->chained, $this->serializeJob($job));
|
||||
|
||||
return $this;
|
||||
@@ -212,6 +217,11 @@ trait Queueable
|
||||
*/
|
||||
public function appendToChain($job)
|
||||
{
|
||||
$job = match (true) {
|
||||
$job instanceof PendingBatch => new ChainedBatch($job),
|
||||
default => $job,
|
||||
};
|
||||
|
||||
$this->chained = array_merge($this->chained, [$this->serializeJob($job)]);
|
||||
|
||||
return $this;
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/Console/ForgetCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/Console/ForgetCommand.php
vendored
Normal file → Executable file
@@ -29,7 +29,7 @@ class PruneStaleTagsCommand extends Command
|
||||
* Execute the console command.
|
||||
*
|
||||
* @param \Illuminate\Cache\CacheManager $cache
|
||||
* @return void
|
||||
* @return int|null
|
||||
*/
|
||||
public function handle(CacheManager $cache)
|
||||
{
|
||||
|
||||
4
vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php
vendored
Normal file → Executable file
4
vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php
vendored
Normal file → Executable file
@@ -158,9 +158,7 @@ class DatabaseStore implements LockProvider, Store
|
||||
$value = $this->serialize($value);
|
||||
$expiration = $this->getTime() + $seconds;
|
||||
|
||||
$doesntSupportInsertOrIgnore = [SqlServerConnection::class];
|
||||
|
||||
if (! in_array(get_class($this->getConnection()), $doesntSupportInsertOrIgnore)) {
|
||||
if (! $this->getConnection() instanceof SqlServerConnection) {
|
||||
return $this->table()->insertOrIgnore(compact('key', 'value', 'expiration')) > 0;
|
||||
}
|
||||
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Cache/FileStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/FileStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/NullStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/NullStore.php
vendored
Normal file → Executable file
@@ -105,13 +105,26 @@ class RateLimiter
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment the counter for a given key for a given decay time.
|
||||
* Increment (by 1) the counter for a given key for a given decay time.
|
||||
*
|
||||
* @param string $key
|
||||
* @param int $decaySeconds
|
||||
* @return int
|
||||
*/
|
||||
public function hit($key, $decaySeconds = 60)
|
||||
{
|
||||
return $this->increment($key, $decaySeconds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment the counter for a given key for a given decay time by a given amount.
|
||||
*
|
||||
* @param string $key
|
||||
* @param int $decaySeconds
|
||||
* @param int $amount
|
||||
* @return int
|
||||
*/
|
||||
public function increment($key, $decaySeconds = 60, $amount = 1)
|
||||
{
|
||||
$key = $this->cleanRateLimiterKey($key);
|
||||
|
||||
@@ -121,7 +134,7 @@ class RateLimiter
|
||||
|
||||
$added = $this->cache->add($key, 0, $decaySeconds);
|
||||
|
||||
$hits = (int) $this->cache->increment($key);
|
||||
$hits = (int) $this->cache->increment($key, $amount);
|
||||
|
||||
if (! $added && $hits == 1) {
|
||||
$this->cache->put($key, 1, $decaySeconds);
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php
vendored
Normal file → Executable file
@@ -11,13 +11,13 @@ class RedisTagSet extends TagSet
|
||||
* Add a reference entry to the tag set's underlying sorted set.
|
||||
*
|
||||
* @param string $key
|
||||
* @param int $ttl
|
||||
* @param int|null $ttl
|
||||
* @param string $updateWhen
|
||||
* @return void
|
||||
*/
|
||||
public function addEntry(string $key, int $ttl = 0, $updateWhen = null)
|
||||
public function addEntry(string $key, ?int $ttl = null, $updateWhen = null)
|
||||
{
|
||||
$ttl = $ttl > 0 ? Carbon::now()->addSeconds($ttl)->getTimestamp() : -1;
|
||||
$ttl = is_null($ttl) ? -1 : Carbon::now()->addSeconds($ttl)->getTimestamp();
|
||||
|
||||
foreach ($this->tagIds() as $tagKey) {
|
||||
if ($updateWhen) {
|
||||
|
||||
@@ -14,10 +14,18 @@ class RedisTaggedCache extends TaggedCache
|
||||
*/
|
||||
public function add($key, $value, $ttl = null)
|
||||
{
|
||||
$this->tags->addEntry(
|
||||
$this->itemKey($key),
|
||||
! is_null($ttl) ? $this->getSeconds($ttl) : 0
|
||||
);
|
||||
$seconds = null;
|
||||
|
||||
if ($ttl !== null) {
|
||||
$seconds = $this->getSeconds($ttl);
|
||||
|
||||
if ($seconds > 0) {
|
||||
$this->tags->addEntry(
|
||||
$this->itemKey($key),
|
||||
$seconds
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return parent::add($key, $value, $ttl);
|
||||
}
|
||||
@@ -36,10 +44,14 @@ class RedisTaggedCache extends TaggedCache
|
||||
return $this->forever($key, $value);
|
||||
}
|
||||
|
||||
$this->tags->addEntry(
|
||||
$this->itemKey($key),
|
||||
$this->getSeconds($ttl)
|
||||
);
|
||||
$seconds = $this->getSeconds($ttl);
|
||||
|
||||
if ($seconds > 0) {
|
||||
$this->tags->addEntry(
|
||||
$this->itemKey($key),
|
||||
$seconds
|
||||
);
|
||||
}
|
||||
|
||||
return parent::put($key, $value, $ttl);
|
||||
}
|
||||
|
||||
3
vendor/laravel/framework/src/Illuminate/Cache/Repository.php
vendored
Normal file → Executable file
3
vendor/laravel/framework/src/Illuminate/Cache/Repository.php
vendored
Normal file → Executable file
@@ -22,8 +22,7 @@ use Illuminate\Support\Traits\Macroable;
|
||||
*/
|
||||
class Repository implements ArrayAccess, CacheContract
|
||||
{
|
||||
use InteractsWithTime;
|
||||
use Macroable {
|
||||
use InteractsWithTime, Macroable {
|
||||
__call as macroCall;
|
||||
}
|
||||
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Cache/composer.json
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cache/composer.json
vendored
Normal file → Executable file
@@ -185,7 +185,7 @@ class Arr
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function first($array, callable $callback = null, $default = null)
|
||||
public static function first($array, ?callable $callback = null, $default = null)
|
||||
{
|
||||
if (is_null($callback)) {
|
||||
if (empty($array)) {
|
||||
@@ -216,7 +216,7 @@ class Arr
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function last($array, callable $callback = null, $default = null)
|
||||
public static function last($array, ?callable $callback = null, $default = null)
|
||||
{
|
||||
if (is_null($callback)) {
|
||||
return empty($array) ? value($default) : end($array);
|
||||
@@ -225,6 +225,22 @@ class Arr
|
||||
return static::first(array_reverse($array, true), $callback, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Take the first or last {$limit} items from an array.
|
||||
*
|
||||
* @param array $array
|
||||
* @param int $limit
|
||||
* @return array
|
||||
*/
|
||||
public static function take($array, $limit)
|
||||
{
|
||||
if ($limit < 0) {
|
||||
return array_slice($array, $limit, abs($limit));
|
||||
}
|
||||
|
||||
return array_slice($array, 0, $limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flatten a multi-dimensional array into a single level.
|
||||
*
|
||||
@@ -491,6 +507,32 @@ class Arr
|
||||
return array_intersect_key($array, array_flip((array) $keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* Select an array of values from an array.
|
||||
*
|
||||
* @param array $array
|
||||
* @param array|string $keys
|
||||
* @return array
|
||||
*/
|
||||
public static function select($array, $keys)
|
||||
{
|
||||
$keys = static::wrap($keys);
|
||||
|
||||
return static::map($array, function ($item) use ($keys) {
|
||||
$result = [];
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if (Arr::accessible($item) && Arr::exists($item, $key)) {
|
||||
$result[$key] = $item[$key];
|
||||
} elseif (is_object($item) && isset($item->{$key})) {
|
||||
$result[$key] = $item->{$key};
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Pluck an array of values from an array.
|
||||
*
|
||||
|
||||
@@ -7,6 +7,7 @@ use ArrayIterator;
|
||||
use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString;
|
||||
use Illuminate\Support\Traits\EnumeratesValues;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
use InvalidArgumentException;
|
||||
use stdClass;
|
||||
use Traversable;
|
||||
|
||||
@@ -381,7 +382,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
* @param (callable(TValue, TKey): bool)|null $callback
|
||||
* @return static
|
||||
*/
|
||||
public function filter(callable $callback = null)
|
||||
public function filter(?callable $callback = null)
|
||||
{
|
||||
if ($callback) {
|
||||
return new static(Arr::where($this->items, $callback));
|
||||
@@ -399,7 +400,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
* @param TFirstDefault|(\Closure(): TFirstDefault) $default
|
||||
* @return TValue|TFirstDefault
|
||||
*/
|
||||
public function first(callable $callback = null, $default = null)
|
||||
public function first(?callable $callback = null, $default = null)
|
||||
{
|
||||
return Arr::first($this->items, $callback, $default);
|
||||
}
|
||||
@@ -747,7 +748,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
* @param TLastDefault|(\Closure(): TLastDefault) $default
|
||||
* @return TValue|TLastDefault
|
||||
*/
|
||||
public function last(callable $callback = null, $default = null)
|
||||
public function last(?callable $callback = null, $default = null)
|
||||
{
|
||||
return Arr::last($this->items, $callback, $default);
|
||||
}
|
||||
@@ -918,6 +919,27 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
return new static(Arr::only($this->items, $keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* Select specific values from the items within the collection.
|
||||
*
|
||||
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string|null $keys
|
||||
* @return static
|
||||
*/
|
||||
public function select($keys)
|
||||
{
|
||||
if (is_null($keys)) {
|
||||
return new static($this->items);
|
||||
}
|
||||
|
||||
if ($keys instanceof Enumerable) {
|
||||
$keys = $keys->all();
|
||||
}
|
||||
|
||||
$keys = is_array($keys) ? $keys : func_get_args();
|
||||
|
||||
return new static(Arr::select($this->items, $keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get and remove the last N items from the collection.
|
||||
*
|
||||
@@ -977,8 +999,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
/**
|
||||
* Push all of the given items onto the collection.
|
||||
*
|
||||
* @param iterable<array-key, TValue> $source
|
||||
* @return static
|
||||
* @template TConcatKey of array-key
|
||||
* @template TConcatValue
|
||||
*
|
||||
* @param iterable<TConcatKey, TConcatValue> $source
|
||||
* @return static<TKey|TConcatKey, TValue|TConcatValue>
|
||||
*/
|
||||
public function concat($source)
|
||||
{
|
||||
@@ -1100,17 +1125,27 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
*
|
||||
* @param int $count
|
||||
* @return static<int, TValue>|TValue|null
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function shift($count = 1)
|
||||
{
|
||||
if ($count === 1) {
|
||||
return array_shift($this->items);
|
||||
if ($count < 0) {
|
||||
throw new InvalidArgumentException('Number of shifted items may not be less than zero.');
|
||||
}
|
||||
|
||||
if ($this->isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($count === 0) {
|
||||
return new static;
|
||||
}
|
||||
|
||||
if ($count === 1) {
|
||||
return array_shift($this->items);
|
||||
}
|
||||
|
||||
$results = [];
|
||||
|
||||
$collectionCount = $this->count();
|
||||
@@ -1376,7 +1411,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
|
||||
{
|
||||
if (is_array($callback) && ! is_callable($callback)) {
|
||||
return $this->sortByMany($callback);
|
||||
return $this->sortByMany($callback, $options);
|
||||
}
|
||||
|
||||
$results = [];
|
||||
@@ -1407,13 +1442,14 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
* Sort the collection using multiple comparisons.
|
||||
*
|
||||
* @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}> $comparisons
|
||||
* @param int $options
|
||||
* @return static
|
||||
*/
|
||||
protected function sortByMany(array $comparisons = [])
|
||||
protected function sortByMany(array $comparisons = [], int $options = SORT_REGULAR)
|
||||
{
|
||||
$items = $this->items;
|
||||
|
||||
uasort($items, function ($a, $b) use ($comparisons) {
|
||||
uasort($items, function ($a, $b) use ($comparisons, $options) {
|
||||
foreach ($comparisons as $comparison) {
|
||||
$comparison = Arr::wrap($comparison);
|
||||
|
||||
@@ -1431,7 +1467,21 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
$values = array_reverse($values);
|
||||
}
|
||||
|
||||
$result = $values[0] <=> $values[1];
|
||||
if (($options & SORT_FLAG_CASE) === SORT_FLAG_CASE) {
|
||||
if (($options & SORT_NATURAL) === SORT_NATURAL) {
|
||||
$result = strnatcasecmp($values[0], $values[1]);
|
||||
} else {
|
||||
$result = strcasecmp($values[0], $values[1]);
|
||||
}
|
||||
} else {
|
||||
$result = match ($options) {
|
||||
SORT_NUMERIC => intval($values[0]) <=> intval($values[1]),
|
||||
SORT_STRING => strcmp($values[0], $values[1]),
|
||||
SORT_NATURAL => strnatcmp($values[0], $values[1]),
|
||||
SORT_LOCALE_STRING => strcoll($values[0], $values[1]),
|
||||
default => $values[0] <=> $values[1],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if ($result === 0) {
|
||||
@@ -1454,6 +1504,16 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
|
||||
*/
|
||||
public function sortByDesc($callback, $options = SORT_REGULAR)
|
||||
{
|
||||
if (is_array($callback) && ! is_callable($callback)) {
|
||||
foreach ($callback as $index => $key) {
|
||||
$comparison = Arr::wrap($key);
|
||||
|
||||
$comparison[1] = 'desc';
|
||||
|
||||
$callback[$index] = $comparison;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sortBy($callback, $options, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param callable|null $callback
|
||||
* @return static
|
||||
*/
|
||||
public static function times($number, callable $callback = null);
|
||||
public static function times($number, ?callable $callback = null);
|
||||
|
||||
/**
|
||||
* Create a collection with the given range.
|
||||
@@ -296,7 +296,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param (callable(TValue): bool)|null $callback
|
||||
* @return static
|
||||
*/
|
||||
public function filter(callable $callback = null);
|
||||
public function filter(?callable $callback = null);
|
||||
|
||||
/**
|
||||
* Apply the callback if the given "value" is (or resolves to) truthy.
|
||||
@@ -308,7 +308,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param (callable($this): TWhenReturnType)|null $default
|
||||
* @return $this|TWhenReturnType
|
||||
*/
|
||||
public function when($value, callable $callback = null, callable $default = null);
|
||||
public function when($value, ?callable $callback = null, ?callable $default = null);
|
||||
|
||||
/**
|
||||
* Apply the callback if the collection is empty.
|
||||
@@ -319,7 +319,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param (callable($this): TWhenEmptyReturnType)|null $default
|
||||
* @return $this|TWhenEmptyReturnType
|
||||
*/
|
||||
public function whenEmpty(callable $callback, callable $default = null);
|
||||
public function whenEmpty(callable $callback, ?callable $default = null);
|
||||
|
||||
/**
|
||||
* Apply the callback if the collection is not empty.
|
||||
@@ -330,7 +330,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param (callable($this): TWhenNotEmptyReturnType)|null $default
|
||||
* @return $this|TWhenNotEmptyReturnType
|
||||
*/
|
||||
public function whenNotEmpty(callable $callback, callable $default = null);
|
||||
public function whenNotEmpty(callable $callback, ?callable $default = null);
|
||||
|
||||
/**
|
||||
* Apply the callback if the given "value" is (or resolves to) truthy.
|
||||
@@ -342,7 +342,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param (callable($this): TUnlessReturnType)|null $default
|
||||
* @return $this|TUnlessReturnType
|
||||
*/
|
||||
public function unless($value, callable $callback, callable $default = null);
|
||||
public function unless($value, callable $callback, ?callable $default = null);
|
||||
|
||||
/**
|
||||
* Apply the callback unless the collection is empty.
|
||||
@@ -353,7 +353,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param (callable($this): TUnlessEmptyReturnType)|null $default
|
||||
* @return $this|TUnlessEmptyReturnType
|
||||
*/
|
||||
public function unlessEmpty(callable $callback, callable $default = null);
|
||||
public function unlessEmpty(callable $callback, ?callable $default = null);
|
||||
|
||||
/**
|
||||
* Apply the callback unless the collection is not empty.
|
||||
@@ -364,7 +364,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param (callable($this): TUnlessNotEmptyReturnType)|null $default
|
||||
* @return $this|TUnlessNotEmptyReturnType
|
||||
*/
|
||||
public function unlessNotEmpty(callable $callback, callable $default = null);
|
||||
public function unlessNotEmpty(callable $callback, ?callable $default = null);
|
||||
|
||||
/**
|
||||
* Filter items by the given key value pair.
|
||||
@@ -476,7 +476,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param TFirstDefault|(\Closure(): TFirstDefault) $default
|
||||
* @return TValue|TFirstDefault
|
||||
*/
|
||||
public function first(callable $callback = null, $default = null);
|
||||
public function first(?callable $callback = null, $default = null);
|
||||
|
||||
/**
|
||||
* Get the first item by the given key value pair.
|
||||
@@ -618,7 +618,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
* @param TLastDefault|(\Closure(): TLastDefault) $default
|
||||
* @return TValue|TLastDefault
|
||||
*/
|
||||
public function last(callable $callback = null, $default = null);
|
||||
public function last(?callable $callback = null, $default = null);
|
||||
|
||||
/**
|
||||
* Run a map over each of the items.
|
||||
@@ -789,8 +789,11 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
|
||||
/**
|
||||
* Push all of the given items onto the collection.
|
||||
*
|
||||
* @param iterable<array-key, TValue> $source
|
||||
* @return static
|
||||
* @template TConcatKey of array-key
|
||||
* @template TConcatValue
|
||||
*
|
||||
* @param iterable<TConcatKey, TConcatValue> $source
|
||||
* @return static<TKey|TConcatKey, TValue|TConcatValue>
|
||||
*/
|
||||
public function concat($source);
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
* @param (callable(TValue, TKey): bool)|null $callback
|
||||
* @return static
|
||||
*/
|
||||
public function filter(callable $callback = null)
|
||||
public function filter(?callable $callback = null)
|
||||
{
|
||||
if (is_null($callback)) {
|
||||
$callback = fn ($value) => (bool) $value;
|
||||
@@ -452,7 +452,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
* @param TFirstDefault|(\Closure(): TFirstDefault) $default
|
||||
* @return TValue|TFirstDefault
|
||||
*/
|
||||
public function first(callable $callback = null, $default = null)
|
||||
public function first(?callable $callback = null, $default = null)
|
||||
{
|
||||
$iterator = $this->getIterator();
|
||||
|
||||
@@ -732,7 +732,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
* @param TLastDefault|(\Closure(): TLastDefault) $default
|
||||
* @return TValue|TLastDefault
|
||||
*/
|
||||
public function last(callable $callback = null, $default = null)
|
||||
public function last(?callable $callback = null, $default = null)
|
||||
{
|
||||
$needle = $placeholder = new stdClass;
|
||||
|
||||
@@ -953,11 +953,49 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Select specific values from the items within the collection.
|
||||
*
|
||||
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string $keys
|
||||
* @return static
|
||||
*/
|
||||
public function select($keys)
|
||||
{
|
||||
if ($keys instanceof Enumerable) {
|
||||
$keys = $keys->all();
|
||||
} elseif (! is_null($keys)) {
|
||||
$keys = is_array($keys) ? $keys : func_get_args();
|
||||
}
|
||||
|
||||
return new static(function () use ($keys) {
|
||||
if (is_null($keys)) {
|
||||
yield from $this;
|
||||
} else {
|
||||
foreach ($this as $item) {
|
||||
$result = [];
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if (Arr::accessible($item) && Arr::exists($item, $key)) {
|
||||
$result[$key] = $item[$key];
|
||||
} elseif (is_object($item) && isset($item->{$key})) {
|
||||
$result[$key] = $item->{$key};
|
||||
}
|
||||
}
|
||||
|
||||
yield $result;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Push all of the given items onto the collection.
|
||||
*
|
||||
* @param iterable<array-key, TValue> $source
|
||||
* @return static
|
||||
* @template TConcatKey of array-key
|
||||
* @template TConcatValue
|
||||
*
|
||||
* @param iterable<TConcatKey, TConcatValue> $source
|
||||
* @return static<TKey|TConcatKey, TValue|TConcatValue>
|
||||
*/
|
||||
public function concat($source)
|
||||
{
|
||||
|
||||
@@ -164,7 +164,7 @@ trait EnumeratesValues
|
||||
* @param (callable(int): TTimesValue)|null $callback
|
||||
* @return static<int, TTimesValue>
|
||||
*/
|
||||
public static function times($number, callable $callback = null)
|
||||
public static function times($number, ?callable $callback = null)
|
||||
{
|
||||
if ($number < 1) {
|
||||
return new static;
|
||||
@@ -534,7 +534,7 @@ trait EnumeratesValues
|
||||
* @param (callable($this): TWhenEmptyReturnType)|null $default
|
||||
* @return $this|TWhenEmptyReturnType
|
||||
*/
|
||||
public function whenEmpty(callable $callback, callable $default = null)
|
||||
public function whenEmpty(callable $callback, ?callable $default = null)
|
||||
{
|
||||
return $this->when($this->isEmpty(), $callback, $default);
|
||||
}
|
||||
@@ -548,7 +548,7 @@ trait EnumeratesValues
|
||||
* @param (callable($this): TWhenNotEmptyReturnType)|null $default
|
||||
* @return $this|TWhenNotEmptyReturnType
|
||||
*/
|
||||
public function whenNotEmpty(callable $callback, callable $default = null)
|
||||
public function whenNotEmpty(callable $callback, ?callable $default = null)
|
||||
{
|
||||
return $this->when($this->isNotEmpty(), $callback, $default);
|
||||
}
|
||||
@@ -562,7 +562,7 @@ trait EnumeratesValues
|
||||
* @param (callable($this): TUnlessEmptyReturnType)|null $default
|
||||
* @return $this|TUnlessEmptyReturnType
|
||||
*/
|
||||
public function unlessEmpty(callable $callback, callable $default = null)
|
||||
public function unlessEmpty(callable $callback, ?callable $default = null)
|
||||
{
|
||||
return $this->whenNotEmpty($callback, $default);
|
||||
}
|
||||
@@ -576,7 +576,7 @@ trait EnumeratesValues
|
||||
* @param (callable($this): TUnlessNotEmptyReturnType)|null $default
|
||||
* @return $this|TUnlessNotEmptyReturnType
|
||||
*/
|
||||
public function unlessNotEmpty(callable $callback, callable $default = null)
|
||||
public function unlessNotEmpty(callable $callback, ?callable $default = null)
|
||||
{
|
||||
return $this->whenEmpty($callback, $default);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ trait Conditionable
|
||||
* @param (callable($this, TWhenParameter): TWhenReturnType)|null $default
|
||||
* @return $this|TWhenReturnType
|
||||
*/
|
||||
public function when($value = null, callable $callback = null, callable $default = null)
|
||||
public function when($value = null, ?callable $callback = null, ?callable $default = null)
|
||||
{
|
||||
$value = $value instanceof Closure ? $value($this) : $value;
|
||||
|
||||
@@ -50,7 +50,7 @@ trait Conditionable
|
||||
* @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default
|
||||
* @return $this|TUnlessReturnType
|
||||
*/
|
||||
public function unless($value = null, callable $callback = null, callable $default = null)
|
||||
public function unless($value = null, ?callable $callback = null, ?callable $default = null)
|
||||
{
|
||||
$value = $value instanceof Closure ? $value($this) : $value;
|
||||
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Config/composer.json
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Config/composer.json
vendored
Normal file → Executable file
4
vendor/laravel/framework/src/Illuminate/Console/Application.php
vendored
Normal file → Executable file
4
vendor/laravel/framework/src/Illuminate/Console/Application.php
vendored
Normal file → Executable file
@@ -237,7 +237,9 @@ class Application extends SymfonyApplication implements ApplicationContract
|
||||
public function resolve($command)
|
||||
{
|
||||
if (is_subclass_of($command, SymfonyCommand::class) && ($commandName = $command::getDefaultName())) {
|
||||
$this->commandMap[$commandName] = $command;
|
||||
foreach (explode('|', $commandName) as $name) {
|
||||
$this->commandMap[$name] = $command;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
10
vendor/laravel/framework/src/Illuminate/Console/Command.php
vendored
Normal file → Executable file
10
vendor/laravel/framework/src/Illuminate/Console/Command.php
vendored
Normal file → Executable file
@@ -236,11 +236,13 @@ class Command extends SymfonyCommand
|
||||
*/
|
||||
protected function resolveCommand($command)
|
||||
{
|
||||
if (! class_exists($command)) {
|
||||
return $this->getApplication()->find($command);
|
||||
}
|
||||
if (is_string($command)) {
|
||||
if (! class_exists($command)) {
|
||||
return $this->getApplication()->find($command);
|
||||
}
|
||||
|
||||
$command = $this->laravel->make($command);
|
||||
$command = $this->laravel->make($command);
|
||||
}
|
||||
|
||||
if ($command instanceof SymfonyCommand) {
|
||||
$command->setApplication($this->getApplication());
|
||||
|
||||
@@ -17,7 +17,9 @@ trait InteractsWithSignals
|
||||
/**
|
||||
* Define a callback to be run when the given signal(s) occurs.
|
||||
*
|
||||
* @param iterable<array-key, int>|int $signals
|
||||
* @template TSignals of iterable<array-key, int>|int
|
||||
*
|
||||
* @param (\Closure():(TSignals))|TSignals $signals
|
||||
* @param callable(int $signal): void $callback
|
||||
* @return void
|
||||
*/
|
||||
@@ -28,7 +30,7 @@ trait InteractsWithSignals
|
||||
$this->getApplication()->getSignalRegistry(),
|
||||
);
|
||||
|
||||
collect(Arr::wrap($signals))
|
||||
collect(Arr::wrap(value($signals)))
|
||||
->each(fn ($signal) => $this->signals->register($signal, $callback));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ abstract class GeneratorCommand extends Command implements PromptsForMissingInpu
|
||||
'namespace',
|
||||
'new',
|
||||
'or',
|
||||
'parent',
|
||||
'print',
|
||||
'private',
|
||||
'protected',
|
||||
|
||||
@@ -32,9 +32,9 @@ class CommandBuilder
|
||||
{
|
||||
$output = ProcessUtils::escapeArgument($event->output);
|
||||
|
||||
return $this->ensureCorrectUser(
|
||||
$event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1'
|
||||
);
|
||||
return laravel_cloud()
|
||||
? $this->ensureCorrectUser($event, $event->command.' 2>&1 | tee '.($event->shouldAppendOutput ? '-a ' : '').$output)
|
||||
: $this->ensureCorrectUser($event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -289,7 +289,11 @@ class Event
|
||||
{
|
||||
return Process::fromShellCommandline(
|
||||
$this->buildCommand(), base_path(), null, null, null
|
||||
)->run();
|
||||
)->run(
|
||||
laravel_cloud()
|
||||
? fn ($type, $line) => fwrite($type === 'out' ? STDOUT : STDERR, $line)
|
||||
: fn () => true
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,12 +112,14 @@ class ScheduleRunCommand extends Command
|
||||
$this->handler = $handler;
|
||||
$this->phpBinary = Application::phpBinary();
|
||||
|
||||
$this->clearInterruptSignal();
|
||||
|
||||
$this->newLine();
|
||||
|
||||
$events = $this->schedule->dueEvents($this->laravel);
|
||||
|
||||
if ($events->contains->isRepeatable()) {
|
||||
$this->clearInterruptSignal();
|
||||
}
|
||||
|
||||
foreach ($events as $event) {
|
||||
if (! $event->filtersPass($this->laravel)) {
|
||||
$this->dispatcher->dispatch(new ScheduledTaskSkipped($event));
|
||||
@@ -271,7 +273,7 @@ class ScheduleRunCommand extends Command
|
||||
/**
|
||||
* Ensure the interrupt signal is cleared.
|
||||
*
|
||||
* @return bool
|
||||
* @return void
|
||||
*/
|
||||
protected function clearInterruptSignal()
|
||||
{
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Console/composer.json
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Console/composer.json
vendored
Normal file → Executable file
8
vendor/laravel/framework/src/Illuminate/Container/Container.php
vendored
Normal file → Executable file
8
vendor/laravel/framework/src/Illuminate/Container/Container.php
vendored
Normal file → Executable file
@@ -1148,7 +1148,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function beforeResolving($abstract, Closure $callback = null)
|
||||
public function beforeResolving($abstract, ?Closure $callback = null)
|
||||
{
|
||||
if (is_string($abstract)) {
|
||||
$abstract = $this->getAlias($abstract);
|
||||
@@ -1168,7 +1168,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function resolving($abstract, Closure $callback = null)
|
||||
public function resolving($abstract, ?Closure $callback = null)
|
||||
{
|
||||
if (is_string($abstract)) {
|
||||
$abstract = $this->getAlias($abstract);
|
||||
@@ -1188,7 +1188,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function afterResolving($abstract, Closure $callback = null)
|
||||
public function afterResolving($abstract, ?Closure $callback = null)
|
||||
{
|
||||
if (is_string($abstract)) {
|
||||
$abstract = $this->getAlias($abstract);
|
||||
@@ -1427,7 +1427,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param \Illuminate\Contracts\Container\Container|null $container
|
||||
* @return \Illuminate\Contracts\Container\Container|static
|
||||
*/
|
||||
public static function setInstance(ContainerContract $container = null)
|
||||
public static function setInstance(?ContainerContract $container = null)
|
||||
{
|
||||
return static::$instance = $container;
|
||||
}
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Container/composer.json
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Container/composer.json
vendored
Normal file → Executable file
@@ -29,7 +29,7 @@ interface Gate
|
||||
* @param array|null $abilities
|
||||
* @return $this
|
||||
*/
|
||||
public function resource($name, $class, array $abilities = null);
|
||||
public function resource($name, $class, ?array $abilities = null);
|
||||
|
||||
/**
|
||||
* Define a policy class for a given class type.
|
||||
|
||||
@@ -48,7 +48,7 @@ interface PasswordBroker
|
||||
* @param \Closure|null $callback
|
||||
* @return string
|
||||
*/
|
||||
public function sendResetLink(array $credentials, Closure $callback = null);
|
||||
public function sendResetLink(array $credentials, ?Closure $callback = null);
|
||||
|
||||
/**
|
||||
* Reset the password for the given token.
|
||||
|
||||
@@ -197,7 +197,7 @@ interface Container extends ContainerInterface
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function beforeResolving($abstract, Closure $callback = null);
|
||||
public function beforeResolving($abstract, ?Closure $callback = null);
|
||||
|
||||
/**
|
||||
* Register a new resolving callback.
|
||||
@@ -206,7 +206,7 @@ interface Container extends ContainerInterface
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function resolving($abstract, Closure $callback = null);
|
||||
public function resolving($abstract, ?Closure $callback = null);
|
||||
|
||||
/**
|
||||
* Register a new after resolving callback.
|
||||
@@ -215,5 +215,5 @@ interface Container extends ContainerInterface
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function afterResolving($abstract, Closure $callback = null);
|
||||
public function afterResolving($abstract, ?Closure $callback = null);
|
||||
}
|
||||
|
||||
@@ -60,5 +60,5 @@ interface InvokedProcess
|
||||
* @param callable|null $output
|
||||
* @return \Illuminate\Console\Process\ProcessResult
|
||||
*/
|
||||
public function wait(callable $output = null);
|
||||
public function wait(?callable $output = null);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ interface ProcessResult
|
||||
* @param callable|null $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function throw(callable $callback = null);
|
||||
public function throw(?callable $callback = null);
|
||||
|
||||
/**
|
||||
* Throw an exception if the process failed and the given condition is true.
|
||||
@@ -61,5 +61,5 @@ interface ProcessResult
|
||||
* @param callable|null $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function throwIf(bool $condition, callable $callback = null);
|
||||
public function throwIf(bool $condition, ?callable $callback = null);
|
||||
}
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/Arrayable.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/Arrayable.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/Jsonable.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/Jsonable.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/MessageProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/MessageProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/Renderable.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Support/Renderable.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Translation/Loader.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/Translation/Loader.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/View/Engine.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Contracts/View/Engine.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cookie/CookieJar.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cookie/CookieJar.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cookie/CookieServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cookie/CookieServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cookie/composer.json
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Cookie/composer.json
vendored
Normal file → Executable file
2
vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php
vendored
Normal file → Executable file
2
vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php
vendored
Normal file → Executable file
@@ -27,7 +27,7 @@ class Manager
|
||||
* @param \Illuminate\Container\Container|null $container
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Container $container = null)
|
||||
public function __construct(?Container $container = null)
|
||||
{
|
||||
$this->setupContainer($container ?: new Container);
|
||||
|
||||
|
||||
@@ -379,11 +379,14 @@ trait BuildsQueries
|
||||
$orders = $this->ensureOrderForCursorPagination(! is_null($cursor) && $cursor->pointsToPreviousItems());
|
||||
|
||||
if (! is_null($cursor)) {
|
||||
$addCursorConditions = function (self $builder, $previousColumn, $i) use (&$addCursorConditions, $cursor, $orders) {
|
||||
$unionBuilders = isset($builder->unions) ? collect($builder->unions)->pluck('query') : collect();
|
||||
// Reset the union bindings so we can add the cursor where in the correct position...
|
||||
$this->setBindings([], 'union');
|
||||
|
||||
$addCursorConditions = function (self $builder, $previousColumn, $originalColumn, $i) use (&$addCursorConditions, $cursor, $orders) {
|
||||
$unionBuilders = $builder->getUnionBuilders();
|
||||
|
||||
if (! is_null($previousColumn)) {
|
||||
$originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $previousColumn);
|
||||
$originalColumn ??= $this->getOriginalColumnNameForCursorPagination($this, $previousColumn);
|
||||
|
||||
$builder->where(
|
||||
Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn,
|
||||
@@ -393,7 +396,7 @@ trait BuildsQueries
|
||||
|
||||
$unionBuilders->each(function ($unionBuilder) use ($previousColumn, $cursor) {
|
||||
$unionBuilder->where(
|
||||
$this->getOriginalColumnNameForCursorPagination($this, $previousColumn),
|
||||
$this->getOriginalColumnNameForCursorPagination($unionBuilder, $previousColumn),
|
||||
'=',
|
||||
$cursor->parameter($previousColumn)
|
||||
);
|
||||
@@ -402,44 +405,48 @@ trait BuildsQueries
|
||||
});
|
||||
}
|
||||
|
||||
$builder->where(function (self $builder) use ($addCursorConditions, $cursor, $orders, $i, $unionBuilders) {
|
||||
$builder->where(function (self $secondBuilder) use ($addCursorConditions, $cursor, $orders, $i, $unionBuilders) {
|
||||
['column' => $column, 'direction' => $direction] = $orders[$i];
|
||||
|
||||
$originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $column);
|
||||
|
||||
$builder->where(
|
||||
$secondBuilder->where(
|
||||
Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn,
|
||||
$direction === 'asc' ? '>' : '<',
|
||||
$cursor->parameter($column)
|
||||
);
|
||||
|
||||
if ($i < $orders->count() - 1) {
|
||||
$builder->orWhere(function (self $builder) use ($addCursorConditions, $column, $i) {
|
||||
$addCursorConditions($builder, $column, $i + 1);
|
||||
$secondBuilder->orWhere(function (self $thirdBuilder) use ($addCursorConditions, $column, $originalColumn, $i) {
|
||||
$addCursorConditions($thirdBuilder, $column, $originalColumn, $i + 1);
|
||||
});
|
||||
}
|
||||
|
||||
$unionBuilders->each(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions) {
|
||||
$unionBuilder->where(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions) {
|
||||
$unionWheres = $unionBuilder->getRawBindings()['where'];
|
||||
|
||||
$originalColumn = $this->getOriginalColumnNameForCursorPagination($unionBuilder, $column);
|
||||
$unionBuilder->where(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions, $originalColumn, $unionWheres) {
|
||||
$unionBuilder->where(
|
||||
$this->getOriginalColumnNameForCursorPagination($this, $column),
|
||||
$originalColumn,
|
||||
$direction === 'asc' ? '>' : '<',
|
||||
$cursor->parameter($column)
|
||||
);
|
||||
|
||||
if ($i < $orders->count() - 1) {
|
||||
$unionBuilder->orWhere(function (self $builder) use ($addCursorConditions, $column, $i) {
|
||||
$addCursorConditions($builder, $column, $i + 1);
|
||||
$unionBuilder->orWhere(function (self $fourthBuilder) use ($addCursorConditions, $column, $originalColumn, $i) {
|
||||
$addCursorConditions($fourthBuilder, $column, $originalColumn, $i + 1);
|
||||
});
|
||||
}
|
||||
|
||||
$this->addBinding($unionWheres, 'union');
|
||||
$this->addBinding($unionBuilder->getRawBindings()['where'], 'union');
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$addCursorConditions($this, null, 0);
|
||||
$addCursorConditions($this, null, null, 0);
|
||||
}
|
||||
|
||||
$this->limit($perPage + 1);
|
||||
|
||||
@@ -41,22 +41,15 @@ trait ManagesTransactions
|
||||
continue;
|
||||
}
|
||||
|
||||
$levelBeingCommitted = $this->transactions;
|
||||
|
||||
try {
|
||||
if ($this->transactions == 1) {
|
||||
$this->fireConnectionEvent('committing');
|
||||
$this->getPdo()->commit();
|
||||
}
|
||||
|
||||
[$levelBeingCommitted, $this->transactions] = [
|
||||
$this->transactions,
|
||||
max(0, $this->transactions - 1),
|
||||
];
|
||||
|
||||
$this->transactionsManager?->commit(
|
||||
$this->getName(),
|
||||
$levelBeingCommitted,
|
||||
$this->transactions
|
||||
);
|
||||
$this->transactions = max(0, $this->transactions - 1);
|
||||
} catch (Throwable $e) {
|
||||
$this->handleCommitTransactionException(
|
||||
$e, $currentAttempt, $attempts
|
||||
@@ -65,6 +58,12 @@ trait ManagesTransactions
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->transactionsManager?->commit(
|
||||
$this->getName(),
|
||||
$levelBeingCommitted,
|
||||
$this->transactions
|
||||
);
|
||||
|
||||
$this->fireConnectionEvent('committed');
|
||||
|
||||
return $callbackResult;
|
||||
@@ -119,6 +118,10 @@ trait ManagesTransactions
|
||||
*/
|
||||
public function beginTransaction()
|
||||
{
|
||||
foreach ($this->beforeStartingTransaction as $callback) {
|
||||
$callback($this);
|
||||
}
|
||||
|
||||
$this->createTransaction();
|
||||
|
||||
$this->transactions++;
|
||||
|
||||
20
vendor/laravel/framework/src/Illuminate/Database/Connection.php
vendored
Normal file → Executable file
20
vendor/laravel/framework/src/Illuminate/Database/Connection.php
vendored
Normal file → Executable file
@@ -182,6 +182,13 @@ class Connection implements ConnectionInterface
|
||||
*/
|
||||
protected $pretending = false;
|
||||
|
||||
/**
|
||||
* All of the callbacks that should be invoked before a transaction is started.
|
||||
*
|
||||
* @var \Closure[]
|
||||
*/
|
||||
protected $beforeStartingTransaction = [];
|
||||
|
||||
/**
|
||||
* All of the callbacks that should be invoked before a query is executed.
|
||||
*
|
||||
@@ -1021,6 +1028,19 @@ class Connection implements ConnectionInterface
|
||||
$this->doctrineConnection = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a hook to be run just before a database transaction is started.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function beforeStartingTransaction(Closure $callback)
|
||||
{
|
||||
$this->beforeStartingTransaction[] = $callback;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a hook to be run just before a database query is executed.
|
||||
*
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Database/ConnectionInterface.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/ConnectionInterface.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/ConnectionResolver.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/ConnectionResolver.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectorInterface.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectorInterface.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php
vendored
Normal file → Executable file
50
vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php
vendored
Normal file → Executable file
50
vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php
vendored
Normal file → Executable file
@@ -38,8 +38,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
|
||||
|
||||
$this->configureIsolationLevel($connection, $config);
|
||||
|
||||
$this->configureEncoding($connection, $config);
|
||||
|
||||
// Next, we will check to see if a timezone has been specified in this config
|
||||
// and if it has we will issue a statement to modify the timezone with the
|
||||
// database. Setting this DB timezone is an optional configuration item.
|
||||
@@ -47,11 +45,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
|
||||
|
||||
$this->configureSearchPath($connection, $config);
|
||||
|
||||
// Postgres allows an application_name to be set by the user and this name is
|
||||
// used to when monitoring the application with pg_stat_activity. So we'll
|
||||
// determine if the option has been specified and run a statement if so.
|
||||
$this->configureApplicationName($connection, $config);
|
||||
|
||||
$this->configureSynchronousCommit($connection, $config);
|
||||
|
||||
return $connection;
|
||||
@@ -71,22 +64,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the connection character set and collation.
|
||||
*
|
||||
* @param \PDO $connection
|
||||
* @param array $config
|
||||
* @return void
|
||||
*/
|
||||
protected function configureEncoding($connection, $config)
|
||||
{
|
||||
if (! isset($config['charset'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$connection->prepare("set names '{$config['charset']}'")->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the timezone on the connection.
|
||||
*
|
||||
@@ -132,22 +109,6 @@ class PostgresConnector extends Connector implements ConnectorInterface
|
||||
return count($searchPath) === 1 ? '"'.$searchPath[0].'"' : '"'.implode('", "', $searchPath).'"';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the application name on the connection.
|
||||
*
|
||||
* @param \PDO $connection
|
||||
* @param array $config
|
||||
* @return void
|
||||
*/
|
||||
protected function configureApplicationName($connection, $config)
|
||||
{
|
||||
if (isset($config['application_name'])) {
|
||||
$applicationName = $config['application_name'];
|
||||
|
||||
$connection->prepare("set application_name to '$applicationName'")->execute();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a DSN string from a configuration.
|
||||
*
|
||||
@@ -178,6 +139,17 @@ class PostgresConnector extends Connector implements ConnectorInterface
|
||||
$dsn .= ";port={$port}";
|
||||
}
|
||||
|
||||
if (isset($charset)) {
|
||||
$dsn .= ";client_encoding='{$charset}'";
|
||||
}
|
||||
|
||||
// Postgres allows an application_name to be set by the user and this name is
|
||||
// used to when monitoring the application with pg_stat_activity. So we'll
|
||||
// determine if the option has been specified and run a statement if so.
|
||||
if (isset($application_name)) {
|
||||
$dsn .= ";application_name='".str_replace("'", "\'", $application_name)."'";
|
||||
}
|
||||
|
||||
return $this->addSslOptions($dsn, $config);
|
||||
}
|
||||
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php
vendored
Normal file → Executable file
@@ -54,7 +54,7 @@ abstract class DatabaseInspectionCommand extends Command
|
||||
* @param \Illuminate\Support\Composer|null $composer
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Composer $composer = null)
|
||||
public function __construct(?Composer $composer = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
||||
@@ -192,6 +192,7 @@ class DbCommand extends Command
|
||||
'password' => ['-P', $connection['password']],
|
||||
'host' => ['-S', 'tcp:'.$connection['host']
|
||||
.($connection['port'] ? ','.$connection['port'] : ''), ],
|
||||
'trust_server_certificate' => ['-C'],
|
||||
], $connection));
|
||||
}
|
||||
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/InstallCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/InstallCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RefreshCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RefreshCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php
vendored
Normal file → Executable file
@@ -4,13 +4,17 @@ namespace Illuminate\Database\DBAL;
|
||||
|
||||
use Doctrine\DBAL\Exception as DBALException;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1010Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1052Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1060Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDBPlatform;
|
||||
use Doctrine\DBAL\Platforms\MySQL57Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL80Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL84Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL120Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
@@ -32,12 +36,16 @@ class TimestampType extends Type implements PhpDateTimeMappingType
|
||||
MySQLPlatform::class,
|
||||
MySQL57Platform::class,
|
||||
MySQL80Platform::class,
|
||||
MySQL84Platform::class,
|
||||
MariaDBPlatform::class,
|
||||
MariaDb1027Platform::class,
|
||||
MariaDb1052Platform::class, => $this->getMySqlPlatformSQLDeclaration($column),
|
||||
MariaDb1052Platform::class,
|
||||
MariaDb1060Platform::class,
|
||||
MariaDb1010Platform::class => $this->getMySqlPlatformSQLDeclaration($column),
|
||||
PostgreSQLPlatform::class,
|
||||
PostgreSQL94Platform::class,
|
||||
PostgreSQL100Platform::class => $this->getPostgresPlatformSQLDeclaration($column),
|
||||
PostgreSQL100Platform::class,
|
||||
PostgreSQL120Platform::class => $this->getPostgresPlatformSQLDeclaration($column),
|
||||
SQLServerPlatform::class,
|
||||
SQLServer2012Platform::class => $this->getSqlServerPlatformSQLDeclaration($column),
|
||||
SqlitePlatform::class => 'DATETIME',
|
||||
|
||||
0
vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionRecord.php
vendored
Normal file → Executable file
0
vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionRecord.php
vendored
Normal file → Executable file
3
vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionsManager.php
vendored
Normal file → Executable file
3
vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionsManager.php
vendored
Normal file → Executable file
@@ -83,7 +83,8 @@ class DatabaseTransactionsManager
|
||||
// shouldn't be any pending transactions, but going to clear them here anyways just
|
||||
// in case. This method could be refactored to receive a level in the future too.
|
||||
$this->pendingTransactions = $this->pendingTransactions->reject(
|
||||
fn ($transaction) => $transaction->connection === $connection
|
||||
fn ($transaction) => $transaction->connection === $connection &&
|
||||
$transaction->level >= $levelBeingCommitted
|
||||
)->values();
|
||||
|
||||
[$forThisConnection, $forOtherConnections] = $this->committedTransactions->partition(
|
||||
|
||||
@@ -19,6 +19,7 @@ trait DetectsLostConnections
|
||||
|
||||
return Str::contains($message, [
|
||||
'server has gone away',
|
||||
'Server has gone away',
|
||||
'no connection to the server',
|
||||
'Lost connection',
|
||||
'is dead or not enabled',
|
||||
@@ -63,14 +64,15 @@ trait DetectsLostConnections
|
||||
'Reason: Server is in script upgrade mode. Only administrator can connect at this time.',
|
||||
'Unknown $curl_error_code: 77',
|
||||
'SSL: Handshake timed out',
|
||||
'SQLSTATE[08006] [7] SSL error: sslv3 alert unexpected message',
|
||||
'SQLSTATE[08006] [7] unrecognized SSL error code:',
|
||||
'SSL error: sslv3 alert unexpected message',
|
||||
'unrecognized SSL error code:',
|
||||
'SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it',
|
||||
'SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',
|
||||
'SQLSTATE[HY000] [2002] Network is unreachable',
|
||||
'SQLSTATE[HY000] [2002] The requested address is not valid in its context',
|
||||
'SQLSTATE[HY000] [2002] A socket operation was attempted to an unreachable network',
|
||||
'SQLSTATE[HY000]: General error: 3989',
|
||||
'went away',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user