1
0
mirror of https://github.com/flarum/core.git synced 2025-01-17 22:29:15 +01:00

Fix ModelPrivate docblocks

This commit is contained in:
Alexander Skvortsov 2021-03-13 17:15:50 -05:00
parent 9c3b6c596f
commit a8ba510655

View File

@ -14,7 +14,7 @@ use Flarum\Foundation\ContainerUtil;
use Illuminate\Contracts\Container\Container; use Illuminate\Contracts\Container\Container;
/** /**
* Some models, in particular Discussion and Post, are intended to * Some models, in particular Discussion and CommentPost, are intended to
* support a "private" mode, wherein they aren't visible unless some * support a "private" mode, wherein they aren't visible unless some
* criteria is met. This can be used to implement anything from * criteria is met. This can be used to implement anything from
* private discussions to post approvals. * private discussions to post approvals.
@ -25,7 +25,7 @@ use Illuminate\Contracts\Container\Container;
* `false`. Accordingly, this is only available for models with an `is_private` * `false`. Accordingly, this is only available for models with an `is_private`
* field. * field.
* *
* In Flarum core, the Discussion and Post models come with private support. * In Flarum core, the Discussion and CommentPost models come with private support.
* Core also contains visibility scopers that hide instances of these models * Core also contains visibility scopers that hide instances of these models
* with `is_private = true` from queries. Extensions can register custom scopers * with `is_private = true` from queries. Extensions can register custom scopers
* for these classes with the `viewPrivate` ability to grant access to view some * for these classes with the `viewPrivate` ability to grant access to view some
@ -37,7 +37,7 @@ class ModelPrivate implements ExtenderInterface
private $checkers = []; private $checkers = [];
/** /**
* @param string $modelClass The ::class attribute of the model you are applying scopers to. * @param string $modelClass The ::class attribute of the model you are applying private checkers to.
* This model must have a `is_private` field. * This model must have a `is_private` field.
*/ */
public function __construct(string $modelClass) public function __construct(string $modelClass)
@ -51,8 +51,7 @@ class ModelPrivate implements ExtenderInterface
* @param callable|string $callback * @param callable|string $callback
* *
* The callback can be a closure or invokable class, and should accept: * The callback can be a closure or invokable class, and should accept:
* - \Flarum\User\User $actor * - \Flarum\Database\AbstractModel $instance: An instance of the model.
* - \Illuminate\Database\Eloquent\Builder $query
* *
* It should return `true` if the model instance should be made private. * It should return `true` if the model instance should be made private.
* *