php comments as annotations

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
demi
Forum Newbie
Posts: 4
Joined: Fri Mar 21, 2008 6:28 am

php comments as annotations

Post by demi »

Here is code:

Code: Select all

class MenuController {
 
    /**
     * @allow: administrator
     */
    public function viewManagementAction() {
        $this->view->items = $this->table->fetchAll();
    }
}
 
$method = new ReflectionMethod('MenuController', 'viewManagementAction');
echo 'method doc comment : ' . $method->getDocComment() . '<br /><br />';
 
Why

Code: Select all

$method->getDocComment()
returns comments only ones? I change code, save, refresh page -- comments is displayed (page displays: "method doc comment : ' /*** @allow: administrator */"). Refresh again, comments disappears and page displays only: "method doc comment :". Why??
Post Reply