Skip to content

Stricter response returns validated/checked #49

@dereuromark

Description

@dereuromark

In most code you see

public function myAction()
{
    $this->render('edit')
    ... // more code?
}

It silently passes all checks so far.

But in fact, this would in real code only execute until return render(), or one would expect it to.

We should assert people always use

public function myAction()
{
    return $this->render('edit')
    ... // more code? this would now be failing in phpstan automatically
}

So a render() call without a return before should probably fail.
Can we do this a custom phpstan rule? or should this go somewhere else?

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