getrecords() docblock says one thing, function does something else

4 posts by 2 authors in: Forums > CMS Builder
Last Post: Yesterday at 9:00pm   (RSS)

It appears that along the way, the getrecords function changed from a 2-value return to a 3-value return; a schema array is now added to the final output. The docblock shows only 2.

My AI agents are flagging this inconsistency. How is the schema to be used?


/* list($records, $details) = getRecords(array( ... */
function getRecords($options): ?array { 
    ...
    return array($rows, $listDetails, $schema);
}
Jeff Shields
yaadev.com

Good to know. I had AI doing a code review of my code and it flagged that the function returned 3 values, but I was only using 2. I will add it to my agents.md file that only 2 are used and the 3rd is CMSB internal use. That will stop the warmings.

Jeff Shields
yaadev.com

By Dave - Yesterday at 9:00pm - edited: Yesterday at 9:02pm

Hi jeff, 

I'll convert the function comment to a proper PHPDoc block with an @return tag at the end as well.  That might help: 

*
* @return array|null [$records, $listMetaData, $schema] - schema for advanced use
*/
Dave Edis - Senior Developer
interactivetools.com