Fix formatting and interfaces in nearly every file
This commit is contained in:
@@ -2,16 +2,24 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\BaseCommand;
|
||||
use App\Console\Command;
|
||||
use App\Services\DatabaseService;
|
||||
use DB;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class YamlExport extends BaseCommand
|
||||
/**
|
||||
* Class YamlExport
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class YamlExport extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:export {tables*}';
|
||||
protected $description = 'YAML table export';
|
||||
|
||||
/**
|
||||
* YamlExport constructor.
|
||||
* @param DatabaseService $dbSvc
|
||||
*/
|
||||
public function __construct(DatabaseService $dbSvc)
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -23,17 +31,17 @@ class YamlExport extends BaseCommand
|
||||
public function handle()
|
||||
{
|
||||
$tables = $this->argument('tables');
|
||||
if(empty($tables)) {
|
||||
if (empty($tables)) {
|
||||
$this->error('No tables specified');
|
||||
exit();
|
||||
}
|
||||
|
||||
$export_tables = [];
|
||||
foreach($tables as $table) {
|
||||
foreach ($tables as $table) {
|
||||
$export_tables[$table] = [];
|
||||
|
||||
$rows = DB::table($table)->get();
|
||||
foreach($rows as $row) {
|
||||
foreach ($rows as $row) {
|
||||
$export_tables[$table][] = (array) $row;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user