diff --git a/composer.json b/composer.json index 6054aa58..fc40d225 100644 --- a/composer.json +++ b/composer.json @@ -29,47 +29,47 @@ }, "require": { "php": "^8.0", - "composer/installers": "^1.9", - "dragonmantank/cron-expression": "^3.0.2", + "composer/installers": "^2.2", + "dragonmantank/cron-expression": "^3.3", "filp/whoops": "^2.1", - "guzzlehttp/guzzle": "^7.2", - "illuminate/auth": "^8.83", - "illuminate/broadcasting": "^8.83", - "illuminate/bus": "^8.83", - "illuminate/cache": "^8.83", - "illuminate/config": "^8.83", - "illuminate/console": "^8.83", - "illuminate/container": "^8.83", - "illuminate/cookie": "^8.83", - "illuminate/database": "^8.83", - "illuminate/encryption": "^8.83", - "illuminate/events": "^8.83", - "illuminate/filesystem": "^8.83", - "illuminate/hashing": "^8.83", - "illuminate/http": "^8.83", - "illuminate/log": "^8.83", - "illuminate/mail": "^8.83", - "illuminate/notifications": "^8.83", - "illuminate/pagination": "^8.83", - "illuminate/queue": "^8.83", - "illuminate/redis": "^8.83", - "illuminate/routing": "^8.83", - "illuminate/session": "^8.83", - "illuminate/support": "^8.83", - "illuminate/testing": "^8.83", - "illuminate/validation": "^8.83", - "illuminate/view": "^8.83", - "laravel/tinker": "^2.5", + "guzzlehttp/guzzle": "^7.5", + "illuminate/auth": "^v9.50", + "illuminate/broadcasting": "^9.50", + "illuminate/bus": "^9.50", + "illuminate/cache": "^9.50", + "illuminate/config": "^9.50", + "illuminate/console": "^9.50", + "illuminate/container": "^9.50", + "illuminate/cookie": "^9.50", + "illuminate/database": "^9.50", + "illuminate/encryption": "^9.50", + "illuminate/events": "^9.50", + "illuminate/filesystem": "^9.50", + "illuminate/hashing": "^9.50", + "illuminate/http": "^9.50", + "illuminate/log": "^9.50", + "illuminate/mail": "^9.50", + "illuminate/notifications": "^9.50", + "illuminate/pagination": "^9.50", + "illuminate/queue": "^9.50", + "illuminate/redis": "^9.50", + "illuminate/routing": "^9.50", + "illuminate/session": "^9.50", + "illuminate/support": "^9.50", + "illuminate/testing": "^9.50", + "illuminate/validation": "^9.50", + "illuminate/view": "^9.50", + "laravel/tinker": "^v2.8", "laravel/ui": "^3.1", - "league/flysystem": "^1.1", + "league/flysystem": "^3.12", "league/fractal": "^0.20", "paragonie/sodium_compat": "^1.15", - "predis/predis": "^1.1", - "ramsey/uuid": "^4.1", + "predis/predis": "^2.1", + "ramsey/uuid": "^4.7", "spatie/enum": "^3.13", "symfony/property-access": "^5.4", - "twig/twig": " ^3.1", - "vlucas/phpdotenv": "^5.2" + "twig/twig": " ^3.5", + "vlucas/phpdotenv": "^5.5" }, "require-dev": { "beyondcode/laravel-dump-server": "^1.7", diff --git a/src/Core/Application.php b/src/Core/Application.php index 276fe535..793b29ae 100644 --- a/src/Core/Application.php +++ b/src/Core/Application.php @@ -6,6 +6,7 @@ use Composer\Autoload\ClassLoader; use Illuminate\Container\Container; use Illuminate\Contracts\Config\Repository; +use Illuminate\Contracts\Foundation\MaintenanceMode; use Illuminate\Contracts\Foundation\Application as ApplicationContract; use Illuminate\Contracts\Foundation\CachesConfiguration; use Illuminate\Contracts\Foundation\CachesRoutes; @@ -22,7 +23,7 @@ use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; use Symfony\Component\HttpFoundation\Request as SymfonyRequest; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as SymfonyResponse; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\HttpKernelInterface; @@ -989,9 +990,9 @@ public function getCachedConfigPath() * * @throws \Exception When an Exception occurs during processing * - * @return Response A Response instance + * @return SymfonyResponse A Response instance */ - public function handle(SymfonyRequest $request, $type = self::MASTER_REQUEST, $catch = true) + public function handle(SymfonyRequest $request, int $type = self::MAIN_REQUEST, bool $catch = true): SymfonyResponse { return $this[HttpKernelContract::class]->handle(Request::createFromBase($request)); } @@ -1422,7 +1423,7 @@ public function abort($code, $message = '', array $headers = []) * * @return $this */ - public function terminating(Closure $callback) + public function terminating($callback) { $this->terminatingCallbacks[] = $callback; @@ -1575,6 +1576,16 @@ public function getLocale() { return $this['config']->get('app.locale'); } + + /** + * Get the current application fallback locale. + * + * @return string + */ + public function getFallbackLocale() + { + return $this['config']->get('app.fallback_locale'); + } /** * Check if passed locale is current locale. @@ -1715,4 +1726,12 @@ public function outputJavascriptGlobal(string $name, array $data) return $output; } + + /** + * @inerhitDoc + */ + public function maintenanceMode(): MaintenanceMode + { + // TODO: Implement maintenanceMode() method. + } } diff --git a/src/Core/Console/VendorPublishCommand.php b/src/Core/Console/VendorPublishCommand.php index 048346b4..5782237a 100644 --- a/src/Core/Console/VendorPublishCommand.php +++ b/src/Core/Console/VendorPublishCommand.php @@ -6,7 +6,7 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Arr; use Illuminate\Support\ServiceProvider; -use League\Flysystem\Adapter\Local; +use League\Flysystem\Local\LocalFilesystemAdapter; use League\Flysystem\MountManager; class VendorPublishCommand extends Command @@ -201,8 +201,8 @@ protected function publishFile($from, $to) protected function publishDirectory($from, $to) { $this->moveManagedFiles(new MountManager([ - 'from' => new \League\Flysystem\Filesystem(new Local($from)), - 'to' => new \League\Flysystem\Filesystem(new Local($to)), + 'from' => new \League\Flysystem\Filesystem(new LocalFilesystemAdapter($from)), + 'to' => new \League\Flysystem\Filesystem(new LocalFilesystemAdapter($to)), ])); $this->status($from, $to, 'Directory'); @@ -218,8 +218,11 @@ protected function publishDirectory($from, $to) protected function moveManagedFiles($manager) { foreach ($manager->listContents('from://', true) as $file) { - if ($file['type'] === 'file' && (! $manager->has('to://' . $file['path']) || $this->option('force'))) { - $manager->put('to://' . $file['path'], $manager->read('from://' . $file['path'])); + if ($file['type'] === 'file' && ( ! $manager->has('to://' . $file['path']) || $this->option('force'))) { + $manager->write( + preg_replace('{^from://}', 'to://', $file['path']), + $manager->read($file['path']) + ); } } } diff --git a/tests/Core/ExceptionHandlerTest.php b/tests/Core/ExceptionHandlerTest.php index 35505fdb..8b80f57e 100644 --- a/tests/Core/ExceptionHandlerTest.php +++ b/tests/Core/ExceptionHandlerTest.php @@ -218,8 +218,8 @@ public function testValidateFileMethod() $file = $this->createMock(UploadedFile::class); $file->method('getPathname')->willReturn('photo.jpg'); $file->method('getClientOriginalName')->willReturn('photo.jpg'); - $file->method('getClientMimeType')->willReturn(null); - $file->method('getError')->willReturn(null); + $file->method('getClientMimeType')->willReturn(''); + $file->method('getError')->willReturn(UPLOAD_ERR_OK); $request = Request::create('/', 'POST', $argumentExpected, [], ['photo' => $file]); diff --git a/tests/Route/RoutesTest.php b/tests/Route/RoutesTest.php index 6abf7eb3..7bc21758 100644 --- a/tests/Route/RoutesTest.php +++ b/tests/Route/RoutesTest.php @@ -1,6 +1,7 @@ singleton(CallableDispatcherContract::class, function ($app) { + return new CallableDispatcher($app); + }); + $container->singleton(Registrar::class, function () use ($router) { return $router; });