Search code examples
phpintellij-ideaphpdoc

IntelliJ Generate PHPDoc


In IntelliJ, you can generate JavaDoc by going to Tools -> Generate JavDoc. When you have a Static Web PHP project, however, JavaDoc will not work, throwing the error that no Java classes could be found.

Now, what I need is to generate actual PHPDoc. My functions and classes already have the necessary PHPDoc comments in the source code. How is it done, if it's at all possible without having to resort to PHPStorm?

I haven't been able to find the answer anywhere on StackOverflow or in the IntelliJ documentation. All I have found was how to have IntelliJ automatically generate the necessary PHPDoc comments based on the function signature, but what I wanna do is export them to standalone HTML files.


Solution

  • Go to Run -> Edit Configurations... then add a new PHP script. In the File field, point to the location of phpdoc on your machine. In the Arguments field, add something like this, taking into account whatever extra arguments you may need:

    -d /path/to/code -t /path/to/target/directory
    

    Name the script, hit OK to save your changes, and you should be good to go. It'll be added to the dropdown of Run/Debug Configurations.