Skip to content

Commit fac95e6

Browse files
Merge pull request #71 from familytree365/analysis-ADaxBV
Apply fixes from StyleCI
2 parents d9cd66b + 78c99ea commit fac95e6

File tree

66 files changed

+96
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+96
-183
lines changed

src/Commands/GedcomExporter.php

+10-13
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace FamilyTree365\LaravelGedcom\Commands;
44

5-
use Illuminate\Console\Command;
6-
use Illuminate\Support\Facades\Storage;
75
use FamilyTree365\LaravelGedcom\Models\Person;
8-
use FamilyTree365\LaravelGedcom\Models\Subm;
6+
use Illuminate\Console\Command;
97
use Illuminate\Support\Facades\DB;
8+
use Illuminate\Support\Facades\Storage;
109
use Illuminate\Support\Facades\View;
1110

1211
class GedcomExporter extends Command
@@ -42,12 +41,11 @@ public function __construct()
4241
*/
4342
public function handle()
4443
{
44+
$dir = 'public/gedcom/exported';
4545

46-
$dir = 'public/gedcom/exported';
47-
48-
$filename = $this->argument('filename').".GED";
46+
$filename = $this->argument('filename').'.GED';
4947

50-
$file_path = $dir . '/' . $filename;
48+
$file_path = $dir.'/'.$filename;
5149

5250
if (!file_exists($dir)) {
5351
Storage::makeDirectory($dir);
@@ -69,10 +67,10 @@ public function handle()
6967
$people = Person::all();
7068
$submissions = $query->get();
7169

72-
$data =array (
70+
$data = [
7371
'submissions' => $submissions,
74-
'people' => $people,
75-
);
72+
'people' => $people,
73+
];
7674

7775
$source = View::make('stubs.ged', $data)->render();
7876

@@ -84,9 +82,8 @@ public function handle()
8482

8583
fclose($handle);
8684

87-
$headers = array(
85+
$headers = [
8886
'Content-Type' => 'text/ged',
89-
);
90-
87+
];
9188
}
9289
}

src/Utils/Importer/Fam/Even.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Even
1616
*/
1717
public static function read($conn, $even, $fam, $obje_ids = [])
1818
{
19-
try
20-
{
19+
try {
2120
if ($even == null || $fam === null) {
2221
return;
2322
}
@@ -153,9 +152,7 @@ public static function read($conn, $even, $fam, $obje_ids = [])
153152
\FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid);
154153
}
155154
}
156-
}
157-
catch(Throwable $e)
158-
{
155+
} catch (Throwable $e) {
159156
report($e);
160157
}
161158
}

src/Utils/Importer/Fam/Slgs.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Slgs
1616
*/
1717
public static function read($conn, $slgs, $fam)
1818
{
19-
try
20-
{
19+
try {
2120
if ($slgs == null || $fam === null) {
2221
return;
2322
}
@@ -63,9 +62,7 @@ public static function read($conn, $slgs, $fam)
6362
\FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid);
6463
}
6564
}
66-
}
67-
catch(Throwable $e)
68-
{
65+
} catch (Throwable $e) {
6966
report($e);
7067
}
7168
}

src/Utils/Importer/Indi/Even.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ class Even
1616
*/
1717
public static function read($conn, $events, $person, $obje_ids = [])
1818
{
19+
if (empty($person)) {
20+
return;
21+
}
1922

20-
if(empty($person)) return;
21-
2223
$eventData = [];
2324
foreach ($events as $event) {
2425
if ($event && count($event) > 0) {
@@ -185,10 +186,8 @@ public static function read($conn, $events, $person, $obje_ids = [])
185186

186187
public static function otherField($conn, $events, $person)
187188
{
188-
try
189-
{
189+
try {
190190
foreach ($events as $event) {
191-
192191
if ($event && count($event) > 0) {
193192
$even = $event[0];
194193
$class_name = get_class($even);
@@ -367,9 +366,7 @@ public static function otherField($conn, $events, $person)
367366
// $person->addEvent($_type, $date, $plac);
368367
}
369368
}
370-
}
371-
catch(Throwable $e)
372-
{
369+
} catch (Throwable $e) {
373370
report($e);
374371
}
375372
}

src/Utils/Importer/Note.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ class Note
1414
*/
1515
public static function read($conn, \Gedcom\Record\Note $note, $group = '', $group_id = 0)
1616
{
17-
try
18-
{
19-
$_note = $note->getNote();
17+
try {
18+
$_note = $note->getNote();
2019
$rin = $note->getRin();
2120

2221
// store note
23-
$key = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note) ];
22+
$key = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note)];
2423
$data = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note), 'rin'=>$rin];
2524
$record = MNote::on($conn)->updateOrCreate($key, $data);
2625

@@ -49,11 +48,8 @@ public static function read($conn, \Gedcom\Record\Note $note, $group = '', $grou
4948
}
5049

5150
return $_gid;
52-
}
53-
catch(Throwable $e)
54-
{
55-
report($e);
56-
}
57-
51+
} catch (Throwable $e) {
52+
report($e);
53+
}
5854
}
5955
}

