Skip to content

Commit

Permalink
add legacy params
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateodioev committed Apr 22, 2023
1 parent b34a974 commit ba82646
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/Types/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @property integer $width Video width as defined by sender.
* @property integer $height Video height as defined by sender.
* @property integer $duration Duration of the video in seconds as defined by sender
* @property PhotoSize $thumb Optional. Animation thumbnail as defined by sender
* @property PhotoSize $thumbnail Optional. Animation thumbnail as defined by sender
* @property string $file_name Optional. Original animation filename as defined by sender
* @property string $mime_type Optional. MIME type of the file as defined by sender
* @property integer $file_size Optional. File size in bytes.
Expand All @@ -20,7 +20,7 @@
* @method integer width() Video width
* @method integer height() Video height
* @method integer duration() Duration of the video in seconds
* @method ?PhotoSize thumb() Animation thumbnail
* @method ?PhotoSize thumbnail() Animation thumbnail
* @method ?string fileName() Original animation filename
* @method ?string mimeType() MIME type of the file
* @method ?integer fileSize() File size in bytes
Expand All @@ -30,7 +30,7 @@
* @method static setWidth(int $width)
* @method static setHeight(int $height)
* @method static setDuration(int $duration)
* @method static setThumb(PhotoSize $thumb)
* @method static setThumbnail(PhotoSize $thumbnail)
* @method static setFileName(string $fileName)
* @method static setMimeType(string $mimeType)
* @method static setFileSize(string $fileSize)
Expand All @@ -45,7 +45,8 @@ class Animation extends baseType
'width' => 'integer',
'height' => 'integer',
'duration' => 'integer',
'thumb' => PhotoSize::class,
'thumbnail' => PhotoSize::class,
'thumb' => PhotoSize::class, // Legacy param
'file_name' => 'string',
'mime_type' => 'string',
'file_size' => 'integer'
Expand Down
3 changes: 2 additions & 1 deletion src/Types/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Audio extends baseType
'file_name' => 'string',
'mime_type' => 'string',
'file_size' => 'integer',
'thumbnail' => PhotoSize::class
'thumbnail' => PhotoSize::class,
'thumb' => PhotoSize::class, // Legacy param
];
}

1 change: 1 addition & 0 deletions src/Types/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Document extends baseType
'file_id' => 'string',
'file_unique_id' => 'string',
'thumbnail' => PhotoSize::class,
'thumb' => PhotoSize::class, // Legacy param
'file_name' => 'string',
'mime_type' => 'string',
'file_size' => 'integer',
Expand Down
1 change: 1 addition & 0 deletions src/Types/InputMediaAnimation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class InputMediaAnimation extends InputMedia
'type' => 'string',
'media' => 'string',
'thumbnail' => 'mixed',
'thumb' => 'mixed', // Legacy param
'caption' => 'string',
'parse_mode' => 'string',
'caption_entities' => [MessageEntity::class],
Expand Down
1 change: 1 addition & 0 deletions src/Types/InputMediaAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class InputMediaAudio extends InputMedia
'type' => 'string',
'media' => 'string',
'thumbnail' => 'mixed',
'thumb' => 'mixed', // Legacy param
'caption' => 'string',
'parse_mode' => 'string',
'caption_entities' => [MessageEntity::class],
Expand Down
1 change: 1 addition & 0 deletions src/Types/InputMediaDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class InputMediaDocument extends InputMedia
'type' => 'string',
'media' => 'string',
'thumbnail' => 'mixed',
'thumb' => 'mixed', // Legacy param
'caption' => 'string',
'parse_mode' => 'string',
'caption_entities' => [MessageEntity::class],
Expand Down
1 change: 1 addition & 0 deletions src/Types/InputMediaVideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class InputMediaVideo extends InputMedia
'type' => 'string',
'media' => 'string',
'thumbnail' => 'mixed',
'thumb' => 'mixed', // Legacy param
'caption' => 'string',
'parse_mode' => 'string',
'caption_entities' => [MessageEntity::class],
Expand Down
1 change: 1 addition & 0 deletions src/Types/Sticker.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Sticker extends baseType
'is_animated' => 'boolean',
'is_video' => 'boolean',
'thumbnail' => PhotoSize::class,
'thumb' => PhotoSize::class, // Legacy param
'emoji' => 'string',
'set_name' => 'string',
'premium_animation' => File::class,
Expand Down
1 change: 1 addition & 0 deletions src/Types/StickerSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class StickerSet extends baseType
'is_video' => 'boolean',
'stickers' => [Sticker::class],
'thumbnail' => PhotoSize::class,
'thumb' => PhotoSize::class, // Legacy param
];

public function get()
Expand Down
1 change: 1 addition & 0 deletions src/Types/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Video extends baseType
'height' => 'integer',
'duration' => 'integer',
'thumbnail' => PhotoSize::class,
'thumb' => PhotoSize::class, // Legacy param
'file_name' => 'string',
'mime_type' => 'string',
'file_size' => 'integer',
Expand Down
1 change: 1 addition & 0 deletions src/Types/VideoNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class VideoNote extends baseType
'length' => 'integer',
'duration' => 'integer',
'thumbnail' => PhotoSize::class,
'thumb' => PhotoSize::class, // Legacy param
'file_size' => 'integer',
];
}

0 comments on commit ba82646

Please sign in to comment.