Skip to content

Commit

Permalink
Make shafaq configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
meezaan committed Jul 22, 2020
1 parent 1bd3796 commit 2db004b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/MoonSighting/Isha.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ class Isha extends PrayerTimes
public function __construct(DateTime $date, float $latitude, $shafaq = self::SHAFAQ_GENERAL)
{
parent::__construct($date, $latitude);
$this->shafaq = $shafaq;
$this->setShafaq($shafaq);


}

public function setShafaq(string $shafaq): void
{
if (in_array($shafaq, [self::SHAFAQ_GENERAL, self::SHAFAQ_ABYAD, self::SHAFAQ_AHMER])) {
$this->shafaq = $shafaq;
}

if ($this->shafaq === self::SHAFAQ_AHMER) {
$this->a = 62 + 17.4 / 55.0 * abs($this->latitude);
Expand Down

0 comments on commit 2db004b

Please sign in to comment.