Skip to content

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

Merged
lisachenko merged 1 commit into
goaop:3.xfrom
jakublabno:patch-1
Feb 7, 2024
Merged

[FIX] Library generates non-nullable return type for nullable return …#484
lisachenko merged 1 commit into
goaop:3.xfrom
jakublabno:patch-1

Conversation

@jakublabno

@jakublabno jakublabno commented Apr 19, 2022

Copy link
Copy Markdown
Contributor

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

…methods

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

Copy link
Copy Markdown

A new inspection was created.

@jakublabno
jakublabno marked this pull request as ready for review April 19, 2022 14:25
@lisachenko
lisachenko changed the base branch from master to 3.x February 7, 2024 08:59
@lisachenko
lisachenko merged commit b10821b into goaop:3.x Feb 7, 2024
@lisachenko lisachenko added this to the 3.0.1 milestone Feb 7, 2024
@lisachenko

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants