1 | <?php |
||
14 | class ModuleOptions extends AbstractOptions |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $userEntityClassName = User::class; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | protected $bcryptCost = 10; |
||
25 | |||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | protected $thirdPartyGrantTypeEnabled = false; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $thirdPartyProviders = []; |
||
35 | |||
36 | /** |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getUserEntityClassName() |
||
40 | { |
||
41 | return $this->userEntityClassName; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @param string $userClassName |
||
46 | * |
||
47 | * @throws InvalidArgumentException |
||
48 | */ |
||
49 | public function setUserEntityClassName($userClassName) |
||
50 | { |
||
51 | if (! class_exists($userClassName)) { |
||
52 | throw new InvalidArgumentException('User class does not exist'); |
||
53 | } |
||
54 | |||
55 | $this->userEntityClassName = (string) $userClassName; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return int |
||
60 | */ |
||
61 | public function getBcryptCost() |
||
62 | { |
||
63 | return $this->bcryptCost; |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param int $bcryptCost |
||
68 | */ |
||
69 | public function setBcryptCost($bcryptCost) |
||
70 | { |
||
71 | $this->bcryptCost = (int) $bcryptCost; |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * @return bool |
||
76 | */ |
||
77 | 2 | public function isThirdPartyGrantTypeEnabled() |
|
81 | |||
82 | /** |
||
83 | * @param bool $thirdPartyProvidersEnabled |
||
84 | */ |
||
85 | public function setThirdPartyGrantTypeEnabled($thirdPartyProvidersEnabled) |
||
86 | { |
||
87 | $this->thirdPartyGrantTypeEnabled = $thirdPartyProvidersEnabled; |
||
88 | } |
||
89 | |||
90 | /** |
||
91 | * @return array |
||
92 | */ |
||
93 | 2 | public function getThirdPartyProviders() |
|
97 | |||
98 | /** |
||
99 | * @param array $thirdPartyProviders |
||
100 | */ |
||
101 | public function setThirdPartyProviders($thirdPartyProviders) |
||
102 | { |
||
105 | } |
||
106 |