Skip to content
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

Laravel 5.5 - BotManCacheClear.php causing issues. #28

Closed
Sammyjo20 opened this issue Sep 13, 2018 · 2 comments
Closed

Laravel 5.5 - BotManCacheClear.php causing issues. #28

Sammyjo20 opened this issue Sep 13, 2018 · 2 comments

Comments

@Sammyjo20
Copy link

Sammyjo20 commented Sep 13, 2018

When using composer install or composer update, I'm getting the issue below:

Class BotMan\Studio\Console\Commands\BotManCacheClear contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Illuminate\Console\GeneratorCommand::getStub)

I've had a look at the BotManCacheClear.php class and found that if you change the class extension from Illuminate\Console\GeneratorCommand to Illuminate\Console\Command it works fine:

class BotManCacheClear extends GeneratorCommand

to:

class BotManCacheClear extends Command

@jogeshpi03
Copy link

jogeshpi03 commented Sep 18, 2018

@Sammyjo20 Yes, It has a compatibility issue with Illuminate\Console\GeneratorCommand. I have fixed the issue, but not able to put it on the master branch. Anyway

Please take a look on the updated BotManCacheClear.php file

namespace BotMan\Studio\Console\Commands;

use Illuminate\Filesystem\Filesystem;
use Illuminate\Console\GeneratorCommand;

class BotManCacheClear extends GeneratorCommand
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'botman:cache:clear';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Remove all cached conversations.';

    /**
     * Create a new command instance.
     * 
     * @param Filesystem $files
     */
    public function __construct(Filesystem $files)
    {
        parent::__construct($files);
    }

    /**
     * Execute the console command.
     *
     * @param \Illuminate\Filesystem\Filesystem $files
     * @return mixed
     */
    public function handle()
    {
        $cacheFolder = storage_path('botman');

        if ($this->files->exists($cacheFolder)) {
            $this->files->cleanDirectory($cacheFolder);
        }

        $this->info('BotMan cache cleared!');
    }
}

@Sammyjo20
Copy link
Author

Sweet, thanks! 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants