Refactored Configuration
This commit is contained in:
parent
5eeb06805a
commit
5555e79327
11 changed files with 247 additions and 46 deletions
34
src/Socialbox/Enums/Flags/PeerFlags.php
Normal file
34
src/Socialbox/Enums/Flags/PeerFlags.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Socialbox\Enums\Flags;
|
||||
|
||||
enum PeerFlags : string
|
||||
{
|
||||
// Administrative Flags
|
||||
case ADMIN = 'ADMIN';
|
||||
case MODERATOR = 'MODERATOR';
|
||||
|
||||
// General Flags
|
||||
case VERIFIED = 'VERIFIED';
|
||||
|
||||
// Verification Flags
|
||||
case VER_SET_PASSWORD = 'VER_SET_PASSWORD';
|
||||
case VER_SET_OTP = 'VER_SET_OTP';
|
||||
case VER_SOLVE_IMAGE_CAPTCHA = 'VER_SOLVE_IMAGE_CAPTCHA';
|
||||
|
||||
/**
|
||||
* Returns whether the flag is public. Public flags can be seen by other peers.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPublic(): bool
|
||||
{
|
||||
return match($this)
|
||||
{
|
||||
self::VER_SET_PASSWORD,
|
||||
self::VER_SET_OTP,
|
||||
self::VER_SOLVE_IMAGE_CAPTCHA => false,
|
||||
default => true,
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue