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

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

Open jakublabno opened 2 years ago

jakublabno commented 2 years ago

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);
    }