people who need Configs should accept Configs, no need to specify BaseConfig
This commit is contained in:
parent
8efa960e5d
commit
32368a8f94
3 changed files with 6 additions and 6 deletions
|
@ -49,9 +49,9 @@ class SetupPanel
|
||||||
{
|
{
|
||||||
/** @var SetupBlock[] */
|
/** @var SetupBlock[] */
|
||||||
public array $blocks = [];
|
public array $blocks = [];
|
||||||
public BaseConfig $config;
|
public Config $config;
|
||||||
|
|
||||||
public function __construct(BaseConfig $config)
|
public function __construct(Config $config)
|
||||||
{
|
{
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
@ -68,9 +68,9 @@ class SetupBlock extends Block
|
||||||
{
|
{
|
||||||
public ?string $header;
|
public ?string $header;
|
||||||
public ?string $body;
|
public ?string $body;
|
||||||
public BaseConfig $config;
|
public Config $config;
|
||||||
|
|
||||||
public function __construct(string $title, BaseConfig $config)
|
public function __construct(string $title, Config $config)
|
||||||
{
|
{
|
||||||
parent::__construct($title, "", "main", 50);
|
parent::__construct($title, "", "main", 50);
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
|
@ -24,7 +24,7 @@ class UserOperationsBuildingEvent extends PartListBuildingEvent
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public User $user,
|
public User $user,
|
||||||
public BaseConfig $user_config,
|
public Config $user_config,
|
||||||
) {
|
) {
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class UserConfig extends Extension
|
||||||
$user_config = self::get_for_user($event->user->id);
|
$user_config = self::get_for_user($event->user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get_for_user(int $id): BaseConfig
|
public static function get_for_user(int $id): Config
|
||||||
{
|
{
|
||||||
global $database;
|
global $database;
|
||||||
|
|
||||||
|
|
Reference in a new issue