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 (2)

Collapse
 
seoakbarali profile image
akbarali seo

Descargar PDF de Scribd" implica obtener archivos en formato PDF desde la plataforma Scribd, que ofrece una amplia gama de documentos y libros. Aunque Scribd permite la descarga de contenido para usuarios suscritos, algunas personas buscan métodos alternativos para obtener estos archivos sin suscripción. Es crucial tener en cuenta que el uso de herramientas no oficiales para descargar contenido puede infringir los términos de servicio de Scribd y los derechos de autor de los autores. Para acceder legalmente a los contenidos, se recomienda utilizar una suscripción activa.

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!