Skip to content

Commit fd41611

Browse files
Merge remote-tracking branch 'origin/master' into master
2 parents 6f8abec + c25bdd6 commit fd41611

File tree

8 files changed

+129
-284
lines changed

8 files changed

+129
-284
lines changed

src/Events/GedComProgressSent.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class GedComProgressSent implements ShouldBroadcast
2121
/**
2222
* Create a new event instance.
2323
*
24-
* @return void
24+
* @param $slug
25+
* @param $total
26+
* @param $complete
2527
*/
2628
public function __construct($slug, $total, $complete)
2729
{
@@ -34,7 +36,7 @@ public function __construct($slug, $total, $complete)
3436
/**
3537
* Get the channels the event should broadcast on.
3638
*
37-
* @return \Illuminate\Broadcasting\Channel|array
39+
* @return Channel|array
3840
*/
3941
public function broadcastOn()
4042
{

src/Models/Event.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ public function place()
1515

1616
public function getPlacename()
1717
{
18-
if ($this->place) {
19-
return $this->place->title;
20-
} else {
21-
return 'unknown place';
22-
}
18+
return $this->place ? $this->place->title : 'unknown place';
2319
}
2420

2521
public function getTitle()

src/Models/Family.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public function wife()
3434

3535
public function title()
3636
{
37-
return (($this->husband) ? $this->husband->fullname() : '?').
37+
return ($this->husband ? $this->husband->fullname() : '?').
3838
' + '.
39-
(($this->wife) ? $this->wife->fullname() : '?');
39+
($this->wife ? $this->wife->fullname() : '?');
4040
}
4141

4242
public static function getList()
4343
{
44-
$families = self::get();
44+
$families = self::query()->get();
4545
$result = [];
4646
foreach ($families as $family) {
4747
$result[$family->id] = $family->title();
@@ -53,7 +53,7 @@ public static function getList()
5353
public function addEvent($title, $date, $place, $description = '')
5454
{
5555
$place_id = Place::getIdByTitle($place);
56-
$event = FamilyEvent::updateOrCreate(
56+
$event = FamilyEvent::query()->updateOrCreate(
5757
[
5858
'family_id' => $this->id,
5959
'title' => $title,
@@ -76,19 +76,11 @@ public function addEvent($title, $date, $place, $description = '')
7676

7777
public function getWifeName()
7878
{
79-
if ($this->wife) {
80-
return $this->wife->fullname();
81-
} else {
82-
return 'unknown woman';
83-
}
79+
return $this->wife ? $this->wife->fullname() : 'unknown woman';
8480
}
8581

8682
public function getHusbandName()
8783
{
88-
if ($this->husband) {
89-
return $this->husband->fullname();
90-
} else {
91-
return 'unknown man';
92-
}
84+
return $this->husband ? $this->husband->fullname() : 'unknown man';
9385
}
9486
}

src/Models/Person.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getSex()
6363

6464
public static function getList()
6565
{
66-
$persons = self::get();
66+
$persons = self::query()->get();
6767
$result = [];
6868
foreach ($persons as $person) {
6969
$result[$person->id] = $person->fullname();
@@ -75,7 +75,7 @@ public static function getList()
7575
public function addEvent($title, $date, $place, $description = '')
7676
{
7777
$place_id = Place::getIdByTitle($place);
78-
$event = PersonEvent::updateOrCreate(
78+
$event = PersonEvent::query()->updateOrCreate(
7979
[
8080
'person_id' => $this->id,
8181
'title' => $title,

src/Models/Place.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public static function getIdByTitle($title)
1414
if (empty($title)) {
1515
return $id;
1616
}
17-
$place = self::where('title', $title)->first();
17+
$place = self::query()->where('title', $title)->first();
1818
if ($place !== null) {
1919
$id = $place->id;
2020
} else {
21-
$place = self::create(compact('title'));
21+
$place = self::query()->create(compact('title'));
2222
$id = $place->id;
2323
}
2424

0 commit comments

Comments
 (0)