Просто замена автора
This commit is contained in:
parent
c7fe3623e7
commit
15f4979cf7
|
@ -11,7 +11,7 @@
|
|||
"authors": [
|
||||
{
|
||||
"name": "Arsen Mirzaev Tatyano-Muradovich",
|
||||
"email": "red@hood.su",
|
||||
"email": "arsen@mirzaev.sexy",
|
||||
"homepage": "https://hood.su/mirzaev",
|
||||
"role": "Programmer"
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
|||
"mirzaev/accounts": "~1.2.x-dev",
|
||||
"monolog/monolog": "~1.6",
|
||||
"jasny/error-handler": "~0.2",
|
||||
"guzzlehttp/guzzle": "~7.2"
|
||||
"guzzlehttp/guzzle": "~7.4.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~9.5"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,7 @@
|
|||
|
||||
// declare(strict_types=1);
|
||||
|
||||
// namespace Hood\VK\API;
|
||||
// namespace mirzaev\vk\API;
|
||||
|
||||
// class CallBack extends CallBackAbstract
|
||||
// {
|
||||
|
|
|
@ -26,7 +26,7 @@ use mirzaev\vk\core,
|
|||
* @see https://vk.com/dev/groups.setLongPollSettings
|
||||
*
|
||||
* @package mirzaev\vk\api
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*
|
||||
* @todo Добавить обработку ошибок ($request['errors];)
|
||||
*/
|
||||
|
@ -37,14 +37,14 @@ final class longpoll
|
|||
*
|
||||
* @see $this->get()
|
||||
*/
|
||||
private string $key;
|
||||
private readonly string $key;
|
||||
|
||||
/**
|
||||
* Сервер (URL)
|
||||
*
|
||||
* @see $this->get()
|
||||
*/
|
||||
private string $server;
|
||||
private readonly string $server;
|
||||
|
||||
/**
|
||||
* Идентификатор последнего события
|
||||
|
|
|
@ -32,7 +32,7 @@ enum mode
|
|||
* @see https://vk.com/dev/messages.getById
|
||||
*
|
||||
* @package mirzaev\vk\api
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*
|
||||
* @todo Доработать строгий режим отправки: проверку сообщения в беседе (не имеет ID сообщений)
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ use mirzaev\vk\robots\robot;
|
|||
* @method protected static delete(string $url, ...$params) Удалить
|
||||
*
|
||||
* @package mirzaev\vk\api\methods
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
abstract class method
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ use mirzaev\accounts\vk as account;
|
|||
* @see https://vk.com/dev/messages.getById
|
||||
*
|
||||
* @package mirzaev\vk\api\methods
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*
|
||||
* @todo Добавить обработку ошибок ($request['errors];)
|
||||
*/
|
||||
|
|
|
@ -21,7 +21,7 @@ use mirzaev\vk\robots\robot;
|
|||
* 1. Создать __isset(), __unset()
|
||||
*
|
||||
* @package mirzaev\vk\api
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
class settings implements ArrayAccess
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ use exception;
|
|||
* @method public function get($id = null) Чтение из реестра
|
||||
*
|
||||
* @package mirzaev\vk
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
final class core
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ use mirzaev\vk\core,
|
|||
* @see Jasny\ErrorHandler
|
||||
*
|
||||
* @package mirzaev\vk\loggers
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
final class jasmo extends logger
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace mirzaev\vk\loggers;
|
|||
* Абстрактный класс журналиста
|
||||
*
|
||||
* @package mirzaev\vk\loggers
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
abstract class logger
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ use mirzaev\vk\robots\robot,
|
|||
* @method public function __isset($name) Проверка на инициализированность свойства
|
||||
*
|
||||
* @package mirzaev\vk\robots
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
final class group extends robot
|
||||
{
|
||||
|
@ -38,8 +38,8 @@ final class group extends robot
|
|||
* @param string|null $key Ключ
|
||||
*/
|
||||
public function __construct(
|
||||
protected readonly int|null $id = null,
|
||||
protected readonly string|null $key = null
|
||||
protected ?int $id = null,
|
||||
protected ?string $key = null
|
||||
) {
|
||||
parent::__construct($id, $key);
|
||||
|
||||
|
|
|
@ -39,34 +39,39 @@ use GuzzleHttp\Client as browser;
|
|||
* @method public function __toString() Конвертация в строку
|
||||
*
|
||||
* @package mirzaev\vk\robots
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
abstract class robot
|
||||
{
|
||||
/**
|
||||
* Сессия
|
||||
* @var int $session Сессия
|
||||
*/
|
||||
protected readonly int $session;
|
||||
|
||||
/**
|
||||
* Аккаунт
|
||||
* @var account $account Аккаунт ВКонтакте
|
||||
*/
|
||||
private readonly account $account;
|
||||
|
||||
/**
|
||||
* @var api API ВКонтакте
|
||||
* @var api $api API ВКонтакте
|
||||
*/
|
||||
protected readonly api $api;
|
||||
|
||||
/**
|
||||
* @var browser $browser Браузер
|
||||
*/
|
||||
protected readonly browser $browser;
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @param int|null $id Идентификатор
|
||||
* @param string|null $key Ключ
|
||||
* @param int|null $id Идентификатор робота
|
||||
* @param string|null $key Ключ API ВКонтакте
|
||||
*/
|
||||
public function __construct(
|
||||
protected readonly int|null $id = null,
|
||||
protected readonly string|null $key = null
|
||||
protected ?int $id = null,
|
||||
protected ?string $key = null
|
||||
) {
|
||||
// Инициализация ядра
|
||||
$core = core::init();
|
||||
|
@ -178,14 +183,13 @@ abstract class robot
|
|||
public function __set(string $name, mixed $value): void
|
||||
{
|
||||
match ($name) {
|
||||
'id' => isset($this->id) ? throw new Exception('Запрещено перезаписывать идентификатор', 500) : $this->id = (int) $value,
|
||||
'session' => isset($this->session) ? throw new Exception('Запрещено перезаписывать сессию', 500) : $this->session = (int) $value,
|
||||
'id' => empty($this->id) ?: $this->id = $value,
|
||||
'session' => empty($this->session) ?: $this->session = $value,
|
||||
'key' => $this->key((string) $value),
|
||||
'account' => $this->account($value),
|
||||
'api' => $this->api(),
|
||||
'browser' => isset($this->browser) ? throw new Exception('Запрещено перезаписывать браузер', 500) : $this->browser = $value,
|
||||
'messages_new' => $this->messages_new = (int) $value,
|
||||
default => throw new Exception("Свойство $name не найдено", 404)
|
||||
'browser' => empty($this->browser) ?: $this->browser = $value,
|
||||
'messages_new' => $this->messages_new = (int) $value
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -214,23 +218,16 @@ abstract class robot
|
|||
}
|
||||
|
||||
/**
|
||||
* Проверить свойство на инициализированность
|
||||
* Проверить на инициализированность
|
||||
*
|
||||
* @param string $name Название
|
||||
*
|
||||
* @return mixed
|
||||
* @param mixed $name Название
|
||||
*/
|
||||
public function __isset(string $name): bool
|
||||
{
|
||||
return match ($name) {
|
||||
'id' => isset($this->id),
|
||||
'session' => isset($this->session),
|
||||
'key' => isset($this->key),
|
||||
'account' => isset($this->account),
|
||||
'api' => isset($this->api),
|
||||
'browser' => isset($this->browser),
|
||||
'messages_new' => isset($this->messages_new),
|
||||
default => throw new Exception("Свойство $name не найдено", 404)
|
||||
default => false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use mirzaev\accounts\vk as account;
|
|||
* Робот-пользователь
|
||||
*
|
||||
* @package mirzaev\vk\robots
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
|
||||
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
|
||||
*/
|
||||
final class user extends robot
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue