This commit is contained in:
f4ilji
2024-11-13 13:38:58 +05:00
parent 462680ba77
commit f091b29b63
22 changed files with 488 additions and 418 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ class VkService
return $this->wallService->getPostById($id);
}
public function createPost(string $title, string $message, array $images = [], int $publish_date = null)
public function createPost(string $title, string $message, array $images = [], int|null $publish_date = null)
{
$from_group = 1;
$album_attachment = '';
@@ -40,7 +40,7 @@ class VkService
return $this->wallService->createPost($message, $from_group, $album_attachment, $publish_date);
}
public function updatePost(int $id, string $title, string $message, array $images = [], int $publish_date = null)
public function updatePost(int $id, string $title, string $message, array $images = [], int|null $publish_date = null)
{
$from_group = 1;
$vk_post = $this->wallService->getPostById($id);
+2 -14
View File
@@ -46,7 +46,7 @@ class VkWallService
public function createPost(string $message, int $from_group, string $attachments = '', int $publish_date)
public function createPost(string $message, int $from_group, string $attachments = '', int|null $publish_date = null)
{
$params = [
'owner_id' => '-' . $this->publicId,
@@ -79,7 +79,7 @@ class VkWallService
}
}
public function updatePost(int $post_id, string $message = '', int $from_group = 1, string $attachments = '', int $publish_date)
public function updatePost(int $post_id, string $message = '', int $from_group = 1, string $attachments = '', int|null $publish_date = null)
{
if (empty($message) && empty($attachments)) {
return [
@@ -89,18 +89,6 @@ class VkWallService
}
$params = [
'owner_id' => '-' . $this->publicId,
'post_id' => $post_id,
'message' => $message,
'attachments' => $attachments,
'access_token' => $this->wallToken,
'v' => '5.131',
];
try {
return $this->vk->wall()->edit(
$this->vkAuthService->getToken()->access_token,