Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -8896,7 +8896,7 @@
'RedisCluster::mget' => ['array', 'array'=>'array'],
'RedisCluster::mset' => ['bool', 'array'=>'array'],
'RedisCluster::msetnx' => ['int', 'array'=>'array'],
'RedisCluster::multi' => ['Redis', 'mode='=>'int'],
'RedisCluster::multi' => ['__benevolent<RedisCluster|bool>', 'mode='=>'int'],
'RedisCluster::object' => ['string', 'string='=>'string', 'key='=>'string'],
'RedisCluster::persist' => ['bool', 'key'=>'string'],
'RedisCluster::pExpire' => ['bool', 'key'=>'string', 'ttl'=>'int'],
Expand Down
6 changes: 6 additions & 0 deletions tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,12 @@ public function testBug13310(): void
$this->assertNoErrors($errors);
}

public function testBug13392(): void
{
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-13392.php');
$this->assertNoErrors($errors);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to have this here. The file will be picked up automatically by NodeScopeResolverTest.

}

/**
* @param string[]|null $allAnalysedFiles
* @return Error[]
Expand Down
21 changes: 21 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-13392.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php declare(strict_types = 1);

namespace Bug13392;

use RedisCluster;

use function PHPStan\Testing\assertType;

interface Client
{
public function get(): RedisCluster;
}

function func(Client $client): void
{
$redisCluster = $client->get();
assertType('RedisCluster',$redisCluster);

$transaction = $redisCluster->multi();
assertType('(bool|RedisCluster)',$transaction);
}
Loading