Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* * This file is part of Flarum. * * For detailed copyright and license informa..
Decoded Output download
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Lock\Listener;
use Flarum\Lock\Event\DiscussionWasUnlocked;
use Flarum\Lock\Notification\DiscussionLockedBlueprint;
use Flarum\Lock\Post\DiscussionLockedPost;
use Flarum\Notification\NotificationSyncer;
class CreatePostWhenDiscussionIsUnlocked
{
public function __construct(
protected NotificationSyncer $notifications
) {
}
public function handle(DiscussionWasUnlocked $event): void
{
$post = DiscussionLockedPost::reply(
$event->discussion->id,
$event->user->id,
false
);
$post = $event->discussion->mergePost($post);
if ($event->discussion->user_id !== $event->user->id) {
$notification = new DiscussionLockedBlueprint($post);
$this->notifications->sync($notification, $post->exists ? [$event->discussion->user] : []);
}
}
}
?>
Did this file decode correctly?
Original Code
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Lock\Listener;
use Flarum\Lock\Event\DiscussionWasUnlocked;
use Flarum\Lock\Notification\DiscussionLockedBlueprint;
use Flarum\Lock\Post\DiscussionLockedPost;
use Flarum\Notification\NotificationSyncer;
class CreatePostWhenDiscussionIsUnlocked
{
public function __construct(
protected NotificationSyncer $notifications
) {
}
public function handle(DiscussionWasUnlocked $event): void
{
$post = DiscussionLockedPost::reply(
$event->discussion->id,
$event->user->id,
false
);
$post = $event->discussion->mergePost($post);
if ($event->discussion->user_id !== $event->user->id) {
$notification = new DiscussionLockedBlueprint($post);
$this->notifications->sync($notification, $post->exists ? [$event->discussion->user] : []);
}
}
}
Function Calls
None |
Stats
MD5 | 16807f97f407af4942b64fe1f018751a |
Eval Count | 0 |
Decode Time | 80 ms |