Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Update to Laravel v9.52.7 #292

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
"php": "^8.0",
"ext-json": "*",
"ext-mbstring": "*",
"illuminate/cache": "^9.47",
"illuminate/config": "^9.47",
"illuminate/console": "^9.47",
"illuminate/container": "^9.47",
"illuminate/contracts": "^9.47",
"illuminate/database": "^9.47",
"illuminate/events": "^9.47",
"illuminate/filesystem": "^9.47",
"illuminate/http": "^9.47",
"illuminate/log": "^9.47",
"illuminate/routing": "^9.47",
"illuminate/support": "^9.47",
"illuminate/view": "^9.47",
"illuminate/cache": "^9.52",
"illuminate/config": "^9.52",
"illuminate/console": "^9.52",
"illuminate/container": "^9.52",
"illuminate/contracts": "^9.52",
"illuminate/database": "^9.52",
"illuminate/events": "^9.52",
"illuminate/filesystem": "^9.52",
"illuminate/http": "^9.52",
"illuminate/log": "^9.52",
"illuminate/routing": "^9.52",
"illuminate/support": "^9.52",
"illuminate/view": "^9.52",
"league/flysystem": "^3.0",
"ramsey/uuid": "^4.2.2",
"roots/support": "^1.0",
Expand Down
12 changes: 4 additions & 8 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '9.47.0';
const VERSION = '9.52.7';

