Skip to content

[BUG]: object return type hint leads to fatal error #14987

@sergeyklay

Description

@sergeyklay

It seems object return type hint isn't properly handled by Zephir.

public function withRequestTarget(var requestTarget) -> object
{
if unlikely preg_match("/\s/", requestTarget) {
throw new InvalidArgumentException(
"Invalid request target: cannot contain whitespace"
);
}
return this->cloneInstance(requestTarget, "requestTarget");
}

At least for the following code:

$request = new Phalcon\Http\Message\ServerRequest();
$newInstance = $request->withRequestTarget('/test');

I get the following error:

PHP Fatal error:  Return value of Phalcon\Http\Message\AbstractRequest::withRequestTarget() 
must be an instance of NULL, instance of Phalcon\Http\Message\ServerRequest returned
in Unknown on line 0

As I can see object return type hint is just a stub and never had a real handler inside Zephir.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions