From 64a88c9f4ef09487b06ba480233b7dfd3b323b95 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Wed, 28 Jul 2021 18:00:49 +1000 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=83=D1=81=D1=82=D0=B0=D1=80=D0=B5=D0=B2=D1=88=D0=B8?= =?UTF-8?q?=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirzaev/vk/system/robots/group.php | 17 ++++++++++-- mirzaev/vk/system/robots/robot.php | 44 ------------------------------ 2 files changed, 15 insertions(+), 46 deletions(-) diff --git a/mirzaev/vk/system/robots/group.php b/mirzaev/vk/system/robots/group.php index 9f644ad..f34a04e 100644 --- a/mirzaev/vk/system/robots/group.php +++ b/mirzaev/vk/system/robots/group.php @@ -4,8 +4,9 @@ declare(strict_types=1); namespace mirzaev\vk\robots; -use mirzaev\vk\robots\robot; -use mirzaev\vk\api\longpoll; +use mirzaev\vk\robots\robot, + mirzaev\vk\api\settings as api, + mirzaev\vk\api\longpoll; use Throwable; use Exception; @@ -29,6 +30,18 @@ final class group extends robot */ protected longpoll $longpoll; + /** + * Конструктор + * + * @param int|null $id Идентификатор + * @param string|null $key Ключ + */ + public function __construct( + protected int|null $id = null, + protected string|null $key = null + ) { + parent::__construct($id, $key); + } /** * Запись свойства * diff --git a/mirzaev/vk/system/robots/robot.php b/mirzaev/vk/system/robots/robot.php index f24c637..a968e99 100644 --- a/mirzaev/vk/system/robots/robot.php +++ b/mirzaev/vk/system/robots/robot.php @@ -55,16 +55,6 @@ abstract class robot */ private account $account; - /** - * Прокси - */ - protected proxy $proxy; - - /** - * Обработчик капчи - */ - protected captcha $captcha; - /** * $messages_mode Режим отправки сообщений */ @@ -122,34 +112,6 @@ abstract class robot return $this; } - /** - * Инициализация прокси - * - * @param proxy $proxy Прокси - * - * @return self - */ - public function proxy(proxy $proxy): self - { - $this->__set('proxy', $proxy); - - return $this; - } - - /** - * Инициализация обработчика капчи - * - * @param captcha $captcha Обработчик капчи - * - * @return self - */ - public function captcha(captcha $captcha): self - { - $this->__set('captcha', $captcha); - - return $this; - } - /** * Записать свойство * @@ -167,8 +129,6 @@ abstract class robot 'api' => isset($this->api) ? throw new Exception('Запрещено перезаписывать API', 500) : $this->api = $value, 'account' => isset($this->account) ? throw new Exception('Запрещено перезаписывать аккаунт', 500) : $this->account = $value, 'browser' => isset($this->browser) ? throw new Exception('Запрещено перезаписывать браузер', 500) : $this->browser = $value, - 'proxy' => $this->proxy = $value, - 'captcha' => $this->captcha = $value, 'messages_new' => $this->messages_new = (int) $value, default => throw new Exception("Свойство $name не найдено", 404) }; @@ -193,8 +153,6 @@ abstract class robot 'base_uri' => 'https://api.vk.com/method/', 'cookies' => true ]), - 'proxy' => $this->proxy, - 'captcha' => $this->captcha, 'messages_new' => $this->messages_new, default => throw new Exception("Свойство $name не найдено", 404) }; @@ -216,8 +174,6 @@ abstract class robot 'account' => isset($this->account), 'api' => isset($this->api), 'browser' => isset($this->browser), - 'proxy' => isset($this->proxy), - 'captcha' => isset($this->captcha), 'messages_new' => isset($this->messages_new), default => throw new Exception("Свойство $name не найдено", 404) };