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

[BUG]: Incorrect return type of Phalcon\Mvc\Model\Query::getExpression #15553

Closed
StudioMaX opened this issue Jun 24, 2021 · 1 comment
Closed
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: medium Medium

Comments

@StudioMaX
Copy link
Contributor

Describe the bug
While trying to analyze one bug related to Model\Query, I noticed strange behavior of the getExpression method. It has string as its return type.

final protected function getExpression(array expr, bool quoting = true) -> string

But actually it always returns an array.
case PHQL_T_SELECT:
let exprReturn = [
"type": "select",
"value": this->_prepareSelect(expr, true)
];
break;
default:
throw new Exception("Unknown expression type " . exprType);
}
return exprReturn;

Expected behavior
I don't know how Zephir handles this, but it seems to be an invalid return type and it must be an array?

Details

  • Phalcon version: 4.1.2, actually any
  • PHP Version:
  • Operating System:
  • Installation type: Compiling from source || installing via package manager
  • Zephir version (if any):
  • Server: Nginx | Apache | Other
  • Other related info (Database, table schema):
@StudioMaX StudioMaX added bug A bug report status: unverified Unverified labels Jun 24, 2021
@Jeckerson Jeckerson added 5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility enhancement Enhancement to the framework and removed status: unverified Unverified labels Jun 24, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Sep 21, 2021
niden added a commit that referenced this issue Sep 30, 2021
…-type

#15553 - Fix Query::getExpression return type
@niden niden added status: medium Medium and removed enhancement Enhancement to the framework labels Sep 30, 2021
@niden
Copy link
Member

niden commented Sep 30, 2021

Resolved in #15686

@niden niden closed this as completed Sep 30, 2021
@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
@niden niden added this to Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: medium Medium
Projects
Archived in project
Development

No branches or pull requests

3 participants