Skip to content

Commit

Permalink
Merge branch 'master' into query-builder-improved-pluck
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-w committed Oct 28, 2023
2 parents 887d2e6 + 800e264 commit 7ed1f3d
Show file tree
Hide file tree
Showing 233 changed files with 5,306 additions and 2,016 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/facades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
Illuminate\\Support\\Facades\\Vite
- name: Commit facade docblocks
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update facade docblocks
file_pattern: src/
40 changes: 21 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@
"doctrine/inflector": "^2.0.5",
"dragonmantank/cron-expression": "^3.3.2",
"egulias/email-validator": "^3.2.1|^4.0",
"fruitcake/php-cors": "^1.2",
"fruitcake/php-cors": "^1.3",
"guzzlehttp/uri-template": "^1.0",
"laravel/prompts": "^0.1.9",
"laravel/prompts": "^0.1.12",
"laravel/serializable-closure": "^1.3",
"league/commonmark": "^2.2.1",
"league/flysystem": "^3.8.0",
"monolog/monolog": "^3.0",
"nesbot/carbon": "^2.67",
"nunomaduro/termwind": "^1.13",
"nunomaduro/termwind": "^2.0",
"psr/container": "^1.1.1|^2.0.1",
"psr/log": "^1.0|^2.0|^3.0",
"psr/simple-cache": "^1.0|^2.0|^3.0",
"ramsey/uuid": "^4.7",
"symfony/console": "^6.3",
"symfony/error-handler": "^6.3",
"symfony/finder": "^6.3",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3",
"symfony/mailer": "^6.3",
"symfony/mime": "^6.3",
"symfony/process": "^6.3",
"symfony/routing": "^6.3",
"symfony/uid": "^6.3",
"symfony/var-dumper": "^6.3",
"symfony/console": "^7.0",
"symfony/error-handler": "^7.0",
"symfony/finder": "^7.0",
"symfony/http-foundation": "^7.0",
"symfony/http-kernel": "^7.0",
"symfony/mailer": "^7.0",
"symfony/mime": "^7.0",
"symfony/process": "^7.0",
"symfony/routing": "^7.0",
"symfony/uid": "^7.0",
"symfony/var-dumper": "^7.0",
"tijsverkoyen/css-to-inline-styles": "^2.2.5",
"vlucas/phpdotenv": "^5.4.1",
"voku/portable-ascii": "^2.0"
Expand Down Expand Up @@ -95,7 +95,7 @@
"ext-gmp": "*",
"ably/ably-php": "^1.0",
"aws/aws-sdk-php": "^3.235.5",
"doctrine/dbal": "^3.5.1",
"doctrine/dbal": "^4.0",
"fakerphp/faker": "^1.21",
"guzzlehttp/guzzle": "^7.6",
"league/flysystem-aws-s3-v3": "^3.0",
Expand All @@ -104,13 +104,15 @@
"league/flysystem-read-only": "^3.3",
"league/flysystem-sftp-v3": "^3.0",
"mockery/mockery": "^1.5.1",
"nyholm/psr7": "^1.2",
"orchestra/testbench-core": "^9.0",
"pda/pheanstalk": "^4.0",
"phpstan/phpstan": "^1.4.7",
"phpunit/phpunit": "^10.0.7",
"phpunit/phpunit": "^10.1",
"predis/predis": "^2.0.2",
"symfony/cache": "^6.3",
"symfony/http-client": "^6.3.4"
"symfony/cache": "^7.0",
"symfony/http-client": "^7.0",
"symfony/psr-http-message-bridge": "^v7.0.0-BETA1"
},
"provide": {
"psr/container-implementation": "1.1|2.0",
Expand Down Expand Up @@ -161,7 +163,7 @@
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).",
"brianium/paratest": "Required to run tests in parallel (^6.0).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^4.0).",
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
"guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.6).",
Expand Down
5 changes: 3 additions & 2 deletions src/Illuminate/Cache/ArrayStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Cache;

use Illuminate\Contracts\Cache\LockProvider;
use Illuminate\Support\Carbon;
use Illuminate\Support\InteractsWithTime;

class ArrayStore extends TaggableStore implements LockProvider
Expand Down Expand Up @@ -57,7 +58,7 @@ public function get($key)

$expiresAt = $item['expiresAt'] ?? 0;

if ($expiresAt !== 0 && (now()->getPreciseTimestamp(3) / 1000) >= $expiresAt) {
if ($expiresAt !== 0 && (Carbon::now()->getPreciseTimestamp(3) / 1000) >= $expiresAt) {
$this->forget($key);

return;
Expand Down Expand Up @@ -188,7 +189,7 @@ protected function calculateExpiration($seconds)
*/
protected function toTimestamp($seconds)
{
return $seconds > 0 ? (now()->getPreciseTimestamp(3) / 1000) + $seconds : 0;
return $seconds > 0 ? (Carbon::now()->getPreciseTimestamp(3) / 1000) + $seconds : 0;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Cache/RateLimiting/GlobalLimit.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class GlobalLimit extends Limit
* Create a new limit instance.
*
* @param int $maxAttempts
* @param int $decayMinutes
* @param int $decaySeconds
* @return void
*/
public function __construct(int $maxAttempts, int $decayMinutes = 1)
public function __construct(int $maxAttempts, int $decaySeconds = 60)
{
parent::__construct('', $maxAttempts, $decayMinutes);
parent::__construct('', $maxAttempts, $decaySeconds);
}
}
31 changes: 21 additions & 10 deletions src/Illuminate/Cache/RateLimiting/Limit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ class Limit
public $key;

/**
* The maximum number of attempts allowed within the given number of minutes.
* The maximum number of attempts allowed within the given number of seconds.
*
* @var int
*/
public $maxAttempts;

/**
* The number of minutes until the rate limit is reset.
* The number of seconds until the rate limit is reset.
*
* @var int
*/
public $decayMinutes;
public $decaySeconds;

/**
* The response generator callback.
Expand All @@ -37,14 +37,25 @@ class Limit
*
* @param mixed $key
* @param int $maxAttempts
* @param int $decayMinutes
* @param int $decaySeconds
* @return void
*/
public function __construct($key = '', int $maxAttempts = 60, int $decayMinutes = 1)
public function __construct($key = '', int $maxAttempts = 60, int $decaySeconds = 60)
{
$this->key = $key;
$this->maxAttempts = $maxAttempts;
$this->decayMinutes = $decayMinutes;
$this->decaySeconds = $decaySeconds;
}

/**
* Create a new rate limit.
*
* @param int $maxAttempts
* @return static
*/
public static function perSecond($maxAttempts)
{
return new static('', $maxAttempts, 1);
}

/**
Expand All @@ -55,7 +66,7 @@ public function __construct($key = '', int $maxAttempts = 60, int $decayMinutes
*/
public static function perMinute($maxAttempts)
{
return new static('', $maxAttempts);
return new static('', $maxAttempts, 60);
}

/**
Expand All @@ -67,7 +78,7 @@ public static function perMinute($maxAttempts)
*/
public static function perMinutes($decayMinutes, $maxAttempts)
{
return new static('', $maxAttempts, $decayMinutes);
return new static('', $maxAttempts, 60 * $decayMinutes);
}

/**
Expand All @@ -79,7 +90,7 @@ public static function perMinutes($decayMinutes, $maxAttempts)
*/
public static function perHour($maxAttempts, $decayHours = 1)
{
return new static('', $maxAttempts, 60 * $decayHours);
return new static('', $maxAttempts, 60 * 60 * $decayHours);
}

/**
Expand All @@ -91,7 +102,7 @@ public static function perHour($maxAttempts, $decayHours = 1)
*/
public static function perDay($maxAttempts, $decayDays = 1)
{
return new static('', $maxAttempts, 60 * 24 * $decayDays);
return new static('', $maxAttempts, 60 * 60 * 24 * $decayDays);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ protected function currentTags($chunkSize = 1000)
yield $tag;
}
} while (((string) $cursor) !== $defaultCursorValue);
})->map(fn (string $tagKey) => Str::match('/^'.preg_quote($prefix).'tag:(.*):entries$/', $tagKey));
})->map(fn (string $tagKey) => Str::match('/^'.preg_quote($prefix, '/').'tag:(.*):entries$/', $tagKey));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"illuminate/database": "Required to use the database cache driver (^11.0).",
"illuminate/filesystem": "Required to use the file cache driver (^11.0).",
"illuminate/redis": "Required to use the redis cache driver (^11.0).",
"symfony/cache": "Required to use PSR-6 cache bridge (^6.3)."
"symfony/cache": "Required to use PSR-6 cache bridge (^7.0)."
},
"config": {
"sort-packages": true
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Collections/Traits/EnumeratesValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @property-read HigherOrderCollectionProxy $max
* @property-read HigherOrderCollectionProxy $min
* @property-read HigherOrderCollectionProxy $partition
* @property-read HigherOrderCollectionProxy $percentage
* @property-read HigherOrderCollectionProxy $reject
* @property-read HigherOrderCollectionProxy $skipUntil
* @property-read HigherOrderCollectionProxy $skipWhile
Expand Down Expand Up @@ -82,6 +83,7 @@ trait EnumeratesValues
'max',
'min',
'partition',
'percentage',
'reject',
'skipUntil',
'skipWhile',
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"suggest": {
"symfony/var-dumper": "Required to use the dump method (^6.3)."
"symfony/var-dumper": "Required to use the dump method (^7.0)."
},
"config": {
"sort-packages": true
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ public function output()
* Add a command to the console.
*
* @param \Symfony\Component\Console\Command\Command $command
* @return \Symfony\Component\Console\Command\Command
* @return \Symfony\Component\Console\Command\Command|null
*/
public function add(SymfonyCommand $command)
public function add(SymfonyCommand $command): ?SymfonyCommand
{
if ($command instanceof Command) {
$command->setLaravel($this->laravel);
Expand Down
4 changes: 1 addition & 3 deletions src/Illuminate/Console/BufferedConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ public function fetch()

/**
* {@inheritdoc}
*
* @return void
*/
protected function doWrite(string $message, bool $newline)
protected function doWrite(string $message, bool $newline): void
{
$this->buffer .= $message;

Expand Down
3 changes: 1 addition & 2 deletions src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ public function run(InputInterface $input, OutputInterface $output): int
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
if ($this instanceof Isolatable && $this->option('isolated') !== false &&
! $this->commandIsolationMutex()->create($this)) {
Expand Down
9 changes: 6 additions & 3 deletions src/Illuminate/Console/GeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,12 @@ protected function userProviderModel()
*/
protected function isReservedName($name)
{
$name = strtolower($name);

return in_array($name, $this->reservedNames);
return in_array(
strtolower($name),
collect($this->reservedNames)
->transform(fn ($name) => strtolower($name))
->all()
);
}

/**
Expand Down
10 changes: 3 additions & 7 deletions src/Illuminate/Console/OutputStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function askQuestion(Question $question): mixed
/**
* {@inheritdoc}
*/
public function write(string|iterable $messages, bool $newline = false, int $options = 0)
public function write(string|iterable $messages, bool $newline = false, int $options = 0): void
{
$this->newLinesWritten = $this->trailingNewLineCount($messages) + (int) $newline;
$this->newLineWritten = $this->newLinesWritten > 0;
Expand All @@ -74,10 +74,8 @@ public function write(string|iterable $messages, bool $newline = false, int $opt

/**
* {@inheritdoc}
*
* @return void
*/
public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL)
public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL): void
{
$this->newLinesWritten = $this->trailingNewLineCount($messages) + 1;
$this->newLineWritten = true;
Expand All @@ -87,10 +85,8 @@ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORM

/**
* {@inheritdoc}
*
* @return void
*/
public function newLine(int $count = 1)
public function newLine(int $count = 1): void
{
$this->newLinesWritten += $count;
$this->newLineWritten = $this->newLinesWritten > 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/QuestionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class QuestionHelper extends SymfonyQuestionHelper
*
* @return void
*/
protected function writePrompt(OutputInterface $output, Question $question)
protected function writePrompt(OutputInterface $output, Question $question): void
{
$text = OutputFormatter::escapeTrailingBackslash($question->getQuestion());

Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Console/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"illuminate/macroable": "^11.0",
"illuminate/support": "^11.0",
"illuminate/view": "^11.0",
"laravel/prompts": "^0.1.9",
"nunomaduro/termwind": "^1.13",
"symfony/console": "^6.3",
"symfony/process": "^6.3"
"laravel/prompts": "^0.1.12",
"nunomaduro/termwind": "^2.0",
"symfony/console": "^7.0",
"symfony/process": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Cookie/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"illuminate/contracts": "^11.0",
"illuminate/macroable": "^11.0",
"illuminate/support": "^11.0",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3"
"symfony/http-foundation": "^7.0",
"symfony/http-kernel": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 7ed1f3d

Please sign in to comment.