phalcon / cphalcon

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

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

Open oleghind opened 5 months ago

oleghind commented 5 months 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 5 months 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 4 months ago

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

niden commented 4 months ago

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