Merge pull request #3036 from acs-ferreira/patch-20

Clean and format
This commit is contained in:
Lucas Bartholemy 2018-02-25 20:16:00 +01:00 committed by GitHub
commit a6340c4bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@ use yii\bootstrap\Html;
use yii\db\Expression; use yii\db\Expression;
use yii\db\ActiveQuery; use yii\db\ActiveQuery;
use yii\base\InvalidConfigException; use yii\base\InvalidConfigException;
use yii\mail\MessageInterface;
use humhub\components\SocialActivity; use humhub\components\SocialActivity;
use humhub\modules\notification\models\Notification; use humhub\modules\notification\models\Notification;
use humhub\modules\notification\jobs\SendNotification; use humhub\modules\notification\jobs\SendNotification;
@ -96,6 +97,7 @@ abstract class BaseNotification extends SocialActivity
if (!$this->_category) { if (!$this->_category) {
$this->_category = $this->category(); $this->_category = $this->category();
} }
return $this->_category; return $this->_category;
} }
@ -121,7 +123,7 @@ abstract class BaseNotification extends SocialActivity
if ($this->hasContent() && $this->getContent()->updated_at instanceof Expression) { if ($this->hasContent() && $this->getContent()->updated_at instanceof Expression) {
$this->getContent()->refresh(); $this->getContent()->refresh();
$date = $this->getContent()->updated_at; $date = $this->getContent()->updated_at;
} else if ($this->hasContent()) { } elseif ($this->hasContent()) {
$date = $this->getContent()->updated_at; $date = $this->getContent()->updated_at;
} else { } else {
$date = null; $date = null;
@ -392,7 +394,7 @@ abstract class BaseNotification extends SocialActivity
->joinWith(['originator', 'originator.profile']) ->joinWith(['originator', 'originator.profile'])
->orderBy(['notification.created_at' => SORT_DESC]) ->orderBy(['notification.created_at' => SORT_DESC])
->groupBy(['notification.originator_user_id']) ->groupBy(['notification.originator_user_id'])
->andWhere(['IS NOT', 'user.id', new \yii\db\Expression('NULL')]) ->andWhere(['IS NOT', 'user.id', new Expression('NULL')])
->limit($limit); ->limit($limit);
foreach ($query->all() as $notification) { foreach ($query->all() as $notification) {
@ -448,7 +450,7 @@ abstract class BaseNotification extends SocialActivity
* @param \yii\mail\MessageInterface $message * @param \yii\mail\MessageInterface $message
* @return boolean when true the mail will be send * @return boolean when true the mail will be send
*/ */
public function beforeMailSend(\yii\mail\MessageInterface $message) public function beforeMailSend(MessageInterface $message)
{ {
return true; return true;
} }