Add actor to extension update event

This commit is contained in:
SychO9 2021-11-23 23:50:06 +01:00
parent 8e39edb200
commit b2d8f3dd5b
2 changed files with 9 additions and 2 deletions

View File

@ -85,7 +85,7 @@ class UpdateExtensionHandler
}
$this->events->dispatch(
new Updated($extension)
new Updated($command->actor, $extension)
);
return true;

View File

@ -10,16 +10,23 @@
namespace Flarum\PackageManager\Extension\Event;
use Flarum\Extension\Extension;
use Flarum\User\User;
class Updated
{
/**
* @var User
*/
public $actor;
/**
* @var Extension
*/
public $extension;
public function __construct(Extension $extension)
public function __construct(User $actor, Extension $extension)
{
$this->actor = $actor;
$this->extension = $extension;
}
}