Skip to content

Can't convince phpstan about existing offset #53

Closed

Description

@ostrolucky
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

Activity

  1. ntzm commented on Dec 19, 2019

    @ntzm

    As a workaround you can use

    $this->assertTrue(array_key_exists('query', $urlParts));
  2. VincentLanglet commented on Nov 1, 2025

    @VincentLanglet
    Contributor

    I assume you also fixed this with phpstan/phpstan-src#4473 @staabm ?

  3. staabm commented on Nov 2, 2025

    @staabm
    Contributor

    @VincentLanglet yes I think so. as this issue does not has a full reproducer we can't say for sure.

    @ostrolucky could you please check whether phpstan-phpunit 2.0.8 in combination with phpstan 2.1.32 still reproduce this problem for you?

  4. ostrolucky commented on Nov 3, 2025

    @ostrolucky
    Author

    I can't do it unfortunately since it's a project I no longer has access to. But let's assume it has been fixed, I'll close the issue.

  5. github-actions commented on Dec 5, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  6. locked as resolved and limited conversation to collaborators on Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions