PHP 8.4 + MINIMAL 3.2.0 + many improvements

This commit is contained in:
2024-12-15 00:20:44 +03:00
parent 7f7cdced69
commit 0843fd83a5
26 changed files with 931 additions and 416 deletions

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace ${REPO_OWNER}\${REPO_NAME}\models\enumerations;
/**
* Language
*
* Types of languages by ISO 639-1 standart
*
* @package ${REPO_OWNER}\${REPO_NAME}\models\enumerations
*
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
* @author ${REPO_OWNER} <mail@domain.zone>
*/
enum language
{
case en;
case ru;
/**
* Label
*
* Initialize label of the language
*
* @param language|null $language Language into which to translate
*
* @return string Translated label of the language
*
* @todo
* 1. More languages
* 2. Cases???
*/
public function label(?language $language = language::en): string
{
// Exit (success)
return match ($this) {
language::en => match ($language) {
language::en => 'English',
language::ru => 'Английский'
},
language::ru => match ($language) {
language::en => 'Russian',
language::ru => 'Русский'
}
};
}
}

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace ${REPO_OWNER}\${REPO_NAME}\models\enumerations;
/**
* Session
*
* Types of session verification
*
* @package ${REPO_OWNER}\${REPO_NAME}\models\enumerations
*
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
* @author ${REPO_OWNER} <mail@domain.zone>
*/
enum session
{
case hash_only;
case hash_else_address;
}