Fix hints

This commit is contained in:
Daniil Gentili 2020-10-04 16:35:33 +02:00
parent d31b798df9
commit a21f8205e5
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
5 changed files with 10 additions and 12 deletions

View File

@ -58,7 +58,8 @@ class AnnotationsBuilder
$this->namespace = $namespace;
/** @psalm-suppress InvalidArgument */
$this->TL = new TL(new class($logger) {
public function __construct($logger)
public Logger $logger;
public function __construct(Logger $logger)
{
$this->logger = $logger;
}

View File

@ -15,7 +15,7 @@ interface DbArray extends DbType, \ArrayAccess, \Countable
/**
* Get Array copy.
*
* @psalm-return Promise<array{0: string|int, 1: T}> $value
* @psalm-return Promise<array<string|int, T>> $value
*
* @return Promise
*/

View File

@ -29,7 +29,10 @@ abstract class DriverArray implements DbArray
{
if (isset($this->settings) && \is_array($this->settings)) {
$clazz = (new ReflectionClass($this))->getProperty('dbSettings')->getType()->getName();
/** @var SettingsAbstract */
/**
* @var SettingsAbstract
* @psalm-suppress UndefinedThisPropertyAssignment
*/
$this->dbSettings = new $clazz;
$this->dbSettings->mergeArray($this->settings);
unset($this->settings);

View File

@ -24,7 +24,7 @@ class MemoryArray extends \ArrayIterator implements DbArray
* @param mixed $value
* @param string $tablePrefix
* @param Memory $settings
* @return Promise
* @return Promise<self>
*/
public static function getInstance(string $name, $value = null, string $tablePrefix = '', $settings): Promise
{

View File

@ -79,7 +79,7 @@ class MysqlArray extends SqlArray
*
* @link https://php.net/manual/en/arrayiterator.offsetset.php
*
* @param string $index <p>
* @param string|int $index <p>
* The index to set for.
* </p>
* @param $value
@ -118,7 +118,7 @@ class MysqlArray extends SqlArray
*
* @link https://php.net/manual/en/arrayiterator.offsetunset.php
*
* @param string $index <p>
* @param string|int $index <p>
* The offset to unset.
* </p>
*
@ -138,12 +138,6 @@ class MysqlArray extends SqlArray
);
}
/**
* Get array copy.
*
* @return Promise<array>
* @throws \Throwable
*/
public function getArrayCopy(): Promise
{
return call(function () {