Skip to content

Commit 8f87dbe

Browse files
committed
feat: update component dependencies
1 parent 42ee743 commit 8f87dbe

32 files changed

+79
-117
lines changed

src/Components/AbstractInstaller.php

+5-26
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,10 @@
2323
*/
2424
abstract class AbstractInstaller extends Command implements InstallerContract
2525
{
26-
/**
27-
* Holds an instance of Files.
28-
*
29-
* @var \Illuminate\Filesystem\Filesystem
30-
*/
31-
protected $files;
26+
protected Filesystem $files;
3227

33-
/**
34-
* Holds an instance of composer.
35-
*
36-
* @var \LaravelZero\Framework\Contracts\Providers\ComposerContract
37-
*/
38-
protected $composer;
28+
protected ComposerContract $composer;
3929

40-
/**
41-
* AbstractInstaller constructor.
42-
*/
4330
public function __construct(Filesystem $files, ComposerContract $composer)
4431
{
4532
parent::__construct();
@@ -49,21 +36,16 @@ public function __construct(Filesystem $files, ComposerContract $composer)
4936
$this->composer = $composer;
5037
}
5138

52-
/**
53-
* {@inheritdoc}
54-
*/
39+
/** {@inheritdoc} */
5540
public function handle()
5641
{
5742
$this->install();
5843
}
5944

60-
/**
61-
* Requires the provided package.
62-
*/
6345
protected function require(string $package, bool $dev = false): InstallerContract
6446
{
6547
$this->task(
66-
'Require package via composer',
48+
'Require package via Composer',
6749
function () use ($package, $dev) {
6850
return $this->composer->require($package, $dev);
6951
}
@@ -72,13 +54,10 @@ function () use ($package, $dev) {
7254
return $this;
7355
}
7456

75-
/**
76-
* Removes the provided package.
77-
*/
7857
protected function remove(string $package, bool $dev = false): InstallerContract
7958
{
8059
$this->task(
81-
'Remove package via composer',
60+
'Remove package via Composer',
8261
function () use ($package, $dev) {
8362
return $this->composer->remove($package, $dev);
8463
}

src/Components/ConsoleDusk/Installer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class VisitLaravelZeroCommand extends Command
4545
public function handle()
4646
{
4747
$this->browse(function ($browser) {
48-
$browser->visit("http://laravel-zero.com")
48+
$browser->visit("https://laravel-zero.com")
4949
->assertSee("100% Open Source");
5050
});
5151
}

src/Components/Database/Installer.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final class Installer extends AbstractInstaller
4747
*/
4848
public function install(): void
4949
{
50-
$this->require('illuminate/database "^9.0"');
50+
$this->require('illuminate/database "^10.0"');
5151
$this->require('fakerphp/faker "^1.9.1"', true);
5252

5353
$this->task(
@@ -59,7 +59,7 @@ function () {
5959

6060
File::makeDirectory($this->app->databasePath(), 0755, true, true);
6161

62-
File::put(
62+
return File::put(
6363
$this->app->databasePath('database.sqlite'),
6464
''
6565
);
@@ -73,7 +73,7 @@ function () {
7373
return false;
7474
}
7575

76-
File::makeDirectory($this->app->databasePath('migrations'), 0755, true, true);
76+
return File::makeDirectory($this->app->databasePath('migrations'), 0755, true, true);
7777
}
7878
);
7979

@@ -86,7 +86,7 @@ function () {
8686

8787
File::makeDirectory($this->app->databasePath('seeders'), 0755, false, true);
8888

89-
File::copy(
89+
return File::copy(
9090
self::SEEDER_FILE,
9191
$this->app->databasePath('seeders'.DIRECTORY_SEPARATOR.'DatabaseSeeder.php')
9292
);
@@ -100,7 +100,7 @@ function () {
100100
return false;
101101
}
102102

103-
File::makeDirectory($this->app->databasePath('factories'), 0755, true, true);
103+
return File::makeDirectory($this->app->databasePath('factories'), 0755, true, true);
104104
}
105105
);
106106

@@ -110,7 +110,8 @@ function () {
110110
if (File::exists(config_path('database.php'))) {
111111
return false;
112112
}
113-
File::copy(
113+
114+
return File::copy(
114115
self::CONFIG_FILE,
115116
config_path('database.php')
116117
);

src/Components/Database/Migrator.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,14 @@ function ($path) {
4848

4949
return collect($finder)
5050
->map(
51-
function (SplFileInfo $file) {
52-
return $file->getPathname();
53-
}
51+
fn (SplFileInfo $file) => $file->getPathname()
5452
)
5553
->all();
5654
}
5755
)
5856
->filter()
5957
->sortBy(
60-
function ($file) {
61-
return $this->getMigrationName($file);
62-
}
58+
fn ($file) => $this->getMigrationName($file)
6359
)
6460
->values()
6561
->keyBy(

src/Components/Database/Provider.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ protected function registerDatabaseService(): void
9292

9393
if (File::exists($this->app->databasePath('seeders'))) {
9494
collect(File::files($this->app->databasePath('seeders')))->each(
95-
function ($file) {
96-
File::requireOnce($file);
97-
}
95+
fn ($file) => File::requireOnce($file)
9896
);
9997
}
10098
}

src/Components/Http/Installer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class Installer extends AbstractInstaller
3535
*/
3636
public function install(): void
3737
{
38-
$this->require('guzzlehttp/guzzle "^7.4"');
39-
$this->require('illuminate/http "^9.0"');
38+
$this->require('guzzlehttp/guzzle "^7.5"');
39+
$this->require('illuminate/http "^10.0"');
4040
}
4141
}

src/Components/Log/Installer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class Installer extends AbstractInstaller
4141
*/
4242
public function install(): void
4343
{
44-
$this->require('illuminate/log "^9.0"');
44+
$this->require('illuminate/log "^10.0"');
4545

4646
$this->task(
4747
'Creating default logging configuration',

src/Components/Log/Provider.php

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace LaravelZero\Framework\Components\Log;
1515

16+
use Illuminate\Contracts\Config\Repository;
1617
use function class_exists;
1718
use LaravelZero\Framework\Components\AbstractComponentProvider;
1819

@@ -37,6 +38,7 @@ public function register(): void
3738
{
3839
$this->app->register(\Illuminate\Log\LogServiceProvider::class);
3940

41+
/** @var Repository $config */
4042
$config = $this->app['config'];
4143

4244
$config->set('logging.default', $config->get('logging.default') ?: 'default');

src/Components/Logo/Installer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class Installer extends AbstractInstaller
4141
*/
4242
public function install(): void
4343
{
44-
$this->require('laminas/laminas-text "^2.9"');
44+
$this->require('laminas/laminas-text "^2.10"');
4545

4646
$this->task(
4747
'Creating default logo configuration',

src/Components/Menu/Installer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ final class Installer extends AbstractInstaller
3535
*/
3636
public function install(): void
3737
{
38-
$this->require('nunomaduro/laravel-console-menu "^3.2"');
38+
$this->require('nunomaduro/laravel-console-menu "^3.4"');
3939
}
4040
}

src/Components/Queue/Installer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ public function install(): void
4343
{
4444
$this->call('app:install', ['component' => 'database']);
4545

46-
$this->require('illuminate/bus "^9.0"');
47-
$this->require('illuminate/queue "^9.0"');
46+
$this->require('illuminate/bus "^10.0"');
47+
$this->require('illuminate/queue "^10.0"');
4848

4949
$this->task(
5050
'Creating default queue configuration',
5151
function () {
5252
if (! File::exists(config_path('queue.php'))) {
5353
return File::copy(
54-
static::CONFIG_FILE,
54+
self::CONFIG_FILE,
5555
$this->app->configPath('queue.php')
5656
);
5757
}

src/Components/Queue/Provider.php

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace LaravelZero\Framework\Components\Queue;
1515

16+
use Illuminate\Contracts\Config\Repository;
1617
use function class_exists;
1718
use LaravelZero\Framework\Components\AbstractComponentProvider;
1819

@@ -82,6 +83,7 @@ function ($app) {
8283
}
8384
);
8485

86+
/** @var Repository $config */
8587
$config = $this->app['config'];
8688

8789
$config->set('queue.default', $config->get('queue.default') ?: 'default');

src/Components/Redis/Installer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ final class Installer extends AbstractInstaller
2727
/** {@inheritdoc} */
2828
public function install(): void
2929
{
30-
$this->require('illuminate/redis "^9.0"');
30+
$this->require('illuminate/redis "^10.0"');
3131
}
3232
}

src/Components/Updater/Installer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ final class Installer extends AbstractInstaller
3535
*/
3636
public function install(): void
3737
{
38-
$this->require('laravel-zero/phar-updater "^1.2"');
38+
$this->require('laravel-zero/phar-updater "^1.3"');
3939
}
4040
}

src/Components/View/Installer.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class Installer extends AbstractInstaller
4141
*/
4242
public function install(): void
4343
{
44-
$this->require('illuminate/view "^9.0"');
44+
$this->require('illuminate/view "^10.0"');
4545

4646
$this->task(
4747
'Creating resources/views folder',
@@ -73,8 +73,9 @@ function () {
7373
$this->task(
7474
'Creating cache storage folder',
7575
function () {
76-
if (File::exists(base_path('storage/app/.gitignore') &&
77-
File::exists(base_path('storage/framework/views/.gitignore')))) {
76+
if (File::exists(base_path('storage/app/.gitignore')) &&
77+
File::exists(base_path('storage/framework/views/.gitignore'))
78+
) {
7879
return false;
7980
}
8081

tests/ApplicationTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
} catch (CommandNotFoundException $notFoundException) {
2424
}
2525

26-
expect($notFoundException)->toBeInstanceOf(CommandNotFoundException::class);
27-
expect($notFoundException->getMessage())->toEqual('Foo');
26+
expect($notFoundException)->toBeInstanceOf(CommandNotFoundException::class)
27+
->and($notFoundException->getMessage())->toEqual('Foo');
2828

2929
try {
3030
abort(200, 'Bar', ['Foo' => 'Bar']);
3131
} catch (ConsoleExceptionContract $consoleException) {
3232
}
3333

34-
expect($consoleException)->toBeInstanceOf(ConsoleExceptionContract::class);
35-
expect($consoleException->getExitCode())->toEqual(200);
36-
expect($consoleException->getMessage())->toEqual('Bar');
37-
expect($consoleException->getHeaders())->toEqual(['Foo' => 'Bar']);
34+
expect($consoleException)->toBeInstanceOf(ConsoleExceptionContract::class)
35+
->and($consoleException->getExitCode())->toEqual(200)
36+
->and($consoleException->getMessage())->toEqual('Bar')
37+
->and($consoleException->getHeaders())->toEqual(['Foo' => 'Bar']);
3838
});

tests/Components/DatabaseInstallTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$composerMock->expects($this->exactly(2))
1919
->method('require')
2020
->withConsecutive(
21-
['illuminate/database "^9.0"', false],
21+
['illuminate/database "^10.0"', false],
2222
['fakerphp/faker "^1.9.1"', true]
2323
);
2424

@@ -34,11 +34,11 @@
3434

3535
Artisan::call('app:install', ['component' => 'database']);
3636

37-
expect(File::exists(config_path('database.php')))->toBeTrue();
38-
expect(File::exists(database_path('database.sqlite')))->toBeTrue();
39-
expect(File::exists(database_path('migrations')))->toBeTrue();
40-
expect(File::exists(database_path('factories')))->toBeTrue();
41-
expect(File::exists(database_path('seeders'.DIRECTORY_SEPARATOR.'DatabaseSeeder.php')))->toBeTrue();
37+
expect(File::exists(config_path('database.php')))->toBeTrue()
38+
->and(File::exists(database_path('database.sqlite')))->toBeTrue()
39+
->and(File::exists(database_path('migrations')))->toBeTrue()
40+
->and(File::exists(database_path('factories')))->toBeTrue()
41+
->and(File::exists(database_path('seeders'.DIRECTORY_SEPARATOR.'DatabaseSeeder.php')))->toBeTrue();
4242
});
4343

4444
it('adds the required lines to the gitignore', function () {

tests/Components/DatabaseProviderTest.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66

77
it('adds the components commands to the application', function () {
88
$commands = collect(Artisan::all())
9-
->map(
10-
function ($command) {
11-
return get_class($command);
12-
}
13-
)
9+
->map(fn ($command) => get_class($command))
1410
->flip();
1511

1612
collect(

tests/Components/DotenvInstallTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
it('copies the required stubs', function () {
1616
Artisan::call('app:install', ['component' => 'dotenv']);
1717

18-
expect(File::exists(base_path('.env')))->toBeTrue();
19-
expect(File::exists(base_path('.env.example')))->toBeTrue();
18+
expect(File::exists(base_path('.env')))->toBeTrue()
19+
->and(File::exists(base_path('.env.example')))->toBeTrue();
2020
});
2121

2222
it('adds the required lines to the gitignore', function () {

tests/Components/HttpComponentTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
$composerMock->expects($this->exactly(2))
1313
->method('require')
1414
->withConsecutive(
15-
[$this->equalTo('guzzlehttp/guzzle "^7.4"')],
16-
[$this->equalTo('illuminate/http "^9.0"')]
15+
[$this->equalTo('guzzlehttp/guzzle "^7.5"')],
16+
[$this->equalTo('illuminate/http "^10.0"')]
1717
);
1818

1919
$this->app->instance(ComposerContract::class, $composerMock);
@@ -33,6 +33,6 @@
3333
&& $request->url('https://faked.test');
3434
});
3535

36-
expect($response->ok())->toBeTrue();
37-
expect($response->body())->toBeEmpty();
36+
expect($response->ok())->toBeTrue()
37+
->and($response->body())->toBeEmpty();
3838
});

tests/Components/LogInstallTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
$composerMock->expects($this->once())
1717
->method('require')
18-
->with('illuminate/log "^9.0"');
18+
->with('illuminate/log "^10.0"');
1919

2020
$this->app->instance(ComposerContract::class, $composerMock);
2121

tests/Components/LogoInstallTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
$composerMock->expects($this->once())
1717
->method('require')
18-
->with('laminas/laminas-text "^2.9"');
18+
->with('laminas/laminas-text "^2.10"');
1919

2020
$this->app->instance(ComposerContract::class, $composerMock);
2121

0 commit comments

Comments
 (0)