phpvms/app/Console/Commands/ComposerCommand.php
Nabeel S dc51897314
Additional logging for the stats recalculation (#358)
* Additional logging for the stats recalculation

* style fix
2019-08-10 20:42:35 -04:00

51 lines
1.1 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Console\Command;
use Artisan;
/**
* Class ComposerCommand
*/
class ComposerCommand extends Command
{
protected $signature = 'phpvms:composer {cmd}';
protected $description = 'Composer related tasks';
public function __construct()
{
parent::__construct();
$this->redirectLoggingToFile('stdout');
}
/**
* Run composer update related commands
*/
public function handle()
{
switch (trim($this->argument('cmd'))) {
case 'post-update':
$this->postUpdate();
break;
default:
$this->error('Command exists');
}
}
/**
* Any composer post update tasks
*/
protected function postUpdate(): void
{
if (config('app.env') === 'dev') {
/* @noinspection NestedPositiveIfStatementsInspection */
if (class_exists(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class)) {
Artisan::call('ide-helper:generate');
Artisan::call('ide-helper:meta');
}
}
}
}