src/Utils/ParentData.php

-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
namespace FamilyTree365\LaravelGedcom\Utils;
44

5-
use Carbon\Carbon;
65
use FamilyTree365\LaravelGedcom\Models\Family;
76
use FamilyTree365\LaravelGedcom\Models\Person;
87
use Illuminate\Support\Str;
9-
use Throwable;
108

119
class ParentData
1210
{

src/Utils/exporter/Fam/Even.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Even
1616
*/
1717
public static function read($conn, $even, $fam, $obje_ids = [])
1818
{
19-
try
20-
{
19+
try {
2120
if ($even == null || $fam === null) {
2221
return;
2322
}
@@ -153,9 +152,7 @@ public static function read($conn, $even, $fam, $obje_ids = [])
153152
\FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid);
154153
}
155154
}
156-
}
157-
catch(Throwable $e)
158-
{
155+
} catch (Throwable $e) {
159156
report($e);
160157
}
161158
}

src/Utils/exporter/Fam/Slgs.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Slgs
1616
*/
1717
public static function read($conn, $slgs, $fam)
1818
{
19-
try
20-
{
19+
try {
2120
if ($slgs == null || $fam === null) {
2221
return;
2322
}
@@ -63,9 +62,7 @@ public static function read($conn, $slgs, $fam)
6362
\FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid);
6463
}
6564
}
66-
}
67-
catch(Throwable $e)
68-
{
65+
} catch (Throwable $e) {
6966
report($e);
7067
}
7168
}

src/Utils/exporter/Indi/Even.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ class Even
1616
*/
1717
public static function read($conn, $events, $person, $obje_ids = [])
1818
{
19+
if (empty($person)) {
20+
return;
21+
}
1922

20-
if(empty($person)) return;
21-
2223
$eventData = [];
2324
foreach ($events as $event) {
2425
if ($event && count($event) > 0) {
@@ -185,10 +186,8 @@ public static function read($conn, $events, $person, $obje_ids = [])
185186

186187
public static function otherField($conn, $events, $person)
187188
{
188-
try
189-
{
189+
try {
190190
foreach ($events as $event) {
191-
192191
if ($event && count($event) > 0) {
193192
$even = $event[0];
194193
$class_name = get_class($even);
@@ -367,9 +366,7 @@ public static function otherField($conn, $events, $person)
367366
// $person->addEvent($_type, $date, $plac);
368367
}
369368
}
370-
}
371-
catch(Throwable $e)
372-
{
369+
} catch (Throwable $e) {
373370
report($e);
374371
}
375372
}

src/Utils/exporter/Note.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ class Note
1414
*/
1515
public static function read($conn, \Gedcom\Record\Note $note, $group = '', $group_id = 0)
1616
{
17-
try
18-
{
19-
$_note = $note->getNote();
17+
try {
18+
$_note = $note->getNote();
2019
$rin = $note->getRin();
2120

2221
// store note
23-
$key = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note) ];
22+
$key = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note)];
2423
$data = ['group'=>$group, 'gid'=>$group_id, 'note'=> utf8_encode($_note), 'rin'=>$rin];
2524
$record = MNote::on($conn)->updateOrCreate($key, $data);
2625

@@ -49,11 +48,8 @@ public static function read($conn, \Gedcom\Record\Note $note, $group = '', $grou
4948
}
5049

5150
return $_gid;
52-
}
53-
catch(Throwable $e)
54-
{
55-
report($e);
56-
}
57-
51+
} catch (Throwable $e) {
52+
report($e);
53+
}
5854
}
5955
}

src/migrations/2020_01_01_120000_create_default_people_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
public function up()
109
{
1110
if (!Schema::hasTable('people')) {

src/migrations/2020_04_10_154637_create_citations_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_10_154850_create_families_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_10_155019_create_notes_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_10_155134_create_places_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_10_155307_create_repositories_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_10_155413_create_sources_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_10_171030_create_types_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_24_211718_create_authors_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_04_24_211852_create_publications_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

src/migrations/2020_06_01_112223_create_persons_events_table.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class() extends Migration {
98
/**
109
* Run the migrations.
1110
*

0 commit comments

Comments
 (0)