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

can't configure php to get docblock #71

Closed
zordsdavini opened this issue Dec 18, 2019 · 6 comments
Closed

can't configure php to get docblock #71

zordsdavini opened this issue Dec 18, 2019 · 6 comments
Labels
feature New feature or request

Comments

@zordsdavini
Copy link

Installed doge via Plug. Tool itself works - tried with python but I can't get it working for php. Maybe there should be some additional installs? Thought about PhpDocumentor2 but DoGe didn't start working

@zordsdavini zordsdavini added the question Further information is requested label Dec 18, 2019
@kkoomen
Copy link
Owner

kkoomen commented Dec 18, 2019

Hi. Every language, besides C or C++, will work out-of-the-box without the use of third party. Only C and C++ require third ypart libs. You can simple do this:

function greet(string $name) {
  echo "Hello " . $name;
}

Keep your cursor at line 1 here and press <Leader>d. It should give you something like this:

/**
 * [TODO:description]
 *
 * @param string $name [TODO:description]
 * @return [TODO:type] [TODO:description]
 */
function greet(string $name) {
  echo "Hello " . $name;
}

@kkoomen
Copy link
Owner

kkoomen commented Dec 18, 2019

If you can't get it to work, then I suggest you paste your code here you try to generate documentation for. Maybe you have found a scenario that doesn't generate properly.

@zordsdavini
Copy link
Author

zordsdavini commented Dec 18, 2019

    public function koja(string $ggg): array
    {
        throw new \Exception('sfdsfdsds');
    }

I removed return type and it started working. Is there possibilities to show return type. And maybe there is example how template can be adjusted: I don't need all helper texts and params should be tabbed, space before return. And as I understand Exceptions are not shown, too

@zordsdavini
Copy link
Author

the result what I want is

    /**
     * @param string $ggg
     * @param array  $a
     *
     * @return array
     * @throws \Exception
     */
    public function koja(string $ggg, array $a): array
    {
        throw new \Exception('sfdsfdsds');
    }

@kkoomen
Copy link
Owner

kkoomen commented Dec 18, 2019

Ah, yeah, since a recent php 7 version it's possible to add return types, which hasn't been supported. I'll add support for this after #65 has been merged.

@kkoomen kkoomen added feature New feature or request and removed question Further information is requested labels Dec 18, 2019
@kkoomen
Copy link
Owner

kkoomen commented Dec 28, 2019

This feature has been merged and released in v2.1.0.

I've added support for PHP 7 return type declarations and PHP 8 proposed union types.

Feel free to submit any new issues if you experience any unwanted behavior in the future. Thanks for your contribution.

@kkoomen kkoomen closed this as completed Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants