mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 23:17:47 +01:00
fix: laravel 11 installation
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Laravel\Bridge\Command;
|
||||
|
||||
use Flasher\Laravel\Support\Laravel;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
$class = Laravel::isVersion('11.0', '>=')
|
||||
? 'Flasher\Laravel\Bridge\Typed\Command\FlasherCommand'
|
||||
: 'Flasher\Laravel\Bridge\Legacy\Command\FlasherCommand';
|
||||
|
||||
class_alias($class, 'Flasher\Laravel\Bridge\Command\FlasherCommand');
|
||||
|
||||
if (false) { /** @phpstan-ignore-line */
|
||||
abstract class FlasherCommand
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
abstract protected function flasherExecute(InputInterface $input, OutputInterface $output);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Laravel\Bridge\Legacy\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
abstract class FlasherCommand extends Command
|
||||
{
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
return $this->flasherExecute($input, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
abstract protected function flasherExecute(InputInterface $input, OutputInterface $output);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Laravel\Bridge\Typed\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
abstract class FlasherCommand extends Command
|
||||
{
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
return $this->flasherExecute($input, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
abstract protected function flasherExecute(InputInterface $input, OutputInterface $output);
|
||||
}
|
||||
@@ -9,14 +9,14 @@ namespace Flasher\Laravel\Command;
|
||||
|
||||
use Flasher\Laravel\Support\ServiceProvider as FlasherServiceProvider;
|
||||
use Flasher\Prime\Plugin\PluginInterface;
|
||||
use Flasher\Symfony\Bridge\Command\FlasherCommand;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class InstallCommand extends Command
|
||||
class InstallCommand extends FlasherCommand
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
@@ -32,7 +32,7 @@ class InstallCommand extends Command
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function flasherExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$output->writeln('');
|
||||
$output->writeln('<fg=blue;options=bold>
|
||||
|
||||
Reference in New Issue
Block a user