Skip to content

earlyTerminatingMethodCalls does not work for indirect calls over method which may return NULL #4

@JanTvrdik

Description

@JanTvrdik

With the following configuration:

parameters:
    earlyTerminatingMethodCalls:
        Nette\Application\UI\Presenter:
            - redirect
            - redirectUrl
            - sendJson
            - sendResponse

The following code works inside presenters but not inside controls because getPresenter() may return NULL inside controls and not in presenters.

    public function test()
    {
        if (rand() === 0) {
            $foo = 13;
        } else {
            $this->getPresenter()->redirect('Homepage:default');
        }

        echo $foo;
    }

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