Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
madmages committed May 15, 2021
1 parent 81e6234 commit 75bb0b1
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 68 deletions.
52 changes: 26 additions & 26 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getUpdates(
* @param string $url
* HTTPS url to send updates to. Use an empty string to remove webhook integration
*
* @param Type\AbstractInputFile|null $certificate
* @param Type\InputFile|null $certificate
* Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide
* for details.
*
Expand All @@ -96,7 +96,7 @@ public function getUpdates(
*/
public function setWebhook(
string $url,
Type\AbstractInputFile $certificate = null,
Type\InputFile $certificate = null,
string $ipAddress = null,
int $maxConnections = null,
array $allowedUpdates = null,
Expand Down Expand Up @@ -385,7 +385,7 @@ public function copyMessage(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $photo
* @param Type\InputFile|string $photo
* Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an
* HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data.
* The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height
Expand Down Expand Up @@ -452,7 +452,7 @@ public function sendPhoto(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $audio
* @param Type\InputFile|string $audio
* Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers
* (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using
* multipart/form-data. More info on Sending Files »
Expand All @@ -475,7 +475,7 @@ public function sendPhoto(
* @param string|null $title
* Track name
*
* @param Type\AbstractInputFile|string|null $thumb
* @param Type\InputFile|string|null $thumb
* Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The
* thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320.
* Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a
Expand Down Expand Up @@ -541,12 +541,12 @@ public function sendAudio(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $document
* @param Type\InputFile|string $document
* File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an
* HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More
* info on Sending Files »
*
* @param Type\AbstractInputFile|string|null $thumb
* @param Type\InputFile|string|null $thumb
* Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The
* thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320.
* Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a
Expand Down Expand Up @@ -621,7 +621,7 @@ public function sendDocument(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $video
* @param Type\InputFile|string $video
* Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an
* HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data.
* More info on Sending Files »
Expand All @@ -635,7 +635,7 @@ public function sendDocument(
* @param int|null $height
* Video height
*
* @param Type\AbstractInputFile|string|null $thumb
* @param Type\InputFile|string|null $thumb
* Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The
* thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320.
* Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a
Expand Down Expand Up @@ -714,7 +714,7 @@ public function sendVideo(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $animation
* @param Type\InputFile|string $animation
* Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers
* (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using
* multipart/form-data. More info on Sending Files »
Expand All @@ -728,7 +728,7 @@ public function sendVideo(
* @param int|null $height
* Animation height
*
* @param Type\AbstractInputFile|string|null $thumb
* @param Type\InputFile|string|null $thumb
* Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The
* thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320.
* Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a
Expand Down Expand Up @@ -806,7 +806,7 @@ public function sendAnimation(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $voice
* @param Type\InputFile|string $voice
* Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended),
* pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using
* multipart/form-data. More info on Sending Files »
Expand Down Expand Up @@ -876,7 +876,7 @@ public function sendVoice(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $videoNote
* @param Type\InputFile|string $videoNote
* Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers
* (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is
* currently unsupported
Expand All @@ -887,7 +887,7 @@ public function sendVoice(
* @param int|null $length
* Video width and height, i.e. diameter of the video message
*
* @param Type\AbstractInputFile|string|null $thumb
* @param Type\InputFile|string|null $thumb
* Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The
* thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320.
* Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a
Expand Down Expand Up @@ -1938,14 +1938,14 @@ public function revokeChatInviteLink(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile $photo
* @param Type\InputFile $photo
* New chat photo, uploaded using multipart/form-data
*
* @return mixed
*/
public function setChatPhoto(
$chatId,
Type\AbstractInputFile $photo
Type\InputFile $photo
)
{
$requestParameters = [
Expand Down Expand Up @@ -2638,7 +2638,7 @@ public function deleteMessage(
* @param int|string $chatId
* Unique identifier for the target chat or username of the target channel (in the format @|channelusername)
*
* @param Type\AbstractInputFile|string $sticker
* @param Type\InputFile|string $sticker
* Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass
* an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using
* multipart/form-data. More info on Sending Files »
Expand Down Expand Up @@ -2709,15 +2709,15 @@ public function getStickerSet(
* @param int $userId
* User identifier of sticker file owner
*
* @param Type\AbstractInputFile $pngSticker
* @param Type\InputFile $pngSticker
* PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either
* width or height must be exactly 512px. More info on Sending Files »
*
* @return mixed
*/
public function uploadStickerFile(
int $userId,
Type\AbstractInputFile $pngSticker
Type\InputFile $pngSticker
)
{
$requestParameters = [
Expand Down Expand Up @@ -2748,13 +2748,13 @@ public function uploadStickerFile(
* @param string $emojis
* One or more emoji corresponding to the sticker
*
* @param Type\AbstractInputFile|string|null $pngSticker
* @param Type\InputFile|string|null $pngSticker
* PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either
* width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram
* servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using
* multipart/form-data. More info on Sending Files »
*
* @param Type\AbstractInputFile|null $tgsSticker
* @param Type\InputFile|null $tgsSticker
* TGS animation with the sticker, uploaded using multipart/form-data. See
* https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
*
Expand All @@ -2772,7 +2772,7 @@ public function createNewStickerSet(
string $title,
string $emojis,
$pngSticker = null,
Type\AbstractInputFile $tgsSticker = null,
Type\InputFile $tgsSticker = null,
bool $containsMasks = null,
Type\MaskPosition $maskPosition = null
)
Expand Down Expand Up @@ -2808,13 +2808,13 @@ public function createNewStickerSet(
* @param string $emojis
* One or more emoji corresponding to the sticker
*
* @param Type\AbstractInputFile|string|null $pngSticker
* @param Type\InputFile|string|null $pngSticker
* PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either
* width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram
* servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using
* multipart/form-data. More info on Sending Files »
*
* @param Type\AbstractInputFile|null $tgsSticker
* @param Type\InputFile|null $tgsSticker
* TGS animation with the sticker, uploaded using multipart/form-data. See
* https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
*
Expand All @@ -2828,7 +2828,7 @@ public function addStickerToSet(
string $name,
string $emojis,
$pngSticker = null,
Type\AbstractInputFile $tgsSticker = null,
Type\InputFile $tgsSticker = null,
Type\MaskPosition $maskPosition = null
)
{
Expand Down Expand Up @@ -2903,7 +2903,7 @@ public function deleteStickerFromSet(
* @param int $userId
* User identifier of the sticker set owner
*
* @param Type\AbstractInputFile|string|null $thumb
* @param Type\InputFile|string|null $thumb
* A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS
* animation with the thumbnail up to 32 kilobytes in size; see
* https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. Pass a file_id as a String to send a file that already exists on the
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Serializer
{

private static SerializerInterface $serializer;
private static ?SerializerInterface $serializer = null;

public static function deserialize(string $jsonString, string $type)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Type/AbstractInputFile.php → src/Type/InputFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MadmagesTelegram\Types\Type;

class AbstractInputFile
class InputFile
{

/** @var resource|string */
Expand Down
6 changes: 3 additions & 3 deletions src/Type/InputMediaAnimation.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function _getData(): array
* file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data
* under . More info on Sending Files »
*
* @var AbstractInputFile|string|null
* @var InputFile|string|null
* @SkipWhenEmpty
* @SerializedName("thumb")
* @Accessor(getter="getThumb",setter="setThumb")
Expand Down Expand Up @@ -205,7 +205,7 @@ public function getMedia(): string
}

/**
* @param AbstractInputFile|string $thumb
* @param InputFile|string $thumb
* @return static
*/
public function setThumb( $thumb): self
Expand All @@ -216,7 +216,7 @@ public function setThumb( $thumb): self
}

/**
* @return AbstractInputFile|string|null
* @return InputFile|string|null
*/
public function getThumb()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Type/InputMediaAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function _getData(): array
* file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data
* under . More info on Sending Files »
*
* @var AbstractInputFile|string|null
* @var InputFile|string|null
* @SkipWhenEmpty
* @SerializedName("thumb")
* @Accessor(getter="getThumb",setter="setThumb")
Expand Down Expand Up @@ -205,7 +205,7 @@ public function getMedia(): string
}

/**
* @param AbstractInputFile|string $thumb
* @param InputFile|string $thumb
* @return static
*/
public function setThumb( $thumb): self
Expand All @@ -216,7 +216,7 @@ public function setThumb( $thumb): self
}

/**
* @return AbstractInputFile|string|null
* @return InputFile|string|null
*/
public function getThumb()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Type/InputMediaDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function _getData(): array
* file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data
* under . More info on Sending Files »
*
* @var AbstractInputFile|string|null
* @var InputFile|string|null
* @SkipWhenEmpty
* @SerializedName("thumb")
* @Accessor(getter="getThumb",setter="setThumb")
Expand Down Expand Up @@ -180,7 +180,7 @@ public function getMedia(): string
}

/**
* @param AbstractInputFile|string $thumb
* @param InputFile|string $thumb
* @return static
*/
public function setThumb( $thumb): self
Expand All @@ -191,7 +191,7 @@ public function setThumb( $thumb): self
}

/**
* @return AbstractInputFile|string|null
* @return InputFile|string|null
*/
public function getThumb()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Type/InputMediaVideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function _getData(): array
* file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data
* under . More info on Sending Files »
*
* @var AbstractInputFile|string|null
* @var InputFile|string|null
* @SkipWhenEmpty
* @SerializedName("thumb")
* @Accessor(getter="getThumb",setter="setThumb")
Expand Down Expand Up @@ -218,7 +218,7 @@ public function getMedia(): string
}

/**
* @param AbstractInputFile|string $thumb
* @param InputFile|string $thumb
* @return static
*/
public function setThumb( $thumb): self
Expand All @@ -229,7 +229,7 @@ public function setThumb( $thumb): self
}

/**
* @return AbstractInputFile|string|null
* @return InputFile|string|null
*/
public function getThumb()
{
Expand Down
Loading

0 comments on commit 75bb0b1

Please sign in to comment.