/**
* The base path for the Laravel installation.
Expand Down Expand Up @@ -567,7 +567,7 @@ public function environmentFilePath()
/**
* Get or check the current application environment.
*
* @param string|array $environments
* @param string|array ...$environments
* @return string|bool
*/
public function environment(...$environments)
Expand Down Expand Up @@ -656,9 +656,7 @@ public function hasDebugModeEnabled()
public function registerConfiguredProviders()
{
$providers = Collection::make($this->make('config')->get('app.providers'))
->partition(function ($provider) {
return str_starts_with($provider, 'Illuminate\\');
});
->partition(fn ($provider) => str_starts_with($provider, 'Illuminate\\'));

$providers->splice(1, 0, [$this->make(PackageManifest::class)->providers()]);

Expand Down Expand Up @@ -738,9 +736,7 @@ public function getProviders($provider)
{
$name = is_string($provider) ? $provider : get_class($provider);

return Arr::where($this->serviceProviders, function ($value) use ($name) {
return $value instanceof $name;
});
return Arr::where($this->serviceProviders, fn ($value) => $value instanceof $name);
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/Illuminate/Foundation/Bootstrap/HandleExceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,15 @@ public function handleException(Throwable $e)
try {
$this->getExceptionHandler()->report($e);
} catch (Exception $e) {
//
$exceptionHandlerFailed = true;
}

if (static::$app->runningInConsole()) {
$this->renderForConsole($e);

if ($exceptionHandlerFailed ?? false) {
exit(1);
}
} else {
$this->renderHttpResponse($e);
}
Expand Down
5 changes: 4 additions & 1 deletion src/Illuminate/Foundation/Bus/Dispatchable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ trait Dispatchable
/**
* Dispatch the job with the given arguments.
*
* @param mixed ...$arguments
* @return \Illuminate\Foundation\Bus\PendingDispatch
*/
public static function dispatch(...$arguments)
Expand Down Expand Up @@ -67,6 +68,7 @@ public static function dispatchUnless($boolean, ...$arguments)
*
* Queueable jobs will be dispatched to the "sync" queue.
*
* @param mixed ...$arguments
* @return mixed
*/
public static function dispatchSync(...$arguments)
Expand All @@ -89,11 +91,12 @@ public static function dispatchNow(...$arguments)
/**
* Dispatch a command to its appropriate handler after the current process.
*
* @param mixed ...$arguments
* @return mixed
*/
public static function dispatchAfterResponse(...$arguments)
{
return app(Dispatcher::class)->dispatchAfterResponse(new static(...$arguments));
return self::dispatch(...$arguments)->afterResponse();
}

/**
Expand Down
38 changes: 14 additions & 24 deletions src/Illuminate/Foundation/Console/DocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,6 @@ class DocsCommand extends Command
*/
protected $systemOsFamily = PHP_OS_FAMILY;

/**
* Create a new command instance.
*
* @param \Illuminate\Http\Client\Factory $http
* @param \Illuminate\Contracts\Cache\Repository $cache
* @return void
*/
public function __construct(Http $http, Cache $cache)
{
parent::__construct();

$this->http = $http;
$this->cache = $cache;
}

/**
* Configure the current command.
*
Expand All @@ -118,10 +103,15 @@ protected function configure()
/**
* Execute the console command.
*
* @param \Illuminate\Http\Client\Factory $http
* @param \Illuminate\Contracts\Cache\Repository $cache
* @return int
*/
public function handle()
public function handle(Http $http, Cache $cache)
{
$this->http = $http;
$this->cache = $cache;

try {
$this->openUrl();
} catch (ProcessFailedException $e) {
Expand Down Expand Up @@ -190,7 +180,7 @@ protected function page()
/**
* Determine the page to open.
*
* @return ?string
* @return string|null
*/
protected function resolvePage()
{
Expand All @@ -216,7 +206,7 @@ protected function didNotRequestPage()
/**
* Ask the user which page they would like to open.
*
* @return ?string
* @return string|null
*/
protected function askForPage()
{
Expand All @@ -226,7 +216,7 @@ protected function askForPage()
/**
* Ask the user which page they would like to open via a custom strategy.
*
* @return ?string
* @return string|null
*/
protected function askForPageViaCustomStrategy()
{
Expand All @@ -246,7 +236,7 @@ protected function askForPageViaCustomStrategy()
/**
* Ask the user which page they would like to open using autocomplete.
*
* @return ?string
* @return string|null
*/
protected function askForPageViaAutocomplete()
{
Expand All @@ -267,7 +257,7 @@ protected function askForPageViaAutocomplete()
/**
* Guess the page the user is attempting to open.
*
* @return ?string
* @return string|null
*/
protected function guessPage()
{
Expand All @@ -293,7 +283,7 @@ protected function guessPage()
* The section the user specifically asked to open.
*
* @param string $page
* @return ?string
* @return string|null
*/
protected function section($page)
{
Expand All @@ -316,7 +306,7 @@ protected function didNotRequestSection()
* Guess the section the user is attempting to open.
*
* @param string $page
* @return ?string
* @return string|null
*/
protected function guessSection($page)
{
Expand Down Expand Up @@ -482,7 +472,7 @@ protected function fetchDocs()
*/
protected function version()
{
return Str::before(($this->version ?? $this->laravel->version()), '.').'.x';
return Str::before($this->version ?? $this->laravel->version(), '.').'.x';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function handle()

$this->components->info('Environment successfully encrypted.');

$this->components->twoColumnDetail('Key', ($keyPassed ? $key : 'base64:'.base64_encode($key)));
$this->components->twoColumnDetail('Key', $keyPassed ? $key : 'base64:'.base64_encode($key));
$this->components->twoColumnDetail('Cipher', $cipher);
$this->components->twoColumnDetail('Encrypted file', $encryptedFile);

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function terminate($input, $status)
}

/**
* Register a callback to be invoked when the command lifecyle duration exceeds a given amount of time.
* Register a callback to be invoked when the command lifecycle duration exceeds a given amount of time.
*
* @param \DateTimeInterface|\Carbon\CarbonInterval|float|int $threshold
* @param callable $handler
Expand Down
26 changes: 26 additions & 0 deletions src/Illuminate/Foundation/Console/ListenerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'make:listener')]
class ListenerMakeCommand extends GeneratorCommand
Expand Down Expand Up @@ -125,4 +127,28 @@ protected function getOptions()
['queued', null, InputOption::VALUE_NONE, 'Indicates the event listener should be queued'],
];
}

/**
* Interact further with the user if they were prompted for missing arguments.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return void
*/
protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)
{
if ($this->isReservedName($this->getNameInput()) || $this->didReceiveOptions($input)) {
return;
}

$event = $this->components->askWithCompletion(
'What event should be listened for?',
$this->possibleEvents(),
'none'
);

if ($event && $event !== 'none') {
$input->setOption('event', $event);
}
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/MailMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MailMakeCommand extends GeneratorCommand
*
* @var string
*/
protected $type = 'Mail';
protected $type = 'Mailable';

/**
* Execute the console command.
Expand Down
34 changes: 34 additions & 0 deletions src/Illuminate/Foundation/Console/ModelMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'make:model')]
class ModelMakeCommand extends GeneratorCommand
Expand Down Expand Up @@ -233,4 +235,36 @@ protected function getOptions()
['requests', 'R', InputOption::VALUE_NONE, 'Create new form request classes and use them in the resource controller'],
];
}

/**
* Interact further with the user if they were prompted for missing arguments.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return void
*/
protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)
{
if ($this->isReservedName($this->getNameInput()) || $this->didReceiveOptions($input)) {
return;
}

collect($this->components->choice('Would you like any of the following?', [
'none',
'all',
'factory',
'form requests',
'migration',
'policy',
'resource controller',
'seed',
], default: 0, multiple: true))
->reject('none')
->map(fn ($option) => match ($option) {
'resource controller' => 'resource',
'form requests' => 'requests',
default => $option,
})
->each(fn ($option) => $input->setOption($option, true));
}
}
26 changes: 26 additions & 0 deletions src/Illuminate/Foundation/Console/ObserverMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
use Illuminate\Console\GeneratorCommand;
use InvalidArgumentException;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'make:observer')]
class ObserverMakeCommand extends GeneratorCommand
Expand Down Expand Up @@ -150,4 +152,28 @@ protected function getOptions()
['model', 'm', InputOption::VALUE_OPTIONAL, 'The model that the observer applies to'],
];
}

/**
* Interact further with the user if they were prompted for missing arguments.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return void
*/
protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)
{
if ($this->isReservedName($this->getNameInput()) || $this->didReceiveOptions($input)) {
return;
}

$model = $this->components->askWithCompletion(
'What model should this observer apply to?',
$this->possibleModels(),
'none'
);

if ($model && $model !== 'none') {
$input->setOption('model', $model);
}
}
}
Loading