Skip to content

Commit

Permalink
why are vigil masses not inheriting psalter_week?
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Nov 10, 2024
1 parent 572617c commit d754248
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/FestivityCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1099,15 +1099,14 @@ public static function psalterWeek(int $weekOfOrdinaryTimeOrSeason): int
public function calculatePsalterWeek(): void
{
foreach ($this->festivities as $key => $value) {
if (!property_exists($value, 'psalter_week')) {
if (false === property_exists($value, 'psalter_week')) {
// Vigils can inherit the value from the corresponding event for which they are vigils
if (property_exists($value, 'is_vigil_mass') && $value->is_vigil_mass) {
$is_vigil_for = $value->is_vigil_for;
if (property_exists($this->festivities[$is_vigil_for], 'psalter_week')) {
$this->festivities[$key]->psalter_week = $this->festivities[$is_vigil_for]->psalter_week;
if (property_exists($this->festivities[$value->is_vigil_for], 'psalter_week')) {
$this->festivities[$key]->psalter_week = $this->festivities[$value->is_vigil_for]->psalter_week;
} else {
$this->festivities[$key]->psalter_week = 0;
$this->festivities[$is_vigil_for]->psalter_week = 0;
$this->festivities[$value->is_vigil_for]->psalter_week = 0;
}
}

Expand Down

0 comments on commit d754248

Please sign in to comment.