Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The first parameter to @version tag is ignored, and version field is blank in the output #1054

Closed
susam opened this issue Oct 4, 2013 · 11 comments
Milestone

Comments

@susam
Copy link

susam commented Oct 4, 2013

I am using phpdoc 2.0.1 on Debian Testing version (Jessie).

$ phpdoc --version 2> /dev/null
phpDocumentor version 2.0.1

Here is a test script foo.php to reproduce the issue:

<?php
/**
 * Foo script
 *
 * This script contains a class called Foo.
 *
 * @author Humpty Dumpty
 * @copyright 2013 Humpty Dumpty
 * @license http://creativecommons.org/publicdomain/zero/1.0/ Public domain
 * @version 0.1
 */

/**
 * Foo class
 *
 * This class contains a method called foo.
 *
 * @author Humpty Dumpty
 * @copyright 2013 Humpty Dumpty
 * @license http://creativecommons.org/publicdomain/zero/1.0/ Public domain
 * @version 0.1
 */
class Foo
{
    /**
     * Prints foo
     *
     * @return void
     */
    public function foo()
    {
        echo "foo\n";
    }
}
?>

After executing phpdoc -d . -t docs to generate the
documentation, this is what I see:

blank-version

You can see that the 'Version' field appears to be blank.

However if I change the @version tag from

@version 0.1

to

@version 0.1 Unstable

then I see the following output:

unstable-version

It looks like only the second parameter to @version tag is
displayed in the output. From the documentation at
http://www.phpdoc.org/docs/latest/for-users/phpdoc/tags/version.html
it looks like, @version 0.1 should also work, i.e. the first
parameter to @version tag should also be displayed in the
output.

This issue occurs for @since tag too.

@susam
Copy link
Author

susam commented Oct 4, 2013

Until this issue is resolved, I am using @version tag in the following manner:

@version v0.1

As long as the first parameter (vector) to @version doesn't begin with a digit, it appears in the output. Another such workaround is:

@version Version 0.1

The following works too.

@version GIT: 0.1

The above usage seems like the intended usage of this tag as is evident from the code examples in the following URLs:

  1. http://www.phpdoc.org/docs/latest/for-users/phpdoc/tags/version.html#examples (See docblock for class NeoCounter)
  2. http://pear.php.net/manual/en/standards.sample.php (See docblock for the file and class Net_Sample)
  3. http://framework.zend.com/manual/1.12/en/coding-standard.coding-style.html#coding-standards.inline-documentation.classes

For @since tag, I am using the following workarounds.

The following works fine in a docblock for a file.

@since File 0.1 Added class Foo

The following works fine in a docblock for a class.

@since Class 0.1 Added method foo

The above two examples of @since tag indeed seems like the intended usage as can be seen in the first two URLs I have provided above. Of course, the following would work too since the first parameter to @since doesn't begin with a digit.

@since version 0.1 Added cool blue buttons

@boenrobot
Copy link
Contributor

Note that the only reason this workaround works is because "GIT: 0.1" is not actually a valid "GIT" version vector, and is therefore treated as part of a plain text description. The version vector is supposed to be enclosed within "$" (see first and second example you gave).

@mvriel
Copy link
Member

mvriel commented Mar 30, 2014

This item should be verified before version 2.4 is released to see if all mentioned issues are resolved

@mvriel mvriel modified the milestones: 2.5, 2.4 Apr 1, 2014
@toxalot
Copy link

toxalot commented Apr 6, 2014

@mvriel This is not resolved in 2.4. @boenrobot Is the version number always supposed to be enclosed within $? As I read the docs the vector MUST follow a certain form only for vectors from Version Control Systems. However, judging by the example given on that documentation page, a plain number should work also.

@boenrobot
Copy link
Contributor

The two forms shown in the docs are the two supported ones - a number without any sort of prefix, and a VCS vector enclosed with "$".

As I noted above, the reason you are seeing the version (whether it's when you prefix it with "v" or not enclose a VCS vector in "$") is because THOSE forms are considered invalid. Thus, phpDocumentor treats them as plain text descriptions, which are shown without a problem.

phpDocumentor should display recognized version vectors alongside the description (perhaps bolded or whatever), but apparently, it's still not doing that.

@mvriel mvriel modified the milestones: 2.6, 2.5, 2.7 May 17, 2014
@mvriel mvriel added the Template label Jul 9, 2014
@mvriel mvriel modified the milestones: 2.7, 2.8 Aug 30, 2014
@mvriel mvriel modified the milestones: 2.8, 2.8.2 Feb 18, 2015
@jwleon
Copy link

jwleon commented Feb 13, 2016

Are we going to see this? It seems like it is still not working correctly...

@jaapio
Copy link
Member

jaapio commented May 11, 2016

@TheCodePianist can you confirm this issue is solved with the version that is currently available in master? I think it is solved.

@jaapio jaapio added the ready label May 11, 2016
@jaapio jaapio closed this as completed May 22, 2016
@jaapio jaapio removed the ready label May 22, 2016
@ve3
Copy link

ve3 commented Apr 30, 2017

I'm using phpDocumentor 2.9.0 but this document @version 1.0 is still not working. It is not solved at all.

@jaapio
Copy link
Member

jaapio commented Jul 3, 2017

@ve3 can you tell me in which situation @Version 1.0 doesn't work for you? Do you have a public example? Which template are you using?

@jaapio jaapio reopened this Jul 3, 2017
@jaapio jaapio self-assigned this Jul 3, 2017
@ve3
Copy link

ve3 commented Jul 4, 2017

@jaapio #1843

@jaapio jaapio removed their assignment Oct 13, 2020
@mvriel
Copy link
Member

mvriel commented Dec 8, 2022

I doublechecked whether this issue still exists in the latest version using the default template and it seems to be fine now:
image

As such, I am closing this issue as resolved

@mvriel mvriel closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants