Skip to content

Commit dd8b2fe

Browse files
Merge branch '12.x'
2 parents e015555 + dd16215 commit dd8b2fe

File tree

54 files changed

+1600
-76
lines changed

Some content is hidden

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

54 files changed

+1600
-76
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*.md diff=markdown
77
*.php diff=php
88

9+
*.stub linguist-language=php
10+
*.neon.dist linguist-language=neon
11+
912
/.github export-ignore
1013
/bin export-ignore
1114
/tests export-ignore

.styleci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
php:
22
preset: laravel
33
version: 8.2
4-
enabled:
5-
- nullable_type_declarations
64
finder:
75
not-name:
86
- bad-syntax-strategy.php

src/Illuminate/Auth/Passwords/PasswordBroker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class PasswordBroker implements PasswordBrokerContract
3030
/**
3131
* The event dispatcher instance.
3232
*
33-
* @var \Illuminate\Contracts\Events\Dispatcher
33+
* @var \Illuminate\Contracts\Events\Dispatcher|null
3434
*/
3535
protected $events;
3636

@@ -91,7 +91,7 @@ public function sendResetLink(#[\SensitiveParameter] array $credentials, ?Closur
9191
*
9292
* @param array $credentials
9393
* @param \Closure $callback
94-
* @return mixed
94+
* @return string
9595
*/
9696
public function reset(#[\SensitiveParameter] array $credentials, Closure $callback)
9797
{
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Illuminate\Cache\Events;
4+
5+
class CacheFlushed
6+
{
7+
/**
8+
* The name of the cache store.
9+
*
10+
* @var string|null
11+
*/
12+
public $storeName;
13+
14+
/**
15+
* Create a new event instance.
16+
*
17+
* @param string|null $storeName
18+
* @return void
19+
*/
20+
public function __construct($storeName)
21+
{
22+
$this->storeName = $storeName;
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Illuminate\Cache\Events;
4+
5+
class CacheFlushing
6+
{
7+
/**
8+
* The name of the cache store.
9+
*
10+
* @var string|null
11+
*/
12+
public $storeName;
13+
14+
/**
15+
* Create a new event instance.
16+
*
17+
* @param string|null $storeName
18+
* @return void
19+
*/
20+
public function __construct($storeName)
21+
{
22+
$this->storeName = $storeName;
23+
}
24+
}

src/Illuminate/Cache/Repository.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use BadMethodCallException;
77
use Closure;
88
use DateTimeInterface;
9+
use Illuminate\Cache\Events\CacheFlushed;
10+
use Illuminate\Cache\Events\CacheFlushing;
911
use Illuminate\Cache\Events\CacheHit;
1012
use Illuminate\Cache\Events\CacheMissed;
1113
use Illuminate\Cache\Events\ForgettingKey;
@@ -576,7 +578,15 @@ public function deleteMultiple($keys): bool
576578
*/
577579
public function clear(): bool
578580
{
579-
return $this->store->flush();
581+
$this->event(new CacheFlushing($this->getName()));
582+
583+
$result = $this->store->flush();
584+
585+
if ($result) {
586+
$this->event(new CacheFlushed($this->getName()));
587+
}
588+
589+
return $result;
580590
}
581591

582592
/**

src/Illuminate/Console/Scheduling/CallbackEvent.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class CallbackEvent extends Event
4646
* @param string|callable $callback
4747
* @param array $parameters
4848
* @param \DateTimeZone|string|null $timezone
49-
* @return void
5049
*
5150
* @throws \InvalidArgumentException
5251
*/

src/Illuminate/Console/Scheduling/Schedule.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ class Schedule
102102
* Create a new schedule instance.
103103
*
104104
* @param \DateTimeZone|string|null $timezone
105-
* @return void
106105
*
107106
* @throws \RuntimeException
108107
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function renderView($view, $data, $verbosity)
5656
*
5757
* @param string $view
5858
* @param array $data
59-
* @return void
59+
* @return string
6060
*/
6161
protected function compile($view, $data)
6262
{

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminate\Console\View\Components;
44

5+
use Illuminate\Database\Migrations\MigrationResult;
56
use Illuminate\Support\InteractsWithTime;
67
use Symfony\Component\Console\Output\OutputInterface;
78
use Throwable;
@@ -34,10 +35,10 @@ public function render($description, $task = null, $verbosity = OutputInterface:
3435

3536
$startTime = microtime(true);
3637

37-
$result = false;
38+
$result = MigrationResult::Failure;
3839

3940
try {
40-
$result = ($task ?: fn () => true)();
41+
$result = ($task ?: fn () => MigrationResult::Success)();
4142
} catch (Throwable $e) {
4243
throw $e;
4344
} finally {
@@ -53,7 +54,11 @@ public function render($description, $task = null, $verbosity = OutputInterface:
5354
$this->output->write("<fg=gray>$runTime</>", false, $verbosity);
5455

5556
$this->output->writeln(
56-
$result !== false ? ' <fg=green;options=bold>DONE</>' : ' <fg=red;options=bold>FAIL</>',
57+
match ($result) {
58+
MigrationResult::Failure => ' <fg=red;options=bold>FAIL</>',
59+
MigrationResult::Skipped => ' <fg=yellow;options=bold>SKIPPED</>',
60+
default => ' <fg=green;options=bold>DONE</>'
61+
},
5762
$verbosity,
5863
);
5964
}

0 commit comments

Comments
 (0)