diff options
Diffstat (limited to 'src/Types/LoginFlow.php')
-rw-r--r-- | src/Types/LoginFlow.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Types/LoginFlow.php b/src/Types/LoginFlow.php new file mode 100644 index 0000000..bd948a8 --- /dev/null +++ b/src/Types/LoginFlow.php @@ -0,0 +1,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; + } +} |