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 default value of Phalcon\Annotations\Annotation properties #14977

Closed
sergeyklay opened this issue May 2, 2020 · 1 comment · Fixed by #14979
Closed

[BUG]: Incorrect default value of Phalcon\Annotations\Annotation properties #14977

sergeyklay opened this issue May 2, 2020 · 1 comment · Fixed by #14979
Assignees
Labels
bug A bug report status: low Low

Comments

@sergeyklay
Copy link
Contributor

sergeyklay commented May 2, 2020

The following properties of the Phalcon\Annotations\Annotation are declared as NULL:

/**
* Annotation Arguments
*
* @var array
*/
protected arguments;

/**
* Annotation ExprArguments
*
* @var string
*/
protected exprArguments;

However, their getters returns arrays:

public function getArguments() -> array
{
return this->arguments;
}

public function getExprArguments() -> array
{
return this->exprArguments;
}

This leads to a fatal error:

PHP Fatal error:
Return value of Phalcon\Annotations\Annotation::getArguments()
must be of the type array, null returned in Unknown on line 0

Also note that exprArguments annotated as a string, but this is wromg. This property should holds arrays only.

Also Phalcon\Annotations\Annotation::getArgument my return void:

public function getArgument(var position)
{
var argument;
if fetch argument, this->arguments[position] {
return argument;
}
}

@sergeyklay
Copy link
Contributor Author

Fixed in 4.0.x branch

niden pushed a commit that referenced this issue May 16, 2020
@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
bug A bug report status: low Low
Projects
Archived in project
1 participant