dep: package update
This commit is contained in:
+3
-1
@@ -11,6 +11,8 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool configurationIsCached()
|
||||
* @method static bool hasBeenBootstrapped()
|
||||
* @method static bool isDownForMaintenance()
|
||||
* @method static bool isLocal()
|
||||
* @method static bool isProduction()
|
||||
* @method static bool routesAreCached()
|
||||
* @method static bool runningInConsole()
|
||||
* @method static bool runningUnitTests()
|
||||
@@ -34,7 +36,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static string storagePath(string $path = '')
|
||||
* @method static string version()
|
||||
* @method static string|bool environment(string|array ...$environments)
|
||||
* @method static void abort(int $code, string $message = '', array $headers = [])
|
||||
* @method static never abort(int $code, string $message = '', array $headers = [])
|
||||
* @method static void boot()
|
||||
* @method static void booted(callable $callback)
|
||||
* @method static void booting(callable $callback)
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ use Illuminate\Support\Testing\Fakes\BusFake;
|
||||
* @method static void assertDispatchedAfterResponseTimes(string $command, int $times = 1)
|
||||
* @method static void assertNotDispatchedAfterResponse(string|\Closure $command, callable $callback = null)
|
||||
* @method static void assertBatched(callable $callback)
|
||||
* @method static void assertChained(array $expectedChain)
|
||||
*
|
||||
* @see \Illuminate\Contracts\Bus\Dispatcher
|
||||
*/
|
||||
|
||||
+1
@@ -28,6 +28,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static void enableQueryLog()
|
||||
* @method static void disableQueryLog()
|
||||
* @method static void flushQueryLog()
|
||||
* @method static \Illuminate\Database\Connection beforeExecuting(\Closure $callback)
|
||||
* @method static void listen(\Closure $callback)
|
||||
* @method static void rollBack(int $toLevel = null)
|
||||
* @method static void setDefaultConnection(string $name)
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ use Illuminate\Support\Testing\Fakes\EventFake;
|
||||
* @method static void assertDispatchedTimes(string $event, int $times = 1)
|
||||
* @method static void assertNotDispatched(string|\Closure $event, callable|int $callback = null)
|
||||
* @method static void assertNothingDispatched()
|
||||
* @method static void assertListening(string $expectedEvent, string expectedListener)
|
||||
* @method static void assertListening(string $expectedEvent, string $expectedListener)
|
||||
* @method static void flush(string $event)
|
||||
* @method static void forget(string $event)
|
||||
* @method static void forgetPushed()
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ namespace Illuminate\Support\Facades;
|
||||
* @method static bool check(string $value, string $hashedValue, array $options = [])
|
||||
* @method static bool needsRehash(string $hashedValue, array $options = [])
|
||||
* @method static string make(string $value, array $options = [])
|
||||
* @method static \Illuminate\Hashing\HashManager extend($driver, \Closure $callback)
|
||||
*
|
||||
* @see \Illuminate\Hashing\HashManager
|
||||
*/
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ use Illuminate\Support\Testing\Fakes\QueueFake;
|
||||
* @method static void assertNotPushed(string|\Closure $job, callable $callback = null)
|
||||
* @method static void assertNothingPushed()
|
||||
* @method static void assertPushed(string|\Closure $job, callable|int $callback = null)
|
||||
* @method static void assertPushedOn(string $queue, string|\Closure $job, callable|int $callback = null)
|
||||
* @method static void assertPushedOn(string $queue, string|\Closure $job, callable $callback = null)
|
||||
* @method static void assertPushedWithChain(string $job, array $expectedChain = [], callable $callback = null)
|
||||
*
|
||||
* @see \Illuminate\Queue\QueueManager
|
||||
|
||||
+12
-4
@@ -97,8 +97,12 @@ abstract class ServiceProvider
|
||||
*/
|
||||
public function callBootingCallbacks()
|
||||
{
|
||||
foreach ($this->bootingCallbacks as $callback) {
|
||||
$this->app->call($callback);
|
||||
$index = 0;
|
||||
|
||||
while ($index < count($this->bootingCallbacks)) {
|
||||
$this->app->call($this->bootingCallbacks[$index]);
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,8 +113,12 @@ abstract class ServiceProvider
|
||||
*/
|
||||
public function callBootedCallbacks()
|
||||
{
|
||||
foreach ($this->bootedCallbacks as $callback) {
|
||||
$this->app->call($callback);
|
||||
$index = 0;
|
||||
|
||||
while ($index < count($this->bootedCallbacks)) {
|
||||
$this->app->call($this->bootedCallbacks[$index]);
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+57
@@ -253,11 +253,15 @@ class Str
|
||||
{
|
||||
$patterns = Arr::wrap($pattern);
|
||||
|
||||
$value = (string) $value;
|
||||
|
||||
if (empty($patterns)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($patterns as $pattern) {
|
||||
$pattern = (string) $pattern;
|
||||
|
||||
// If the given value is an exact match we can of course return true right
|
||||
// from the beginning. Otherwise, we will translate asterisks and do an
|
||||
// actual pattern match against the two strings to see if they match.
|
||||
@@ -394,6 +398,38 @@ class Str
|
||||
return (string) $converter->convertToHtml($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Masks a portion of a string with a repeated character.
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $character
|
||||
* @param int $index
|
||||
* @param int|null $length
|
||||
* @param string $encoding
|
||||
* @return string
|
||||
*/
|
||||
public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8')
|
||||
{
|
||||
if ($character === '') {
|
||||
return $string;
|
||||
}
|
||||
|
||||
if (is_null($length) && PHP_MAJOR_VERSION < 8) {
|
||||
$length = mb_strlen($string, $encoding);
|
||||
}
|
||||
|
||||
$segment = mb_substr($string, $index, $length, $encoding);
|
||||
|
||||
if ($segment === '') {
|
||||
return $string;
|
||||
}
|
||||
|
||||
$start = mb_substr($string, 0, mb_strpos($string, $segment, 0, $encoding), $encoding);
|
||||
$end = mb_substr($string, mb_strpos($string, $segment, 0, $encoding) + mb_strlen($segment, $encoding));
|
||||
|
||||
return $start.str_repeat(mb_substr($character, 0, 1, $encoding), mb_strlen($segment, $encoding)).$end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the string matching the given pattern.
|
||||
*
|
||||
@@ -675,6 +711,27 @@ class Str
|
||||
return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given string to title case for each word.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public static function headline($value)
|
||||
{
|
||||
$parts = explode('_', static::replace(' ', '_', $value));
|
||||
|
||||
if (count($parts) > 1) {
|
||||
$parts = array_map([static::class, 'title'], $parts);
|
||||
}
|
||||
|
||||
$studly = static::studly(implode($parts));
|
||||
|
||||
$words = preg_split('/(?=[A-Z])/', $studly, -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
return implode(' ', $words);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the singular form of an English word.
|
||||
*
|
||||
|
||||
+36
-1
@@ -342,6 +342,20 @@ class Stringable implements JsonSerializable
|
||||
return new static(Str::markdown($this->value, $options));
|
||||
}
|
||||
|
||||
/**
|
||||
* Masks a portion of a string with a repeated character.
|
||||
*
|
||||
* @param string $character
|
||||
* @param int $index
|
||||
* @param int|null $length
|
||||
* @param string $encoding
|
||||
* @return static
|
||||
*/
|
||||
public function mask($character, $index, $length = null, $encoding = 'UTF-8')
|
||||
{
|
||||
return new static(Str::mask($this->value, $character, $index, $length, $encoding));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the string matching the given pattern.
|
||||
*
|
||||
@@ -565,6 +579,17 @@ class Stringable implements JsonSerializable
|
||||
return new static(Str::start($this->value, $prefix));
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip HTML and PHP tags from the given string.
|
||||
*
|
||||
* @param string $allowedTags
|
||||
* @return static
|
||||
*/
|
||||
public function stripTags($allowedTags = null)
|
||||
{
|
||||
return new static(strip_tags($this->value, $allowedTags));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given string to upper-case.
|
||||
*
|
||||
@@ -585,6 +610,16 @@ class Stringable implements JsonSerializable
|
||||
return new static(Str::title($this->value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given string to title case for each word.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function headline()
|
||||
{
|
||||
return new static(Str::headline($this->value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the singular form of an English word.
|
||||
*
|
||||
@@ -778,7 +813,7 @@ class Stringable implements JsonSerializable
|
||||
/**
|
||||
* Dump the string and end the script.
|
||||
*
|
||||
* @return void
|
||||
* @return never
|
||||
*/
|
||||
public function dd()
|
||||
{
|
||||
|
||||
@@ -135,6 +135,16 @@ class BusFake implements QueueingDispatcher
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that no jobs were dispatched.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function assertNothingDispatched()
|
||||
{
|
||||
PHPUnit::assertEmpty($this->commands, 'Jobs were dispatched unexpectedly.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert if a job was explicitly dispatched synchronously based on a truth-test callback.
|
||||
*
|
||||
|
||||
@@ -7,6 +7,7 @@ use Exception;
|
||||
use Illuminate\Contracts\Notifications\Dispatcher as NotificationDispatcher;
|
||||
use Illuminate\Contracts\Notifications\Factory as NotificationFactory;
|
||||
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||
use Illuminate\Notifications\AnonymousNotifiable;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
@@ -31,6 +32,20 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory
|
||||
*/
|
||||
public $locale;
|
||||
|
||||
/**
|
||||
* Assert if a notification was sent on-demand based on a truth-test callback.
|
||||
*
|
||||
* @param string|\Closure $notification
|
||||
* @param callable|null $callback
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function assertSentOnDemand($notification, $callback = null)
|
||||
{
|
||||
$this->assertSentTo(new AnonymousNotifiable, $notification, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert if a notification was sent based on a truth-test callback.
|
||||
*
|
||||
@@ -69,6 +84,18 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert if a notification was sent on-demand a number of times.
|
||||
*
|
||||
* @param string $notification
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
public function assertSentOnDemandTimes($notification, $times = 1)
|
||||
{
|
||||
return $this->assertSentToTimes(new AnonymousNotifiable, $notification, $times);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert if a notification was sent a number of times.
|
||||
*
|
||||
@@ -232,9 +259,24 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory
|
||||
$notification->id = Str::uuid()->toString();
|
||||
}
|
||||
|
||||
$notifiableChannels = $channels ?: $notification->via($notifiable);
|
||||
|
||||
if (method_exists($notification, 'shouldSend')) {
|
||||
$notifiableChannels = array_filter(
|
||||
$notifiableChannels,
|
||||
function ($channel) use ($notification, $notifiable) {
|
||||
return $notification->shouldSend($notifiable, $channel) !== false;
|
||||
}
|
||||
);
|
||||
|
||||
if (empty($notifiableChannels)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [
|
||||
'notification' => $notification,
|
||||
'channels' => $channels ?: $notification->via($notifiable),
|
||||
'channels' => $notifiableChannels,
|
||||
'notifiable' => $notifiable,
|
||||
'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) {
|
||||
if ($notifiable instanceof HasLocalePreference) {
|
||||
|
||||
+3
-3
@@ -21,7 +21,7 @@
|
||||
"illuminate/collections": "^8.0",
|
||||
"illuminate/contracts": "^8.0",
|
||||
"illuminate/macroable": "^8.0",
|
||||
"nesbot/carbon": "^2.31",
|
||||
"nesbot/carbon": "^2.53.1",
|
||||
"voku/portable-ascii": "^1.4.8"
|
||||
},
|
||||
"conflict": {
|
||||
@@ -42,8 +42,8 @@
|
||||
},
|
||||
"suggest": {
|
||||
"illuminate/filesystem": "Required to use the composer class (^8.0).",
|
||||
"league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0).",
|
||||
"ramsey/uuid": "Required to use Str::uuid() (^4.0).",
|
||||
"league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).",
|
||||
"ramsey/uuid": "Required to use Str::uuid() (^4.2.2).",
|
||||
"symfony/process": "Required to use the composer class (^5.1.4).",
|
||||
"symfony/var-dumper": "Required to use the dd function (^5.1.4).",
|
||||
"vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)."
|
||||
|
||||
Reference in New Issue
Block a user