Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 3
CRAP
28.57% covered (danger)
28.57%
2 / 7
TaskNotificationCategory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 3
19.12
28.57% covered (danger)
28.57%
2 / 7
 getTitle
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getDescription
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getDefaultSetting
0.00% covered (danger)
0.00%
0 / 1
7.46
40.00% covered (warning)
40.00%
2 / 5
<?php
/**
 * @link https://www.humhub.org/
 * @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
 * @license https://www.humhub.com/licences
 *
 */
namespace humhub\modules\tasks\notifications;
use Yii;
use humhub\modules\notification\components\NotificationCategory;
use humhub\modules\notification\targets\BaseTarget;
use humhub\modules\notification\targets\MailTarget;
use humhub\modules\notification\targets\WebTarget;
use humhub\modules\notification\targets\MobileTarget;
/**
 * SpaceMemberNotificationCategory
 *
 * @author buddha
 */
class TaskNotificationCategory extends NotificationCategory
{
    /**
     * @inheritdoc
     */
    public $id = 'task';
    /**
     * @inheritdoc
     */
    public function getTitle()
    {
        return Yii::t('TasksModule.base', 'Tasks');
    }
    /**
     * @inheritdoc
     */
    public function getDescription()
    {
        return Yii::t('TasksModule.notifications', 'Receive Notifications for Tasks (Deadline Updates, Status changes ...).');
    }
    /**
     * @inheritdoc
     */
    public function getDefaultSetting(BaseTarget $target)
    {
        if($target instanceof WebTarget || $target instanceof MailTarget) {
            return true;
        }  else if ($target instanceof MobileTarget) {
            return false;
        }
        return $target->defaultSetting;
    }
}