Constants in namespace #729

Xopek opened this Issue Jan 28, 2013 · 2 comments


None yet

2 participants


I have these definitions in my file:

define( 'PHPTree\Exception\DB_QUERY_EXP', 50 );
define( 'PHPTree\Exception\TC_EXP', 6 );
define( 'PHPTree\Controller\ALL_EVENTS', 'ALL' );

phpdoc creates this structure.xml:

<namespace name="PHPTree" full_name="PHPTree">
    <namespace name="" full_name="PHPTree\">
      <namespace name="Controller" full_name="PHPTree\\Controller">
        <namespace name="" full_name="PHPTree\\Controller\"/>
      <namespace name="Exception" full_name="PHPTree\\Exception">
        <namespace name="" full_name="PHPTree\\Exception\"/>

Which is wrong, namespace must be "PHPTree\Exception", but not "PHPTree\\Exception".

If i delete this constants definition everything is okay and i have the right namespace: PHPTree\Exception, but with this constants phpdoc creates a mess=)

What is wrong?

phpDocumentor member

What is wrong I cannot say currently, I have triaged this issue as a bug to be fixed before 2.0

@mvriel mvriel added a commit that closed this issue May 6, 2013
@mvriel mvriel Fix #729; constant names are incorrect with 'define'
With this commit we fix the way namespace and name are combined to get a correct
constant name in the Constant Descriptor. This is a tandem commit with
which fixes a bug in the Reflection library.
@mvriel mvriel closed this in 2d4d0c4 May 6, 2013
phpDocumentor member

The Reflection library incorrectly transformed the define constant definition into a valid name. This has been fixed in the develop branch and will be released with the upcoming beta release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment