phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.76k stars 2.07k forks source link

[BUG]: StatementList and readMetaDataIndex wrong return types #16613

Open oleghind opened 2 weeks ago

oleghind commented 2 weeks ago

final protected function statementList(array! statements, bool extendsMode = false) -> string

It sometimes returns null which leads to the crash:

PHP Fatal error: Phalcon\Mvc\View\Engine\Volt\Compiler::statementList(): Return value must be of type string, null returned

Also similar on the readMetaDataIndex function PHP Fatal error: Phalcon\Mvc\Model\MetaData::readMetaDataIndex(): Return value must be of type ?array, string returned

niden commented 2 weeks ago

@oleghind Could you please offer a test script or the model you are trying to use against the metadata engine? Also any volt files relevant?

At first look it doesn't seem that the statementList returns anything other than a string and the readMetaDataIndex should in theory return ?array but I need to check it against the data you are testing with.

Thanks

oleghind commented 1 week ago

It's impossible to figure out as errors point to line 0 without any stack traces, so I am closing it

niden commented 1 week ago

Keep this open. I am curious if we can reproduce it somehow. If I cannot get this reproduced I will close it