for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sausin\DBSetAutoIncrement\Listeners;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Config;
class SetAutoIncrement
{
/** @var string */
public $action;
/**
* Create the event listener.
*
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
*/
public function __construct()
$this->action = Config::get('auto-increment.action', 'auto');
}
* Handle the event.
* @param MigrationsEnded $event
public function handle(MigrationsEnded $event)
$event
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
if ($this->action !== 'auto') {
return;
Artisan::call('db:set-auto-increment');
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.