goaop / framework

:gem: Go! AOP PHP - modern aspect-oriented framework for the new level of software development
go.aopphp.com
MIT License
1.66k stars 163 forks source link

[FIX] Library generates non-nullable return type for nullable return … #484

Closed jakublabno closed 7 months ago

jakublabno commented 2 years ago

Library generates non-nullable return type for nullable return methods #482 Library version 3.0.0

For below method proxy is generating non-null return

/**
     * @AopAnnotation()
     * @return null|int
     */
    public function getSomeRandomValueAllowOnNull(): ?int
    {
        return random_int(0, 666);
    }

result:

/**
     * @AopAnnotation()
     * @return null|int
     */
    public function getSomeRandomValueAllowOnNull() : int
    {
        return self::$__joinPoints['method:getSomeRandomValueAllowOnNull']->__invoke($this);
    }
scrutinizer-notifier commented 2 years ago

A new inspection was created.

lisachenko commented 7 months ago

Thanks!