Created
August 31, 2017 06:55
-
-
Save Rolice/6c6bcc4fedc12f369691d40cf259a41a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
/** | |
* A command that handles IDE helper generation of helper file and PHPStorm metadata against platform environment. | |
* This command performs these actions in development environment, else it does nothing, but does not crash the project. | |
* @name IdeHelperHandler | |
* @author Lyubomir Gardev | |
* @verion 1.0 | |
*/ | |
class IdeHelperHandler extends Command | |
{ | |
/** | |
* The name and signature of the console command. | |
* | |
* @var string | |
*/ | |
protected $signature = 'ide-helper:handle'; | |
/** | |
* The console command description. | |
* | |
* @var string | |
*/ | |
protected $description = 'Handles ide-helper generation through composer.'; | |
/** | |
* Execute the console command. | |
* | |
* @return mixed | |
*/ | |
public function handle() | |
{ | |
$ide_helper_provider = '\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider'; | |
if (in_array(app()->environment(), ['local', 'development']) && class_exists($ide_helper_provider)) { | |
$this->call('ide-helper:generate'); | |
$this->call('ide-helper:meta'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment