fix offsetSet

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2022-11-07 14:19:43 +10:00
parent 1f975c1d12
commit d8750b6153
3 changed files with 11 additions and 2 deletions

4
.gitignore vendored
View File

@ -1 +1,3 @@
/vendor !.gitignore
composer.phar
vendor

View File

@ -1,7 +1,8 @@
{ {
"name": "mirzaev/vk", "name": "mirzaev/vk",
"type": "framework", "type": "framework",
"description": "PHP-фреймворк ВКонтакте", "description": "Framework for vk.com API",
"readme": "README.md",
"keywords": [ "keywords": [
"vk", "vk",
"api" "api"

View File

@ -237,6 +237,8 @@ class settings implements ArrayAccess
// Жесткая запись // Жесткая запись
$this->settings['attachments'] = $value; $this->settings['attachments'] = $value;
return;
} }
if (empty($this->settings['attachments']) || count($this->settings['attachments']) < 10) { if (empty($this->settings['attachments']) || count($this->settings['attachments']) < 10) {
@ -244,6 +246,8 @@ class settings implements ArrayAccess
// Запись (конкатенация) // Запись (конкатенация)
$this->settings['attachments'][] = $value; $this->settings['attachments'][] = $value;
return;
} }
throw new Exception('Превышено ограничение на 10 вложений', 500); throw new Exception('Превышено ограничение на 10 вложений', 500);
@ -251,6 +255,8 @@ class settings implements ArrayAccess
// Запись по ключу или смещению // Запись по ключу или смещению
$this->settings[$offset] = $value; $this->settings[$offset] = $value;
return;
} }
} }