DEV Community

Philip Perry
Philip Perry

Posted on

1

Scribe not extracting docblocks

Scribe can use PHP docblocks for generating documentation. On a newer Laravel project this no longer worked and initially I thought it might be related to a newer version of Scribe as we didn't have that version in other projects where we were using an older version of Scribe. But a downgrade was causing conflicts, so I couldn't evaluate this. However, it seemed odd that apart from one Github issue, nobody was complaining. So that pointed towards a configuration issue, but I couldn't see anything different inside the scribe config file.

Finally, after debugging the GetFromDocBlocks strategy class, my colleague came across the fact that the getDocComment method is a PHP reflection method. This led to a Google search where we found this Stackoverflow post: https://stackoverflow.com/questions/42087433/reflectionmethod-getdoccomment-doesnt-seem-to-work-on-php-5-5

It turns out, that for this project we were using OpCache, but had the configuration opcache.save_comments set to false. After changing the setting opcache.save_comments=1 and rebuilding the Docker container, Scribe worked as expected!

This one was slightly tricky to debug and credit goes to my colleague who patiently debugged the issue with me.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (1)

Collapse
 
gemmablack profile image
Gemma Black •

I haven't been on dev.to so I missed your post! Nice debug btw @programmingdecoded! I would never have thought opcache.save_comments=1 would have been the issue!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more