blob: bd948a8f6dc513607a13aabeeb62b573ca21f021 (
plain)
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
|
<?php
namespace App\Types;
use App\Support\ArrayTransformable;
class LoginFlow implements ArrayTransformable
{
public function __construct(
private LoginType $type,
private bool $get_login_token = false,
)
{}
public function toArray(): array
{
$flow = [
"type" => $this->type,
];
if ($this->type == LoginType::TOKEN) {
$flow["get_login_token"] = $this->get_login_token;
}
return $flow;
}
}
|