Skip to content

Commit

Permalink
Update types
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha kalin committed May 10, 2023
1 parent b336c3f commit b546926
Show file tree
Hide file tree
Showing 48 changed files with 4,956 additions and 1,334 deletions.
1,304 changes: 866 additions & 438 deletions src/Client.php

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/Type/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function _getPropertyNames(): array
'width',
'height',
'duration',
'thumb',
'thumbnail',
'file_name',
'mime_type',
'file_size',
Expand All @@ -53,7 +53,7 @@ public function _getData(): array
'width' => $this->getWidth(),
'height' => $this->getHeight(),
'duration' => $this->getDuration(),
'thumb' => $this->getThumb(),
'thumbnail' => $this->getThumbnail(),
'file_name' => $this->getFileName(),
'mime_type' => $this->getMimeType(),
'file_size' => $this->getFileSize(),
Expand Down Expand Up @@ -118,11 +118,11 @@ public function _getData(): array
*
* @var PhotoSize|null
* @SkipWhenEmpty
* @SerializedName("thumb")
* @Accessor(getter="getThumb", setter="setThumb")
* @SerializedName("thumbnail")
* @Accessor(getter="getThumbnail", setter="setThumbnail")
* @Type("MadmagesTelegram\Types\Type\PhotoSize")
*/
protected $thumb;
protected $thumbnail;

/**
* Optional. Original animation filename as defined by sender
Expand Down Expand Up @@ -256,22 +256,22 @@ public function getDuration(): int
}

/**
* @param PhotoSize $thumb
* @param PhotoSize $thumbnail
* @return static
*/
public function setThumb(PhotoSize $thumb): self
public function setThumbnail(PhotoSize $thumbnail): self
{
$this->thumb = $thumb;
$this->thumbnail = $thumbnail;

return $this;
}

/**
* @return PhotoSize|null
*/
public function getThumb(): ?PhotoSize
public function getThumbnail(): ?PhotoSize
{
return $this->thumb;
return $this->thumbnail;
}

/**
Expand Down
20 changes: 10 additions & 10 deletions src/Type/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function _getPropertyNames(): array
'file_name',
'mime_type',
'file_size',
'thumb',
'thumbnail',
];
}

Expand All @@ -56,7 +56,7 @@ public function _getData(): array
'file_name' => $this->getFileName(),
'mime_type' => $this->getMimeType(),
'file_size' => $this->getFileSize(),
'thumb' => $this->getThumb(),
'thumbnail' => $this->getThumbnail(),
];

return parent::normalizeData($result);
Expand Down Expand Up @@ -155,11 +155,11 @@ public function _getData(): array
*
* @var PhotoSize|null
* @SkipWhenEmpty
* @SerializedName("thumb")
* @Accessor(getter="getThumb", setter="setThumb")
* @SerializedName("thumbnail")
* @Accessor(getter="getThumbnail", setter="setThumbnail")
* @Type("MadmagesTelegram\Types\Type\PhotoSize")
*/
protected $thumb;
protected $thumbnail;


/**
Expand Down Expand Up @@ -315,22 +315,22 @@ public function getFileSize(): ?int
}

/**
* @param PhotoSize $thumb
* @param PhotoSize $thumbnail
* @return static
*/
public function setThumb(PhotoSize $thumb): self
public function setThumbnail(PhotoSize $thumbnail): self
{
$this->thumb = $thumb;
$this->thumbnail = $thumbnail;

return $this;
}

/**
* @return PhotoSize|null
*/
public function getThumb(): ?PhotoSize
public function getThumbnail(): ?PhotoSize
{
return $this->thumb;
return $this->thumbnail;
}

}
79 changes: 79 additions & 0 deletions src/Type/BotDescription.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\AccessType;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;

/**
* https://core.telegram.org/bots/api#botdescription
*
* This object represents the bot's description.
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
*/
class BotDescription extends AbstractType
{

/**
* Returns raw names of properties of this type
*
* @return string[]
*/
public static function _getPropertyNames(): array
{
return [
'description',
];
}

/**
* Returns associative array of raw data
*
* @return array
*/
public function _getData(): array
{
$result = [
'description' => $this->getDescription(),
];

return parent::normalizeData($result);
}

/**
* The bot's description
*
* @var string
* @SerializedName("description")
* @Accessor(getter="getDescription", setter="setDescription")
* @Type("string")
*/
protected $description;


/**
* @param string $description
* @return static
*/
public function setDescription(string $description): self
{
$this->description = $description;

return $this;
}

/**
* @return string
*/
public function getDescription(): string
{
return $this->description;
}

}
79 changes: 79 additions & 0 deletions src/Type/BotName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\AccessType;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;

/**
* https://core.telegram.org/bots/api#botname
*
* This object represents the bot's name.
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
*/
class BotName extends AbstractType
{

/**
* Returns raw names of properties of this type
*
* @return string[]
*/
public static function _getPropertyNames(): array
{
return [
'name',
];
}

/**
* Returns associative array of raw data
*
* @return array
*/
public function _getData(): array
{
$result = [
'name' => $this->getName(),
];

return parent::normalizeData($result);
}

/**
* The bot's name
*
* @var string
* @SerializedName("name")
* @Accessor(getter="getName", setter="setName")
* @Type("string")
*/
protected $name;


/**
* @param string $name
* @return static
*/
public function setName(string $name): self
{
$this->name = $name;

return $this;
}

/**
* @return string
*/
public function getName(): string
{
return $this->name;
}

}
79 changes: 79 additions & 0 deletions src/Type/BotShortDescription.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\AccessType;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;

/**
* https://core.telegram.org/bots/api#botshortdescription
*
* This object represents the bot's short description.
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
*/
class BotShortDescription extends AbstractType
{

/**
* Returns raw names of properties of this type
*
* @return string[]
*/
public static function _getPropertyNames(): array
{
return [
'short_description',
];
}

/**
* Returns associative array of raw data
*
* @return array
*/
public function _getData(): array
{
$result = [
'short_description' => $this->getShortDescription(),
];

return parent::normalizeData($result);
}

/**
* The bot's short description
*
* @var string
* @SerializedName("short_description")
* @Accessor(getter="getShortDescription", setter="setShortDescription")
* @Type("string")
*/
protected $shortDescription;


/**
* @param string $shortDescription
* @return static
*/
public function setShortDescription(string $shortDescription): self
{
$this->shortDescription = $shortDescription;

return $this;
}

/**
* @return string
*/
public function getShortDescription(): string
{
return $this->shortDescription;
}

}
Loading

0 comments on commit b546926

Please sign in to comment.