Skip to content

Commit ec319da

Browse files
authored
Merge branch 'laravel:9.x' into 9.x
2 parents a54d0df + 004163a commit ec319da

Some content is hidden

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

53 files changed

+1477
-107
lines changed

.github/workflows/databases.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: databases
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
49

510
jobs:
611
mysql_57:

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: static analysis
22

33
on:
44
push:
5+
branches:
6+
- master
7+
- '*.x'
58
pull_request:
6-
schedule:
7-
- cron: '0 0 * * *'
89

910
jobs:
1011
src:

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: tests
22

33
on:
44
push:
5+
branches:
6+
- master
7+
- '*.x'
58
pull_request:
69
schedule:
710
- cron: '0 0 * * *'

CHANGELOG.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
# Release Notes for 9.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v9.27.0...9.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v9.28.0...9.x)
4+
5+
6+
## [v9.28.0](https://github.com/laravel/framework/compare/v9.27.0...v9.28.0) - 2022-09-06
7+
8+
### Added
9+
- Added view data assertions to TestView ([#43923](https://github.com/laravel/framework/pull/43923))
10+
- Added `Illuminate/Routing/Redirector::getIntendedUrl()` ([#43938](https://github.com/laravel/framework/pull/43938))
11+
- Added Eloquent mode to prevent prevently silently discarding fills for attributes not in $fillable ([#43893](https://github.com/laravel/framework/pull/43893))
12+
- Added `Illuminate/Testing/PendingCommand::assertOk()` ([#43968](https://github.com/laravel/framework/pull/43968))
13+
- Make Application macroable ([#43966](https://github.com/laravel/framework/pull/43966))
14+
- Introducing Signal Traps ([#43933](https://github.com/laravel/framework/pull/43933))
15+
- Allow registering instances of commands ([#43986](https://github.com/laravel/framework/pull/43986))
16+
- Support Enumerable in Stringable ([#44012](https://github.com/laravel/framework/pull/44012))
17+
18+
### Fixed
19+
- Fixed RoueGroup::merge to format merged prefixes correctly. ([#44011](https://github.com/laravel/framework/pull/44011))
20+
- Fixes providesTemporaryUrls on AwsS3V3Adapter ([#44009](https://github.com/laravel/framework/pull/44009))
21+
- Fix ordering of stylesheets when using @vite ([#43962](https://github.com/laravel/framework/pull/43962))
22+
23+
### Changed
24+
- Allow invokable rules to specify custom messsages ([#43925](https://github.com/laravel/framework/pull/43925))
25+
- Support objects like GMP for custom Model casts ([#43959](https://github.com/laravel/framework/pull/43959))
26+
- Default 404 message on denyAsNotFound ([#43901](https://github.com/laravel/framework/pull/43901))
27+
- Changed `Illuminate/Container/Container::resolvePrimitive()` for isVariadic() ([#43985](https://github.com/laravel/framework/pull/43985))
28+
- Allow validator messages to use nested arrays ([#43981](https://github.com/laravel/framework/pull/43981))
29+
- Ensure freezeUuids always resets UUID creation after exception in callback ([#44018](https://github.com/laravel/framework/pull/44018))
430

531

632
## [v9.27.0](https://github.com/laravel/framework/compare/v9.26.1...v9.27.0) - 2022-08-30

src/Illuminate/Auth/SessionGuard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class SessionGuard implements StatefulGuard, SupportsBasicAuth
5858
*
5959
* @var int
6060
*/
61-
protected $rememberDuration = 2628000;
61+
protected $rememberDuration = 576000;
6262

6363
/**
6464
* The session used by the guard.

src/Illuminate/Collections/LazyCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public function except($keys)
398398
/**
399399
* Run a filter over each of the items.
400400
*
401-
* @param (callable(TValue): bool)|null $callback
401+
* @param (callable(TValue, TKey): bool)|null $callback
402402
* @return static
403403
*/
404404
public function filter(callable $callback = null)

src/Illuminate/Console/Application.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ protected function addToParent(SymfonyCommand $command)
262262
/**
263263
* Add a command, resolving through the application.
264264
*
265-
* @param string $command
265+
* @param \Illuminate\Console\Command|string $command
266266
* @return \Symfony\Component\Console\Command\Command|null
267267
*/
268268
public function resolve($command)
@@ -273,6 +273,10 @@ public function resolve($command)
273273
return null;
274274
}
275275

276+
if ($command instanceof Command) {
277+
return $this->add($command);
278+
}
279+
276280
return $this->add($this->laravel->make($command));
277281
}
278282

src/Illuminate/Console/Command.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Command extends SymfonyCommand
1313
use Concerns\CallsCommands,
1414
Concerns\HasParameters,
1515
Concerns\InteractsWithIO,
16+
Concerns\InteractsWithSignals,
1617
Macroable;
1718

1819
/**
@@ -120,9 +121,13 @@ public function run(InputInterface $input, OutputInterface $output): int
120121

121122
$this->components = $this->laravel->make(Factory::class, ['output' => $this->output]);
122123

123-
return parent::run(
124-
$this->input = $input, $this->output
125-
);
124+
try {
125+
return parent::run(
126+
$this->input = $input, $this->output
127+
);
128+
} finally {
129+
$this->untrap();
130+
}
126131
}
127132

128133
/**
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
namespace Illuminate\Console\Concerns;
4+
5+
use Illuminate\Console\Signals;
6+
use Illuminate\Support\Arr;
7+
8+
trait InteractsWithSignals
9+
{
10+
/**
11+
* The signal registrar instance.
12+
*
13+
* @var \Illuminate\Console\Signals|null
14+
*/
15+
protected $signals;
16+
17+
/**
18+
* Define a callback to be run when the given signal(s) occurs.
19+
*
20+
* @param iterable<array-key, int>|int $signals
21+
* @param callable(int $signal): void $callback
22+
* @return void
23+
*/
24+
public function trap($signals, $callback)
25+
{
26+
Signals::whenAvailable(function () use ($signals, $callback) {
27+
$this->signals ??= new Signals(
28+
$this->getApplication()->getSignalRegistry(),
29+
);
30+
31+
collect(Arr::wrap($signals))
32+
->each(fn ($signal) => $this->signals->register($signal, $callback));
33+
});
34+
}
35+
36+
/**
37+
* Untrap signal handlers set within the command's handler.
38+
*
39+
* @return void
40+
*
41+
* @internal
42+
*/
43+
public function untrap()
44+
{
45+
if (! is_null($this->signals)) {
46+
$this->signals->unregister();
47+
48+
$this->signals = null;
49+
}
50+
}
51+
}

src/Illuminate/Console/GeneratorCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ protected function replaceClass($stub, $name)
355355
*/
356356
protected function sortImports($stub)
357357
{
358-
if (preg_match('/(?P<imports>(?:use [^;{]+;$\n?)+)/m', $stub, $match)) {
358+
if (preg_match('/(?P<imports>(?:^use [^;{]+;$\n?)+)/m', $stub, $match)) {
359359
$imports = explode("\n", trim($match['imports']));
360360

361361
sort($imports);

0 commit comments

Comments
 (0)