Page MenuHomePhorge

PhabricatorPolicyRuleLunarPhase.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PhabricatorPolicyRuleLunarPhase.php

<?php
final class PhabricatorPolicyRuleLunarPhase
extends PhabricatorPolicyRule {
const PHASE_FULL = 'full';
const PHASE_NEW = 'new';
const PHASE_WAXING = 'waxing';
const PHASE_WANING = 'waning';
public function getRuleDescription() {
return pht('when the moon');
}
public function applyRule(PhabricatorUser $viewer, $value) {
$moon = new PhutilLunarPhase(PhabricatorTime::getNow());
switch ($value) {
case 'full':
return $moon->isFull();
case 'new':
return $moon->isNew();
case 'waxing':
return $moon->isWaxing();
case 'waning':
return $moon->isWaning();
}
return false;
}
public function getValueControlType() {
return self::CONTROL_TYPE_SELECT;
}
public function getValueControlTemplate() {
return array(
'options' => array(
self::PHASE_FULL => pht('is full'),
self::PHASE_NEW => pht('is new'),
self::PHASE_WAXING => pht('is waxing'),
self::PHASE_WANING => pht('is waning'),
),
);
}
public function getRuleOrder() {
return 1000;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 3, 10:48 PM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61736
Default Alt Text
PhabricatorPolicyRuleLunarPhase.php (1 KB)

Event Timeline