Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

No DocBlock when parsing code with static method #1

Closed
llaville opened this issue Nov 20, 2010 · 1 comment
Closed

No DocBlock when parsing code with static method #1

llaville opened this issue Nov 20, 2010 · 1 comment

Comments

@llaville
Copy link

Hi Sebastian,

While I tried to explore all features of PHP_TokenStream, I found a bug when parsing code that have class with static methods.

For example, pick up your our class "PHP_Token_Stream_TextUI_Command"

My platform :

  • Windows
  • PHP 5.3.2
  • PHP_TokenStream 1.0.1

My test script :

<?php 
require_once 'PHP/Token/Stream.php';

$source = 'C:\UwAmp\apache\php_5.3.2\PEAR\PHP\Token\Stream\TextUI\Command.php';

$tokenStream = new PHP_Token_Stream($source);

print_r($tokenStream->getClasses());
?>

Expected Results :

Array
(
    [PHP_Token_Stream_TextUI_Command] => Array
        (
            [methods] => Array
                (
                    [main] => Array
                        (
                            [docblock] => /**
 * Main method.
 */
                            [signature] => main()
                            [startLine] => 67
                            [endLine] => 155
                            [ccn] => 8
                        )

                    [showHelp] => Array
                        (
                            [docblock] => /**
 * Shows the help.
 */
                            [signature] => showHelp()
                            [startLine] => 160
                            [endLine] => 171
                            [ccn] => 1
                        )

                    [printVersionString] => Array
                        (
                            [docblock] => /**
 * Prints the version string.
 */
                            [signature] => printVersionString()
                            [startLine] => 176
                            [endLine] => 179
                            [ccn] => 1
                        )

                )

            [docblock] => /**
 * TextUI frontend for PHP_TokenStream.
 *
 * @author    Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright 2009-2010 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license   http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version   Release: 1.0.1
 * @link      http://github.com/sebastianbergmann/php-token-stream/tree
 * @since     Class available since Release 1.0.0
 */
            [startLine] => 62
            [endLine] => 180
        )

)

Current Results :

Array
(
    [PHP_Token_Stream_TextUI_Command] => Array
        (
            [methods] => Array
                (
                    [main] => Array
                        (
                            [docblock] =>
                            [signature] => main()
                            [startLine] => 67
                            [endLine] => 155
                            [ccn] => 8
                        )

                    [showHelp] => Array
                        (
                            [docblock] =>
                            [signature] => showHelp()
                            [startLine] => 160
                            [endLine] => 171
                            [ccn] => 1
                        )

                    [printVersionString] => Array
                        (
                            [docblock] =>
                            [signature] => printVersionString()
                            [startLine] => 176
                            [endLine] => 179
                            [ccn] => 1
                        )

                )

            [docblock] => /**
 * TextUI frontend for PHP_TokenStream.
 *
 * @author    Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright 2009-2010 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license   http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version   Release: 1.0.1
 * @link      http://github.com/sebastianbergmann/php-token-stream/tree
 * @since     Class available since Release 1.0.0
 */
            [startLine] => 62
            [endLine] => 180
        )

)

Regards
Laurent Laville

@llaville
Copy link
Author

As I'm a beginner with Git, I've took time to learn features and espacillay about branches.

I've installed Git on my Windows PC (hope there won't have conflits especially with Line-Ending).

Before to continue on issues 2 and 3. I'll send you a pull request about a new branch named issue1 to solve only this one.

If result is ok, I'll continue to work on others (that proved I've well understand how to manage Git).

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant