Skip to content

chore: update the Foundation to v12.4.1 #110

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
18 changes: 18 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,27 @@ transform([

// Configure `Illuminate\Foundation\Testing\Concerns\InteractsWithTestCaseLifecycle` class
transform([
line('EncryptCookies::flushState();', 2) => PHP_EOL.line('if (class_exists(EncryptCookies::class)) {
EncryptCookies::flushState();
}'.PHP_EOL, 2),
line('Factory::flushState();', 2) => PHP_EOL.line('if (class_exists(Factory::class)) {
Factory::flushState();
}'.PHP_EOL, 2),
line('Migrator::withoutMigrations([]);', 2) => PHP_EOL.line('if (class_exists(Migrator::class)) {
Migrator::withoutMigrations([]);
}'.PHP_EOL, 2),
line('Queue::createPayloadUsing(null);', 2) => PHP_EOL.line('if (class_exists(Queue::class)) {
Queue::createPayloadUsing(null);
}'.PHP_EOL, 2),
line('TrustProxies::flushState();', 2) => PHP_EOL.line('if (class_exists(TrustProxies::class)) {
TrustProxies::flushState();
}'.PHP_EOL, 2),
line('TrustHosts::flushState();', 2) => PHP_EOL.line('if (class_exists(TrustHosts::class)) {
TrustHosts::flushState();
}'.PHP_EOL, 2),
line('WorkCommand::flushState();', 2) => PHP_EOL.line('if (class_exists(WorkCommand::class)) {
WorkCommand::flushState();
}'.PHP_EOL, 2),
], fn ($changes) => $files->replaceInFile(array_keys($changes), array_values($changes), "{$workingPath}/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php"));

// Configure `config/cache.php` file
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": "^8.2"
},
"require-dev": {
"laravel/framework": "^11"
"laravel/framework": "^12"
},
"autoload": {
"files": [
Expand All @@ -22,7 +22,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "11.x-dev"
"dev-main": "12.x-dev"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion config-stubs/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
|
*/

'timezone' => env('APP_TIMEZONE', 'UTC'),
'timezone' => 'UTC',

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
|
*/

'timezone' => env('APP_TIMEZONE', 'UTC'),
'timezone' => 'UTC',

/*
|--------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'prefix_indexes' => null,
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
Expand Down
3 changes: 2 additions & 1 deletion config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'root' => storage_path('app/private'),
'serve' => true,
'throw' => false,
'report' => false,
],
Expand Down
1 change: 1 addition & 0 deletions config/hashing.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 12),
'verify' => env('HASH_VERIFY', true),
'limit' => env('BCRYPT_LIMIT', null),
],

/*
Expand Down
4 changes: 2 additions & 2 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'handler_with' => [
'stream' => 'php://stderr',
],
'formatter' => env('LOG_STDERR_FORMATTER'),
'processors' => [PsrLogMessageProcessor::class],
],

Expand Down
3 changes: 1 addition & 2 deletions src/Illuminate/Foundation/AliasLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class AliasLoader
* Create a new AliasLoader instance.
*
* @param array $aliases
* @return void
*/
private function __construct($aliases)
{
Expand Down Expand Up @@ -164,7 +163,7 @@ public function register()
*/
protected function prependToLoaderStack()
{
spl_autoload_register([$this, 'load'], true, true);
spl_autoload_register($this->load(...), true, true);
}

/**
Expand Down
15 changes: 7 additions & 8 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '11.44.2';
const VERSION = '12.4.1';

/**
* Copied from HttpKernelInterface, which this class no longer extends.
Expand Down Expand Up @@ -218,7 +218,6 @@ class Application extends Container implements ApplicationContract, CachesConfig
* Create a new Illuminate application instance.
*
* @param string|null $basePath
* @return void
*/
public function __construct($basePath = null)
{
Expand Down Expand Up @@ -430,14 +429,14 @@ protected function bindPathsInContainer()

$this->useBootstrapPath(value(function () {
return is_dir($directory = $this->basePath('.laravel'))
? $directory
: $this->basePath('bootstrap');
? $directory
: $this->basePath('bootstrap');
}));

$this->useLangPath(value(function () {
return is_dir($directory = $this->resourcePath('lang'))
? $directory
: $this->basePath('lang');
? $directory
: $this->basePath('lang');
}));
}

Expand Down Expand Up @@ -1375,8 +1374,8 @@ protected function normalizeCachePath($key, $default)
}

return Str::startsWith($env, $this->absoluteCachePathPrefixes)
? $env
: $this->basePath($env);
? $env
: $this->basePath($env);
}

/**
Expand Down
5 changes: 2 additions & 3 deletions src/Illuminate/Foundation/Bus/PendingChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class PendingChain
*
* @param mixed $job
* @param array $chain
* @return void
*/
public function __construct($job, $chain)
{
Expand Down Expand Up @@ -117,8 +116,8 @@ public function delay($delay)
public function catch($callback)
{
$this->catchCallbacks[] = $callback instanceof Closure
? new SerializableClosure($callback)
: $callback;
? new SerializableClosure($callback)
: $callback;

return $this;
}
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Bus/PendingDispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class PendingDispatch
* Create a new pending job dispatch.
*
* @param mixed $job
* @return void
*/
public function __construct($job)
{
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/CacheBasedMaintenanceMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class CacheBasedMaintenanceMode implements MaintenanceMode
* @param \Illuminate\Contracts\Cache\Factory $cache
* @param string $store
* @param string $key
* @return void
*/
public function __construct(Factory $cache, string $store, string $key)
{
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Configuration/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class Exceptions
* Create a new exception handling configuration instance.
*
* @param \Illuminate\Foundation\Exceptions\Handler $handler
* @return void
*/
public function __construct(public Handler $handler)
{
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Foundation/Configuration/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ public function appendToPriorityList($after, $append)
public function getGlobalMiddleware()
{
$middleware = $this->global ?: array_values(array_filter([
\Illuminate\Http\Middleware\ValidatePathEncoding::class,
\Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks::class,
$this->trustHosts ? \Illuminate\Http\Middleware\TrustHosts::class : null,
\Illuminate\Http\Middleware\TrustProxies::class,
Expand Down
23 changes: 22 additions & 1 deletion src/Illuminate/Foundation/Console/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class AboutCommand extends Command
* Create a new command instance.
*
* @param \Illuminate\Support\Composer $composer
* @return void
*/
public function __construct(Composer $composer)
{
Expand Down Expand Up @@ -165,6 +164,7 @@ protected function gatherApplicationInformation()

$formatEnabledStatus = fn ($value) => $value ? '<fg=yellow;options=bold>ENABLED</>' : 'OFF';
$formatCachedStatus = fn ($value) => $value ? '<fg=green;options=bold>CACHED</>' : '<fg=yellow;options=bold>NOT CACHED</>';
$formatStorageLinkedStatus = fn ($value) => $value ? '<fg=green;options=bold>LINKED</>' : '<fg=yellow;options=bold>NOT LINKED</>';

static::addToSection('Environment', fn () => [
'Application Name' => config('app.name'),
Expand Down Expand Up @@ -214,9 +214,30 @@ protected function gatherApplicationInformation()
'Session' => config('session.driver'),
]));

static::addToSection('Storage', fn () => [
...$this->determineStoragePathLinkStatus($formatStorageLinkedStatus),
]);

(new Collection(static::$customDataResolvers))->each->__invoke();
}

/**
* Determine storage symbolic links status.
*
* @param callable $formatStorageLinkedStatus
* @return array<string,mixed>
*/
protected function determineStoragePathLinkStatus(callable $formatStorageLinkedStatus): array
{
return (new Collection(config('filesystems.links', [])))
->mapWithKeys(function ($target, $link) use ($formatStorageLinkedStatus) {
$path = Str::replace(public_path(), '', $link);

return [public_path($path) => static::format(file_exists($link), console: $formatStorageLinkedStatus)];
})
->toArray();
}

/**
* Determine whether the given directory has PHP files.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/ApiInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function uncommentApiRoutesFile()
$appBootstrapPath,
);
} else {
$this->components->warn('Unable to automatically add API route definition to bootstrap file. API route file should be registered manually.');
$this->components->warn("Unable to automatically add API route definition to [{$appBootstrapPath}]. API route file should be registered manually.");

return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/CastMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class CastMakeCommand extends GeneratorCommand
protected function getStub()
{
return $this->option('inbound')
? $this->resolveStubPath('/stubs/cast.inbound.stub')
: $this->resolveStubPath('/stubs/cast.stub');
? $this->resolveStubPath('/stubs/cast.inbound.stub')
: $this->resolveStubPath('/stubs/cast.stub');
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Console/CliDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class CliDumper extends BaseCliDumper
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param string $basePath
* @param string $compiledViewPath
* @return void
*/
public function __construct($output, $basePath, $compiledViewPath)
{
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Console/ClosureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class ClosureCommand extends Command
*
* @param string $signature
* @param \Closure $callback
* @return void
*/
public function __construct($signature, Closure $callback)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/ComponentMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ protected function getStub()
protected function resolveStubPath($stub)
{
return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
? $customPath
: __DIR__.$stub;
? $customPath
: __DIR__.$stub;
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Console/ConfigCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ConfigCacheCommand extends Command
* Create a new config cache command instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @return void
*/
public function __construct(Filesystem $files)
{
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Console/ConfigClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ConfigClearCommand extends Command
* Create a new config clear command instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @return void
*/
public function __construct(Filesystem $files)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/EnumMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ protected function getStub()
protected function resolveStubPath($stub)
{
return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
? $customPath
: __DIR__.$stub;
? $customPath
: __DIR__.$stub;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class EnvironmentDecryptCommand extends Command
* Create a new command instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @return void
*/
public function __construct(Filesystem $files)
{
Expand Down Expand Up @@ -77,8 +76,8 @@ public function handle()
$key = $this->parseKey($key);

$encryptedFile = ($this->option('env')
? Str::finish(dirname($this->laravel->environmentFilePath()), DIRECTORY_SEPARATOR).'.env.'.$this->option('env')
: $this->laravel->environmentFilePath()).'.encrypted';
? Str::finish(dirname($this->laravel->environmentFilePath()), DIRECTORY_SEPARATOR).'.env.'.$this->option('env')
: $this->laravel->environmentFilePath()).'.encrypted';

$outputFile = $this->outputFilePath();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class EnvironmentEncryptCommand extends Command
* Create a new command instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @return void
*/
public function __construct(Filesystem $files)
{
Expand Down Expand Up @@ -83,8 +82,8 @@ public function handle()
$keyPassed = $key !== null;

$environmentFile = $this->option('env')
? Str::finish(dirname($this->laravel->environmentFilePath()), DIRECTORY_SEPARATOR).'.env.'.$this->option('env')
: $this->laravel->environmentFilePath();
? Str::finish(dirname($this->laravel->environmentFilePath()), DIRECTORY_SEPARATOR).'.env.'.$this->option('env')
: $this->laravel->environmentFilePath();

$encryptedFile = $environmentFile.'.encrypted';

Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Console/EventClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class EventClearCommand extends Command
* Create a new config clear command instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @return void
*/
public function __construct(Filesystem $files)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/EventMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ protected function getStub()
protected function resolveStubPath($stub)
{
return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
? $customPath
: __DIR__.$stub;
? $customPath
: __DIR__.$stub;
}

/**
Expand Down
Loading