Translate all code comments from Russian to English [skip ci]

This commit is contained in:
ErickSkrauch
2019-07-15 01:59:56 +03:00
parent 31069562b3
commit 3dbf29d34c
64 changed files with 264 additions and 286 deletions

View File

@@ -13,7 +13,7 @@ use yii\db\ActiveRecord;
use const common\LATEST_RULES_VERSION;
/**
* Поля модели:
* Fields:
* @property integer $id
* @property string $uuid
* @property string $username
@@ -30,11 +30,11 @@ use const common\LATEST_RULES_VERSION;
* @property integer $updated_at
* @property integer $password_changed_at
*
* Геттеры-сеттеры:
* @property string $password пароль пользователя (только для записи)
* @property string $profileLink ссылка на профиль на Ely без поддержки static url (только для записи)
* Getters-setters:
* @property-write string $password plain user's password
* @property-read string $profileLink link to the user's Ely.by profile
*
* Отношения:
* Relations:
* @property EmailActivation[] $emailActivations
* @property OauthSession[] $oauthSessions
* @property OauthClient[] $oauthClients
@@ -42,7 +42,7 @@ use const common\LATEST_RULES_VERSION;
* @property AccountSession[] $sessions
* @property MinecraftAccessKey[] $minecraftAccessKeys
*
* Поведения:
* Behaviors:
* @mixin TimestampBehavior
*/
class Account extends ActiveRecord {
@@ -113,11 +113,6 @@ class Account extends ActiveRecord {
return $this->hasMany(MinecraftAccessKey::class, ['account_id' => 'id']);
}
/**
* Выполняет проверку, принадлежит ли этому нику аккаунт у Mojang
*
* @return bool
*/
public function hasMojangUsernameCollision(): bool {
return MojangUsername::find()
->andWhere(['username' => $this->username])
@@ -125,9 +120,8 @@ class Account extends ActiveRecord {
}
/**
* Т.к. у нас нет инфы по static_url пользователя, то пока генерируем самый простой вариант
* с ссылкой на профиль по id. На Ely он всё равно редиректнется на static, а мы так или
* иначе обеспечим отдачу этой инфы.
* Since we don't have info about the user's static_url, we still generate the simplest
* version with a link to the profile by it's id. On Ely.by, it will be redirected to static url.
*
* @return string
*/
@@ -136,10 +130,10 @@ class Account extends ActiveRecord {
}
/**
* При создании структуры БД все аккаунты получают null значение в это поле, однако оно
* обязательно для заполнения. Все мигрировавшие с Ely аккаунты будут иметь null значение,
* а актуальной версией будет 1 версия правил сайта (т.к. раньше их просто не было). Ну а
* дальше уже будем инкрементить.
* Initially, the table of users we got from the main site, where there were no rules.
* All existing users at the time of migration received an empty value in this field.
* They will have to confirm their agreement with the rules at the first login.
* All new users automatically agree with the current version of the rules.
*
* @return bool
*/

View File

@@ -7,7 +7,7 @@ use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
/**
* Поля модели:
* Fields:
* @property integer $id
* @property integer $account_id
* @property string $refresh_token
@@ -15,10 +15,10 @@ use yii\db\ActiveRecord;
* @property integer $created_at
* @property integer $last_refreshed_at
*
* Отношения:
* Relations:
* @property Account $account
*
* Поведения:
* Behaviors:
* @mixin TimestampBehavior
*/
class AccountSession extends ActiveRecord {

View File

@@ -11,17 +11,17 @@ use yii\db\ActiveRecord;
use yii\helpers\ArrayHelper;
/**
* Поля модели:
* Fields:
* @property string $key
* @property integer $account_id
* @property integer $type
* @property string $_data
* @property integer $created_at
*
* Отношения:
* Relations:
* @property Account $account
*
* Поведения:
* Behaviors:
* @mixin TimestampBehavior
* @mixin EmailActivationExpirationBehavior
* @mixin DataBehavior

View File

@@ -8,22 +8,21 @@ use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
/**
* Это временный класс, куда мигрирует вся логика ныне существующего authserver.ely.by.
* Поскольку там допускался вход по логину и паролю, а формат хранения выданных токенов был
* иным, то на период, пока мы окончательно не мигрируем, нужно сохранить старую логику
* и структуру под неё.
* This is a temporary class where all the logic of the authserver.ely.by service.
* Since the login and password were allowed there, and the format of storage of the issued tokens was different,
* we need to keep the legacy logic and structure under it for the period until we finally migrate.
*
* Поля модели:
* Fields:
* @property string $access_token
* @property string $client_token
* @property integer $account_id
* @property integer $created_at
* @property integer $updated_at
*
* Отношения:
* Relations:
* @property Account $account
*
* Поведения:
* Behaviors:
* @mixin TimestampBehavior
* @mixin PrimaryKeyValueBehavior
*/

View File

@@ -5,12 +5,12 @@ use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
/**
* Поля модели:
* Fields:
* @property string $username
* @property string $uuid
* @property integer $last_pulled_at
*
* Поведения:
* Behaviors:
* @mixin TimestampBehavior
*/
class MojangUsername extends ActiveRecord {

View File

@@ -7,7 +7,7 @@ use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
/**
* Поля модели:
* Fields:
* @property string $id
* @property string $secret
* @property string $type
@@ -21,7 +21,7 @@ use yii\db\ActiveRecord;
* @property bool $is_deleted
* @property integer $created_at
*
* Отношения:
* Behaviors:
* @property Account|null $account
* @property OauthSession[] $sessions
*/

View File

@@ -4,19 +4,19 @@ namespace common\models;
final class OauthOwnerType {
/**
* Используется для сессий, принадлежащих непосредственно пользователям account.ely.by,
* выполнивших парольную авторизацию и использующих web интерфейс
* Used for sessions belonging directly to account.ely.by users
* who have performed password authentication and are using the web interface
*/
public const ACCOUNT = 'accounts';
/**
* Используется когда пользователь по протоколу oAuth2 authorization_code
* разрешает приложению получить доступ и выполнять действия от своего имени
* Used when a user uses OAuth2 authorization_code protocol to allow an application
* to access and perform actions on its own behalf
*/
public const USER = 'user';
/**
* Используется для авторизованных по протоколу oAuth2 client_credentials
* Used for clients authorized via OAuth2 client_credentials protocol
*/
public const CLIENT = 'client';

View File

@@ -9,15 +9,15 @@ use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
/**
* Поля:
* Fields:
* @property integer $id
* @property string $owner_type содержит одну из констант OauthOwnerType
* @property string $owner_type contains one of the OauthOwnerType constants
* @property string|null $owner_id
* @property string $client_id
* @property string $client_redirect_uri
* @property integer $created_at
*
* Отношения
* Relations:
* @property OauthClient $client
* @property Account $account
* @property Set $scopes

View File

@@ -5,16 +5,16 @@ use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
/**
* Поля модели:
* Fields:
* @property integer $id
* @property string $username
* @property integer $account_id
* @property integer $applied_in
*
* Отношения:
* Relations:
* @property Account $account
*
* Поведения:
* Behaviors:
* @mixin TimestampBehavior
*/
class UsernameHistory extends ActiveRecord {

View File

@@ -5,7 +5,7 @@ use common\models\EmailActivation;
use yii\helpers\ArrayHelper;
/**
* Поведения:
* Behaviors:
* @mixin NewEmailConfirmationBehavior
*/
class NewEmailConfirmation extends EmailActivation {