Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No warning or error when returning invalid response. #1991

Open
ruudboon opened this issue Oct 31, 2019 · 1 comment · May be fixed by #2196
Open

No warning or error when returning invalid response. #1991

ruudboon opened this issue Oct 31, 2019 · 1 comment · May be fixed by #2196
Labels

Comments

@ruudboon
Copy link
Contributor

See below simplified Router class.

namespace Phalcon\Mvc;

class Router
{
    protected action = null;
    
    /**
     * Returns the processed action name
     */
    public function getActionName() -> string
    {
        return this->action;
    }
}

This class will return null when getActionName() is called even when our return type specifies it as a string. I'm expecting a Fatal error: Uncaught TypeError.
It would be nice if our static code analyser / compiler would detect that our member variable is incompatible.

@Jeckerson Jeckerson added bug and removed not tested labels Feb 2, 2021
@Jeckerson Jeckerson added this to the 0.13.x milestone Mar 31, 2021
Jeckerson added a commit that referenced this issue Apr 6, 2021
@Jeckerson Jeckerson linked a pull request Apr 6, 2021 that will close this issue
3 tasks
@Jeckerson Jeckerson linked a pull request Apr 6, 2021 that will close this issue
3 tasks
@Jeckerson Jeckerson modified the milestones: 0.13.x, 0.14.x Sep 12, 2021
@Jeckerson Jeckerson modified the milestones: 0.14.x, Backlog Oct 3, 2021
@Jeckerson Jeckerson removed this from the Backlog milestone Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants