Skip to content

Commit c3744b2

Browse files
committed
Merge branch '9.x'
# Conflicts: # CHANGELOG.md # src/Illuminate/Foundation/Application.php
2 parents 56d6b55 + ac56c4f commit c3744b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2240
-161
lines changed

src/Illuminate/Cache/DynamoDbLock.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ public function __construct(DynamoDbStore $dynamo, $name, $seconds, $owner = nul
3434
*/
3535
public function acquire()
3636
{
37-
return $this->dynamo->add(
38-
$this->name, $this->owner, $this->seconds
39-
);
37+
if ($this->seconds > 0) {
38+
return $this->dynamo->add($this->name, $this->owner, $this->seconds);
39+
} else {
40+
return $this->dynamo->add($this->name, $this->owner, 86400);
41+
}
4042
}
4143

4244
/**

src/Illuminate/Collections/Collection.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ public function avg($callback = null)
104104
public function median($key = null)
105105
{
106106
$values = (isset($key) ? $this->pluck($key) : $this)
107-
->filter(function ($item) {
108-
return ! is_null($item);
109-
})->sort()->values();
107+
->filter(fn ($item) => ! is_null($item))
108+
->sort()->values();
110109

111110
$count = $values->count();
112111

@@ -141,17 +140,14 @@ public function mode($key = null)
141140

142141
$counts = new static;
143142

144-
$collection->each(function ($value) use ($counts) {
145-
$counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1;
146-
});
143+
$collection->each(fn ($value) => $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1);
147144

148145
$sorted = $counts->sort();
149146

150147
$highestValue = $sorted->last();
151148

152-
return $sorted->filter(function ($value) use ($highestValue) {
153-
return $value == $highestValue;
154-
})->sort()->keys()->all();
149+
return $sorted->filter(fn ($value) => $value == $highestValue)
150+
->sort()->keys()->all();
155151
}
156152

157153
/**

src/Illuminate/Console/ConfirmableTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public function confirmToProceed($warning = 'Application In Production', $callba
2929
$confirmed = $this->components->confirm('Do you really wish to run this command?');
3030

3131
if (! $confirmed) {
32+
$this->newLine();
33+
3234
$this->components->warn('Command canceled.');
3335

3436
return false;

src/Illuminate/Console/View/Components/Component.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ protected function mutate($data, $mutators)
8383
foreach ($mutators as $mutator) {
8484
if (is_iterable($data)) {
8585
foreach ($data as $key => $value) {
86-
$data[$key] = resolve($mutator)->__invoke($value);
86+
$data[$key] = app($mutator)->__invoke($value);
8787
}
8888
} else {
89-
$data = resolve($mutator)->__invoke($data);
89+
$data = app($mutator)->__invoke($data);
9090
}
9191
}
9292

src/Illuminate/Console/View/Components/Confirm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Confirm extends Component
1111
* @param bool $default
1212
* @return bool
1313
*/
14-
public function render($question, $default = true)
14+
public function render($question, $default = false)
1515
{
1616
return $this->usingQuestionHelper(
1717
fn () => $this->output->confirm($question, $default),

src/Illuminate/Console/View/Components/Factory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* @method void bulletList(array $elements, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL)
1010
* @method mixed choice(string $question, array $choices, $default = null)
1111
* @method bool confirm(string $question, bool $default = true)
12-
* @method void error(string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMA)
13-
* @method void info(string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMA)
14-
* @method void line(string $style, string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMA)
12+
* @method void error(string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL)
13+
* @method void info(string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL)
14+
* @method void line(string $style, string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL)
1515
* @method void task(string $description, ?callable $task = null, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL)
1616
* @method void twoColumnDetail(string $first, ?string $second = null, int $verbosity = OutputInterface::VERBOSITY_NORMAL)
17-
* @method void warn(string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMA)
17+
* @method void warn(string $string, int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL)
1818
*/
1919
class Factory
2020
{

src/Illuminate/Database/Console/PruneCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public function handle(Dispatcher $events)
5656
return;
5757
}
5858

59-
$prunning = [];
59+
$pruning = [];
6060

61-
$events->listen(ModelsPruned::class, function ($event) use (&$prunning) {
62-
if (! in_array($event->model, $prunning)) {
63-
$prunning[] = $event->model;
61+
$events->listen(ModelsPruned::class, function ($event) use (&$pruning) {
62+
if (! in_array($event->model, $pruning)) {
63+
$pruning[] = $event->model;
6464

6565
$this->newLine();
6666

67-
$this->components->info(sprintf('Prunning [%s] records.', $event->model));
67+
$this->components->info(sprintf('Pruning [%s] records.', $event->model));
6868
}
6969

7070
$this->components->twoColumnDetail($event->model, "{$event->count} records");

src/Illuminate/Database/Eloquent/Factories/BelongsToManyRelationship.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class BelongsToManyRelationship
1010
/**
1111
* The related factory instance.
1212
*
13-
* @var \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model
13+
* @var \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array
1414
*/
1515
protected $factory;
1616

@@ -31,7 +31,7 @@ class BelongsToManyRelationship
3131
/**
3232
* Create a new attached relationship definition.
3333
*
34-
* @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model $factory
34+
* @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $factory
3535
* @param callable|array $pivot
3636
* @param string $relationship
3737
* @return void

src/Illuminate/Database/Eloquent/Factories/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ protected function guessRelationship(string $related)
569569
/**
570570
* Define an attached relationship for the model.
571571
*
572-
* @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model $factory
572+
* @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $factory
573573
* @param (callable(): array<string, mixed>)|array<string, mixed> $pivot
574574
* @param string|null $relationship
575575
* @return static

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,11 +1600,11 @@ public function refresh()
16001600
*/
16011601
public function replicate(array $except = null)
16021602
{
1603-
$defaults = [
1603+
$defaults = array_values(array_filter([
16041604
$this->getKeyName(),
16051605
$this->getCreatedAtColumn(),
16061606
$this->getUpdatedAtColumn(),
1607-
];
1607+
]));
16081608

16091609
$attributes = Arr::except(
16101610
$this->getAttributes(), $except ? array_unique(array_merge($except, $defaults)) : $defaults

0 commit comments

Comments
 (0)