mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 06:18:58 +01:00
Psalm fix
This commit is contained in:
parent
7f0dd3bfb3
commit
bd4643fa97
@ -282,13 +282,6 @@
|
||||
<MissingConstructor>
|
||||
<code>$pdo</code>
|
||||
</MissingConstructor>
|
||||
<PossiblyNullArrayAccess>
|
||||
<code><![CDATA[$this->db->query("SELECT data_free FROM information_schema.tables WHERE table_schema=`{$database}` AND table_name=`{$this->table}`")->fetchRow()['data_free']]]></code>
|
||||
</PossiblyNullArrayAccess>
|
||||
<UndefinedMethod>
|
||||
<code>getOptimizeIfWastedGtMb</code>
|
||||
<code>getOptimizeIfWastedGtMb</code>
|
||||
</UndefinedMethod>
|
||||
</file>
|
||||
<file src="src/Db/PostgresArray.php">
|
||||
<MissingClosureParamType>
|
||||
@ -487,6 +480,11 @@
|
||||
<code>$peersResolved</code>
|
||||
</PropertyNotSetInConstructor>
|
||||
</file>
|
||||
<file src="src/EventHandler/Filter/FilterForwardedFrom.php">
|
||||
<PropertyNotSetInConstructor>
|
||||
<code>$peerResolved</code>
|
||||
</PropertyNotSetInConstructor>
|
||||
</file>
|
||||
<file src="src/EventHandler/Filter/FilterFromAdmin.php">
|
||||
<MissingConstructor>
|
||||
<code>$adminIds</code>
|
||||
@ -648,12 +646,15 @@
|
||||
<file src="src/EventHandler/Message.php">
|
||||
<LessSpecificReturnStatement>
|
||||
<code><![CDATA[$this->getClient()->wrapMessage($this->getClient()->extractMessage($result))]]></code>
|
||||
<code><![CDATA[$this->getClient()->wrapMessage($this->getClient()->extractMessage($result))]]></code>
|
||||
</LessSpecificReturnStatement>
|
||||
<MoreSpecificReturnType>
|
||||
<code>Message</code>
|
||||
<code>Message</code>
|
||||
</MoreSpecificReturnType>
|
||||
<NullableReturnStatement>
|
||||
<code><![CDATA[$this->getClient()->wrapMessage($this->getClient()->extractMessage($result))]]></code>
|
||||
<code><![CDATA[$this->getClient()->wrapMessage($this->getClient()->extractMessage($result))]]></code>
|
||||
</NullableReturnStatement>
|
||||
<PropertyNotSetInConstructor>
|
||||
<code>$html</code>
|
||||
@ -737,6 +738,12 @@
|
||||
<code><![CDATA[$API->getIdInternal($rawPinned)]]></code>
|
||||
</PossiblyNullPropertyAssignmentValue>
|
||||
</file>
|
||||
<file src="src/EventHandler/Poll/QuizPoll.php">
|
||||
<PropertyNotSetInConstructor>
|
||||
<code>$html</code>
|
||||
<code>$htmlTelegram</code>
|
||||
</PropertyNotSetInConstructor>
|
||||
</file>
|
||||
<file src="src/EventHandler/Privacy.php">
|
||||
<PropertyTypeCoercion>
|
||||
<code><![CDATA[array_map(RuleDestination::fromRawRule(...), $rawPrivacy['rules'])]]></code>
|
||||
@ -745,6 +752,7 @@
|
||||
<file src="src/EventHandler/Query/ChatTrait.php">
|
||||
<MoreSpecificReturnType>
|
||||
<code>Message</code>
|
||||
<code>Message</code>
|
||||
</MoreSpecificReturnType>
|
||||
<PossiblyNullPropertyAssignmentValue>
|
||||
<code><![CDATA[$API->getIdInternal($rawCallback['peer'])]]></code>
|
||||
@ -1710,7 +1718,6 @@
|
||||
</MissingReturnType>
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$this->getIdInternal($message['action']['from_id'])]]></code>
|
||||
<code><![CDATA[$this->getIdInternal($message['action']['peer'])]]></code>
|
||||
<code><![CDATA[$this->getIdInternal($message['action']['to_id'])]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullArrayAccess>
|
||||
@ -2207,7 +2214,6 @@
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullReference>
|
||||
<code>botAPIToMTProto</code>
|
||||
<code>logger</code>
|
||||
</PossiblyNullReference>
|
||||
<PossiblyUndefinedArrayOffset>
|
||||
<code>$elem[1]</code>
|
||||
@ -2256,10 +2262,6 @@
|
||||
</PossiblyNullArrayAccess>
|
||||
</file>
|
||||
<file src="src/Tools.php">
|
||||
<ArgumentTypeCoercion>
|
||||
<code><![CDATA[static fn (ClassLike $c): bool => $c->name !== null]]></code>
|
||||
<code><![CDATA[static fn (ClassLike $c): bool => $c->name !== null]]></code>
|
||||
</ArgumentTypeCoercion>
|
||||
<MissingClosureParamType>
|
||||
<code>$val</code>
|
||||
</MissingClosureParamType>
|
||||
@ -2429,9 +2431,6 @@
|
||||
<code><![CDATA[$this->authorization['phone_number']]]></code>
|
||||
<code><![CDATA[$this->authorization['phone_number']]]></code>
|
||||
</PossiblyNullArrayAccess>
|
||||
<PossiblyUndefinedVariable>
|
||||
<code>$datacenter</code>
|
||||
</PossiblyUndefinedVariable>
|
||||
<RedundantConditionGivenDocblockType>
|
||||
<code>\is_array($auth_key)</code>
|
||||
</RedundantConditionGivenDocblockType>
|
||||
|
@ -47,8 +47,11 @@ final class QuizPoll extends AbstractPoll
|
||||
*
|
||||
* @param bool $allowTelegramTags Whether to allow telegram-specific tags like tg-spoiler, tg-emoji, mention links and so on...
|
||||
*/
|
||||
public function getHTML(bool $allowTelegramTags = false): string
|
||||
public function getHTML(bool $allowTelegramTags = false): ?string
|
||||
{
|
||||
if ($this->solution === null) {
|
||||
return null;
|
||||
}
|
||||
if (!$this->entities) {
|
||||
return StrTools::htmlEscape($this->solution);
|
||||
}
|
||||
|
@ -242,6 +242,7 @@ final class PeerDatabase implements TLCallback
|
||||
$id = $content;
|
||||
}
|
||||
}
|
||||
if (\is_string($id)) {
|
||||
$id = strtolower(str_replace('@', '', $id));
|
||||
if ($id === 'me') {
|
||||
$id = $this->API->authorization['user']['id'];
|
||||
@ -254,6 +255,7 @@ final class PeerDatabase implements TLCallback
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($this->fullDb[$this->API->getIdInternal($id)]);
|
||||
$this->API->getFullInfo($id);
|
||||
}
|
||||
|
@ -457,6 +457,7 @@ trait PeerHandler
|
||||
$id = $content;
|
||||
}
|
||||
}
|
||||
if (\is_string($id)) {
|
||||
$id = strtolower(str_replace('@', '', $id));
|
||||
if ($id === 'me') {
|
||||
return $this->getInfo($this->authorization['user']['id'], $type);
|
||||
@ -473,6 +474,9 @@ trait PeerHandler
|
||||
if ($bot_api_id = $this->peerDatabase->resolveUsername($id)) {
|
||||
return $this->getInfo($bot_api_id, $type);
|
||||
}
|
||||
} else {
|
||||
return $this->getInfo($id, $type);
|
||||
}
|
||||
if ($this->cacheFullDialogs()) {
|
||||
return $this->getInfo($id, $type);
|
||||
}
|
||||
@ -602,6 +606,7 @@ trait PeerHandler
|
||||
$id = $content;
|
||||
}
|
||||
}
|
||||
if (\is_string($id)) {
|
||||
$id = strtolower(str_replace('@', '', $id));
|
||||
if ($id === 'me') {
|
||||
$id = $this->authorization['user']['id'];
|
||||
@ -615,6 +620,7 @@ trait PeerHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$id = $this->getIdInternal($id);
|
||||
Assert::notNull($id);
|
||||
switch (DialogId::getType($id)) {
|
||||
|
Loading…
Reference in New Issue
Block a user