mirror of
https://github.com/flarum/core.git
synced 2025-10-28 22:07:33 +01:00
* Add an ActorReference class to store the actor `$request->getAttribute('actorReference')->getActor()`
* Add a middleware to inject the actor reference
* Deprecate `$request->getAttribute('actor')`
31 lines
467 B
PHP
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;
|
|
}
|
|
}
|