for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace unreal4u\TelegramAPI\Telegram\Types\Custom;
use unreal4u\TelegramAPI\Exceptions\FileNotReadable;
/**
* This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual
* way that files are uploaded via the browser.
*
* @see https://core.telegram.org/bots/api#inputfile
*/
class InputFile
{
* The path of the file
* @var string
public $path = '';
* The actual stream to the file
* @var int
private $stream = null;
public function __construct(string $path)
$this->path = $path;
$this->setStream();
}
* Will setup the stream
* @return InputFile
private function setStream(): InputFile
if (is_readable($this->path)) {
$this->stream = fopen($this->path, 'r');
fopen($this->path, 'r')
resource
integer
$stream
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
} else {
throw new FileNotReadable(sprintf('Can not read %s, please check', $this->path));
return $this;
public function getStream()
return $this->stream;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..