Skip to content

wrong return type for DateIntervall::createFromDateString() #8442

@verfriemelt-dot-org

Description

@verfriemelt-dot-org

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/aa01ffb9-8f5c-4af3-a296-a17ce6290f9d

Expected output

$ php8.1 --rf DateInterval::createFromDateString
Method [ <internal:date> static public method createFromDateString ] {

  - Parameters [1] {
    Parameter #0 [ <required> string $datetime ]
  }
  - Tentative return [ DateInterval|false ]
}

should be DateInterval|false. its wrong here: https://github.com/phpstan/phpstan-src/blob/1.9.x/resources/functionMap.php#L1586

do we need to fix this upstream in phan/phan?

Did PHPStan help you today? Did it make you happy in any way?

🎉

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions