Apply fixes from StyleCI

This commit is contained in:
Nabeel Shahzad
2018-08-26 16:40:04 +00:00
committed by StyleCI Bot
parent 20f46adbc4
commit 9596d88b48
407 changed files with 4032 additions and 3286 deletions

View File

@@ -9,13 +9,12 @@ use Webpatser\Uuid\Uuid;
/**
* Class DatabaseService
* @package App\Services
*/
class DatabaseService extends Service
{
protected $time_fields = [
'created_at',
'updated_at'
'updated_at',
];
protected $uuid_tables = [
@@ -35,8 +34,10 @@ class DatabaseService extends Service
/**
* @param $yaml_file
* @param bool $ignore_errors
* @return array
*
* @throws \Exception
*
* @return array
*/
public function seed_from_yaml_file($yaml_file, $ignore_errors = false): array
{
@@ -46,8 +47,10 @@ class DatabaseService extends Service
/**
* @param $yml
* @param bool $ignore_errors
* @return array
*
* @throws \Exception
*
* @return array
*/
public function seed_from_yaml($yml, $ignore_errors = false): array
{
@@ -55,14 +58,17 @@ class DatabaseService extends Service
}
/**
* @param $table
* @param $row
* @return mixed
* @param $table
* @param $row
*
* @throws \Exception
*
* @return mixed
*/
public function insert_row($table, $row) {
# see if this table uses a UUID as the PK
# if no ID is specified
public function insert_row($table, $row)
{
// see if this table uses a UUID as the PK
// if no ID is specified
if (\in_array($table, $this->uuid_tables, true)) {
if (!array_key_exists('id', $row)) {
$row['id'] = Uuid::generate()->string;