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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

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.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay