News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Reflection over PHPDoc with PHP
April 04, 2011 @ 12:51:15

Gonzalo Ayuso has a new post to his blog today talking about a regular expression-laden script he's some up with to reflect over a PHP file and pull out the document's comments (PHPDoc-style).

I want to parse PHPDoc code. Let me explain a little bit what I want to do. Imagine a dummy function documented with PHPDoc. [...] PHP has a great reflection API, but as at least in the current PHP version (as far as I know) we only can get the PHPDoc as a string, without parse it. I need to get the parameters and the type of them with reflection. [...] But the type is different.

His script (based loosely on a bit of a component from the Zend Framework) parses the file and its comments and grabs the variable types from the PHPDoc blocks on each method and associates them.

If you're looking for a more mature solution than just this script, take a look at Docblox, a PHP 5.3 documentation generator.

0 comments voice your opinion now!
reflection tutorial phpdocumentor comment variable type


blog comments powered by Disqus

Similar Posts

Pablo Viquez: PHP Step by Step Debugging with JMeter, XDebug & Eclipse PDT

DevShed: Using Code Igniter to Enable Comments in a Blog Application

DevShed: Introducing Bridge Classes with PHP 5

The Bakery: Lots of New Articles/Tutorials/Components

IBM developerWorks: Understanding the Zend Framework,Part 4: When there is no feed, Zend_HTTP_Client


Community Events





Don't see your event here?
Let us know!


series symfony voicesoftheelephpant list language podcast zendserver introduction conference tips deployment code interview threedevsandamaybe release laravel api framework community bugfix

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework