phpstan-phpunit icon indicating copy to clipboard operation
phpstan-phpunit copied to clipboard

Can't convince phpstan about existing offset

Open ostrolucky opened this issue 6 years ago • 1 comments

self::assertArrayHasKey(1, $ubos);
self::assertFalse($ubos[1]->isActive);

produces

Offset 1 does not exist on array(MangoPay\Ubo).

related class: https://github.com/Mangopay/mangopay2-php-sdk/blob/d967b3fb6f45a0f01891134062265144950c9259/MangoPay/UboDeclaration.php

ostrolucky avatar Nov 14 '19 14:11 ostrolucky

As a workaround you can use

$this->assertTrue(array_key_exists('query', $urlParts));

ntzm avatar Dec 19 '19 14:12 ntzm