Skip to content

Commit

Permalink
2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
catferq committed Sep 21, 2020
1 parent a58b03d commit c324eca
Show file tree
Hide file tree
Showing 495 changed files with 916 additions and 2,785 deletions.
115 changes: 19 additions & 96 deletions src/ReactPHPVK/Actions/Sections/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ class Account
{
private Provider $_provider;

private ?Account\Ban $ban = null;
private ?Account\ChangePassword $changePassword = null;
private ?Account\GetActiveOffers $getActiveOffers = null;
private ?Account\GetAppPermissions $getAppPermissions = null;
private ?Account\GetBanned $getBanned = null;
private ?Account\GetCounters $getCounters = null;
private ?Account\GetInfo $getInfo = null;
private ?Account\GetProfileInfo $getProfileInfo = null;
private ?Account\GetPushSettings $getPushSettings = null;
private ?Account\RegisterDevice $registerDevice = null;
private ?Account\SaveProfileInfo $saveProfileInfo = null;
private ?Account\SetInfo $setInfo = null;
private ?Account\SetNameInMenu $setNameInMenu = null;
private ?Account\SetOffline $setOffline = null;
private ?Account\SetOnline $setOnline = null;
private ?Account\SetPushSettings $setPushSettings = null;
private ?Account\SetSilenceMode $setSilenceMode = null;
private ?Account\Unban $unban = null;
private ?Account\UnregisterDevice $unregisterDevice = null;

public function __construct(Provider $provider)
{
$this->_provider = $provider;
Expand All @@ -58,208 +38,151 @@ public function __construct(Provider $provider)
*/
public function ban(): Ban
{
if (!$this->ban) {
$this->ban = new Ban($this->_provider);
}
return $this->ban;
return new Ban($this->_provider);
}

/**
* Changes a user password after access is successfully restored with the [vk.com/dev/auth.restore|auth.restore] method.
*/
public function changePassword(): ChangePassword
{
if (!$this->changePassword) {
$this->changePassword = new ChangePassword($this->_provider);
}
return $this->changePassword;
return new ChangePassword($this->_provider);
}

/**
* Returns a list of active ads (offers) which executed by the user will bring him/her respective number of votes to his balance in the application.
*/
public function getActiveOffers(): GetActiveOffers
{
if (!$this->getActiveOffers) {
$this->getActiveOffers = new GetActiveOffers($this->_provider);
}
return $this->getActiveOffers;
return new GetActiveOffers($this->_provider);
}

/**
* Gets settings of the user in this application.
*/
public function getAppPermissions(): GetAppPermissions
{
if (!$this->getAppPermissions) {
$this->getAppPermissions = new GetAppPermissions($this->_provider);
}
return $this->getAppPermissions;
return new GetAppPermissions($this->_provider);
}

/**
* Returns a user's blacklist.
*/
public function getBanned(): GetBanned
{
if (!$this->getBanned) {
$this->getBanned = new GetBanned($this->_provider);
}
return $this->getBanned;
return new GetBanned($this->_provider);
}

/**
* Returns non-null values of user counters.
*/
public function getCounters(): GetCounters
{
if (!$this->getCounters) {
$this->getCounters = new GetCounters($this->_provider);
}
return $this->getCounters;
return new GetCounters($this->_provider);
}

/**
* Returns current account info.
*/
public function getInfo(): GetInfo
{
if (!$this->getInfo) {
$this->getInfo = new GetInfo($this->_provider);
}
return $this->getInfo;
return new GetInfo($this->_provider);
}

/**
* Returns the current account info.
*/
public function getProfileInfo(): GetProfileInfo
{
if (!$this->getProfileInfo) {
$this->getProfileInfo = new GetProfileInfo($this->_provider);
}
return $this->getProfileInfo;
return new GetProfileInfo($this->_provider);
}

/**
* Gets settings of push notifications.
*/
public function getPushSettings(): GetPushSettings
{
if (!$this->getPushSettings) {
$this->getPushSettings = new GetPushSettings($this->_provider);
}
return $this->getPushSettings;
return new GetPushSettings($this->_provider);
}

/**
* Subscribes an iOS/Android/Windows Phone-based device to receive push notifications
*/
public function registerDevice(): RegisterDevice
{
if (!$this->registerDevice) {
$this->registerDevice = new RegisterDevice($this->_provider);
}
return $this->registerDevice;
return new RegisterDevice($this->_provider);
}

/**
* Edits current profile info.
*/
public function saveProfileInfo(): SaveProfileInfo
{
if (!$this->saveProfileInfo) {
$this->saveProfileInfo = new SaveProfileInfo($this->_provider);
}
return $this->saveProfileInfo;
return new SaveProfileInfo($this->_provider);
}

/**
* Allows to edit the current account info.
*/
public function setInfo(): SetInfo
{
if (!$this->setInfo) {
$this->setInfo = new SetInfo($this->_provider);
}
return $this->setInfo;
return new SetInfo($this->_provider);
}

/**
* Sets an application screen name (up to 17 characters), that is shown to the user in the left menu.
*/
public function setNameInMenu(): SetNameInMenu
{
if (!$this->setNameInMenu) {
$this->setNameInMenu = new SetNameInMenu($this->_provider);
}
return $this->setNameInMenu;
return new SetNameInMenu($this->_provider);
}

/**
* Marks a current user as offline.
*/
public function setOffline(): SetOffline
{
if (!$this->setOffline) {
$this->setOffline = new SetOffline($this->_provider);
}
return $this->setOffline;
return new SetOffline($this->_provider);
}

/**
* Marks the current user as online for 15 minutes.
*/
public function setOnline(): SetOnline
{
if (!$this->setOnline) {
$this->setOnline = new SetOnline($this->_provider);
}
return $this->setOnline;
return new SetOnline($this->_provider);
}

/**
* Change push settings.
*/
public function setPushSettings(): SetPushSettings
{
if (!$this->setPushSettings) {
$this->setPushSettings = new SetPushSettings($this->_provider);
}
return $this->setPushSettings;
return new SetPushSettings($this->_provider);
}

/**
* Mutes push notifications for the set period of time.
*/
public function setSilenceMode(): SetSilenceMode
{
if (!$this->setSilenceMode) {
$this->setSilenceMode = new SetSilenceMode($this->_provider);
}
return $this->setSilenceMode;
return new SetSilenceMode($this->_provider);
}

/**
*
*/
public function unban(): Unban
{
if (!$this->unban) {
$this->unban = new Unban($this->_provider);
}
return $this->unban;
return new Unban($this->_provider);
}

/**
* Unsubscribes a device from push notifications.
*/
public function unregisterDevice(): UnregisterDevice
{
if (!$this->unregisterDevice) {
$this->unregisterDevice = new UnregisterDevice($this->_provider);
}
return $this->unregisterDevice;
return new UnregisterDevice($this->_provider);
}

}
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/Ban.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function setOwnerId(int $value): Ban
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/ChangePassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function setNewPassword(string $value): ChangePassword
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function setCount(int $value): GetActiveOffers
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function setUserId(int $value): GetAppPermissions
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/GetBanned.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setCount(int $value): GetBanned
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/GetCounters.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function setFilter(array $value): GetCounters
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/GetInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function setFields(array $value): GetInfo
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/GetProfileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function _setCustom(array $value): GetProfileInfo
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function setDeviceId(string $value): GetPushSettings
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/RegisterDevice.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function setSandbox(bool $value): RegisterDevice
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function setStatus(string $value): SaveProfileInfo
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/SetInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setValue(string $value): SetInfo
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/SetNameInMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setName(string $value): SetNameInMenu
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/SetOffline.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function _setCustom(array $value): SetOffline
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ReactPHPVK/Actions/Sections/Account/SetOnline.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function setVoip(bool $value): SetOnline
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function setValue(array $value): SetPushSettings
* @param bool $withClear
* @return Promise
*/
public function execute(bool $withClear = true): Promise
public function execute(bool $withClear = false): Promise
{
$params = [];

Expand Down
Loading

0 comments on commit c324eca

Please sign in to comment.