Skip to content

Commit bc3ae7f

Browse files
thmsuatymic
authored andcommitted
GoogleMapsPlaces: check if value "open_now" in "opening_hours" (#1034)
1 parent b7c0afd commit bc3ae7f

File tree

3 files changed

+791
-9
lines changed

3 files changed

+791
-9
lines changed

src/Provider/GoogleMapsPlaces/Model/OpeningHours.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class OpeningHours
2121
{
2222
/**
23-
* @var bool
23+
* @var bool|null
2424
*/
2525
private $openNow;
2626

@@ -35,21 +35,21 @@ class OpeningHours
3535
private $weekdayText;
3636

3737
/**
38-
* @param bool $openNow
39-
* @param array[] $periods
40-
* @param string[] $weekdayText
38+
* @param bool|null $openNow
39+
* @param array[] $periods
40+
* @param string[] $weekdayText
4141
*/
42-
public function __construct(bool $openNow, array $periods, array $weekdayText)
42+
public function __construct($openNow, array $periods, array $weekdayText)
4343
{
4444
$this->openNow = $openNow;
4545
$this->periods = $periods;
4646
$this->weekdayText = $weekdayText;
4747
}
4848

4949
/**
50-
* @return bool
50+
* @return bool|null
5151
*/
52-
public function isOpenNow(): bool
52+
public function isOpenNow()
5353
{
5454
return $this->openNow;
5555
}
@@ -70,10 +70,10 @@ public function getWeekdayText(): array
7070
return $this->weekdayText;
7171
}
7272

73-
public static function fromResult(Stdclass $openingHours): self
73+
public static function fromResult(stdClass $openingHours): self
7474
{
7575
return new self(
76-
$openingHours->open_now,
76+
$openingHours->open_now ?? null,
7777
$openingHours->periods ?? [],
7878
$openingHours->weekday_text ?? []
7979
);

0 commit comments

Comments
 (0)