1
0
mirror of https://github.com/flarum/core.git synced 2025-10-18 18:26:07 +02:00

Apply fixes from StyleCI (#1793)

[ci skip] [skip ci]
This commit is contained in:
Franz Liedke
2019-06-12 23:50:21 +02:00
committed by GitHub
parent 5e1680c458
commit 7f5bd1e96b
6 changed files with 12 additions and 12 deletions

View File

@@ -92,19 +92,19 @@ class Post extends AbstractModel
// When a post is created, set its type according to the value of the
// subclass. Also give it an auto-incrementing number within the
// discussion.
static::creating(function (Post $post) {
static::creating(function (self $post) {
$post->type = $post::$type;
$post->number = ++$post->discussion->post_number_index;
$post->discussion->save();
});
static::saving(function (Post $post) {
static::saving(function (self $post) {
$event = new GetModelIsPrivate($post);
$post->is_private = static::$dispatcher->until($event) === true;
});
static::deleted(function (Post $post) {
static::deleted(function (self $post) {
$post->raise(new Deleted($post));
Notification::whereSubject($post)->delete();