mirror of
https://github.com/flarum/core.git
synced 2025-07-21 16:51:34 +02:00
Applied fixes from StyleCI
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
@@ -10,8 +11,8 @@
|
|||||||
|
|
||||||
namespace Flarum\Sticky\Gambit;
|
namespace Flarum\Sticky\Gambit;
|
||||||
|
|
||||||
use Flarum\Core\Search\AbstractSearch;
|
|
||||||
use Flarum\Core\Search\AbstractRegexGambit;
|
use Flarum\Core\Search\AbstractRegexGambit;
|
||||||
|
use Flarum\Core\Search\AbstractSearch;
|
||||||
|
|
||||||
class StickyGambit extends AbstractRegexGambit
|
class StickyGambit extends AbstractRegexGambit
|
||||||
{
|
{
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
@@ -51,6 +52,7 @@ class PinStickiedDiscussionsToTop
|
|||||||
foreach ($search->getActiveGambits() as $gambit) {
|
foreach ($search->getActiveGambits() as $gambit) {
|
||||||
if ($gambit instanceof TagGambit) {
|
if ($gambit instanceof TagGambit) {
|
||||||
array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']);
|
array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
@@ -11,9 +12,9 @@
|
|||||||
namespace Flarum\Sticky\Listener;
|
namespace Flarum\Sticky\Listener;
|
||||||
|
|
||||||
use Flarum\Core\Access\AssertPermissionTrait;
|
use Flarum\Core\Access\AssertPermissionTrait;
|
||||||
|
use Flarum\Event\DiscussionWillBeSaved;
|
||||||
use Flarum\Sticky\Event\DiscussionWasStickied;
|
use Flarum\Sticky\Event\DiscussionWasStickied;
|
||||||
use Flarum\Sticky\Event\DiscussionWasUnstickied;
|
use Flarum\Sticky\Event\DiscussionWasUnstickied;
|
||||||
use Flarum\Event\DiscussionWillBeSaved;
|
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
|
|
||||||
class SaveStickyToDatabase
|
class SaveStickyToDatabase
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
@@ -50,19 +51,19 @@ class DiscussionStickiedPost extends AbstractEventPost implements MergeableInter
|
|||||||
/**
|
/**
|
||||||
* Create a new instance in reply to a discussion.
|
* Create a new instance in reply to a discussion.
|
||||||
*
|
*
|
||||||
* @param integer $discussionId
|
* @param int $discussionId
|
||||||
* @param integer $userId
|
* @param int $userId
|
||||||
* @param boolean $isSticky
|
* @param bool $isSticky
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function reply($discussionId, $userId, $isSticky)
|
public static function reply($discussionId, $userId, $isSticky)
|
||||||
{
|
{
|
||||||
$post = new static;
|
$post = new static;
|
||||||
|
|
||||||
$post->content = static::buildContent($isSticky);
|
$post->content = static::buildContent($isSticky);
|
||||||
$post->time = time();
|
$post->time = time();
|
||||||
$post->discussion_id = $discussionId;
|
$post->discussion_id = $discussionId;
|
||||||
$post->user_id = $userId;
|
$post->user_id = $userId;
|
||||||
|
|
||||||
return $post;
|
return $post;
|
||||||
}
|
}
|
||||||
@@ -70,7 +71,7 @@ class DiscussionStickiedPost extends AbstractEventPost implements MergeableInter
|
|||||||
/**
|
/**
|
||||||
* Build the content attribute.
|
* Build the content attribute.
|
||||||
*
|
*
|
||||||
* @param boolean $isSticky Whether or not the discussion is stickied.
|
* @param bool $isSticky Whether or not the discussion is stickied.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function buildContent($isSticky)
|
public static function buildContent($isSticky)
|
||||||
|
Reference in New Issue
Block a user