DEV Community

Philip Perry
Philip Perry

Posted on

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.

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!