forked from sonata-project/SonataAdminBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SonataConfiguration.php
73 lines (66 loc) · 1.91 KB
/
SonataConfiguration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle;
/**
* @phpstan-type SonataConfigurationOptions = array{
* confirm_exit: bool,
* default_admin_route: string,
* default_group: string,
* default_icon: string,
* default_translation_domain: string,
* dropdown_number_groups_per_colums: int,
* form_type: 'standard'|'horizontal',
* html5_validate: bool,
* javascripts: list<string>,
* js_debug: bool,
* list_action_button_content: 'text'|'icon'|'all',
* lock_protection: bool,
* logo_content: 'text'|'icon'|'all',
* mosaic_background: string,
* pager_links: ?int,
* role_admin: string,
* role_super_admin: string,
* search: bool,
* skin: 'skin-black'|'skin-black-light'|'skin-blue'|'skin-blue-light'|'skin-green'|'skin-green-light'|'skin-purple'|'skin-purple-light'|'skin-red'|'skin-red-light'|'skin-yellow'|'skin-yellow-light',
* sort_admins: bool,
* stylesheets: list<string>,
* use_bootlint: bool,
* use_icheck: bool,
* use_select2: bool,
* use_stickyforms: bool
* }
*/
final class SonataConfiguration
{
/**
* @param array<string, mixed> $options
*
* @phpstan-param SonataConfigurationOptions $options
*/
public function __construct(
private string $title,
private string $logo,
private array $options
) {
}
public function getTitle(): string
{
return $this->title;
}
public function getLogo(): string
{
return $this->logo;
}
public function getOption(string $name, mixed $default = null): mixed
{
return $this->options[$name] ?? $default;
}
}