Skip to content

Commit

Permalink
Merge branch 'laravel11' of github.com:askdkc/breezejp into laravel11
Browse files Browse the repository at this point in the history
  • Loading branch information
askdkc committed Jan 16, 2024
2 parents 7f60983 + 843a825 commit 72c8e5c
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions src/Commands/BreezejpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function handle(): int
(new Filesystem)->ensureDirectoryExists(lang_path());
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/lang/', lang_path());

if (file_exists(base_path("config/app.php"))) {
if (file_exists(base_path('config/app.php'))) {
$this->info('config/app.phpのlocaleをjaにします');
// Read the contents of the file into a string
$configfile = file_get_contents(base_path('config/app.php'));
Expand Down Expand Up @@ -60,36 +60,34 @@ public function handle(): int

}


// For Laravel 11 and above
$this->info('.envのlocaleをjaにします');
// Read the contents of the file into a string
$configfile = file_get_contents(base_path('.env'));

// Modify the contents of the string
$configfile = str_replace("'locale' => 'en'", "'locale' => 'ja'", $configfile);
$configfile = str_replace("'faker_locale' => 'en_US'", "'faker_locale' => 'ja_JP'", $configfile);
$configfile = str_replace("'timezone' => 'UTC'", "'timezone' => 'Asia/Tokyo'", $configfile);
// Read the contents of the file into a string
$configfile = file_get_contents(base_path('.env'));

// Save the modified contents back to the file
file_put_contents(base_path('.env'), $configfile);
// Modify the contents of the string
$configfile = str_replace("'locale' => 'en'", "'locale' => 'ja'", $configfile);
$configfile = str_replace("'faker_locale' => 'en_US'", "'faker_locale' => 'ja_JP'", $configfile);
$configfile = str_replace("'timezone' => 'UTC'", "'timezone' => 'Asia/Tokyo'", $configfile);

if ($this->confirm('GitHubリポジトリにスターの御協力をお願いします🙏', true)) {
$repoUrl = 'https://github.com/askdkc/breezejp';
// Save the modified contents back to the file
file_put_contents(base_path('.env'), $configfile);

if (PHP_OS_FAMILY == 'Darwin') {
exec("open {$repoUrl}");
}
if (PHP_OS_FAMILY == 'Windows') {
exec("start {$repoUrl}");
}
if (PHP_OS_FAMILY == 'Linux') {
exec("xdg-open {$repoUrl}");
}
if ($this->confirm('GitHubリポジトリにスターの御協力をお願いします🙏', true)) {

Check failure on line 76 in src/Commands/BreezejpCommand.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Askdkc\Breezejp\Commands\BreezejpCommand::handle() should return int but return statement is missing.
$repoUrl = 'https://github.com/askdkc/breezejp';

$this->line('Thank you! / ありがとう💓');
if (PHP_OS_FAMILY == 'Darwin') {
exec("open {$repoUrl}");
}
if (PHP_OS_FAMILY == 'Windows') {
exec("start {$repoUrl}");
}
if (PHP_OS_FAMILY == 'Linux') {
exec("xdg-open {$repoUrl}");
}

$this->line('Thank you! / ありがとう💓');
}


}
}

0 comments on commit 72c8e5c

Please sign in to comment.