1
0
mirror of https://github.com/flarum/core.git synced 2025-10-28 22:07:33 +01:00
Files
php-flarum/src/Http/ActorReference.php
Sami Mazouz 9e3699ea47 Access request actor in error handler (#2410)
* Add an ActorReference class to store the actor `$request->getAttribute('actorReference')->getActor()`
* Add a middleware to inject the actor reference
* Deprecate `$request->getAttribute('actor')`
2021-04-12 18:42:22 +01:00

31 lines
467 B
PHP

<?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\Http;
use Flarum\User\User;
class ActorReference
{
/**
* @var User
*/
private $actor;
public function setActor(User $actor)
{
$this->actor = $actor;
}
public function getActor(): User
{
return $this->actor;
}
}