Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phpdoc No Summary found for this file

Tags:

php

phpdoc

I've installed phpDoc on our server, set up etc. It's producing documentation correctly. We're using the 'Responsive' template, however this error occurs regardless of the template used.

Under the 'Errors', each file scanned seems to have the following error:

Type        Line    Description
error       0       No summary was found for this file

I've googled exhaustively for this, and can't find a solution. I've even gone through the effort of tracking down the server error code behind the message PPC:ERR-50000 and attempting to track back the condition which causes the error, but got a bit lost.

My Question:

What does this error mean? Why is it on line 0, and how the hell do I get rid of it?! Even if I have done the docblock correctly, can I hide this error? My error-free ocd is going crazy!

Many thanks

EDIT Some extra information: Each of my files have the following docblock from line 1 of the file:

<?php 
    /**
     * Short Description
     *
     * Long Description
     *
     * @package      Some Package
     * @subpackage   Some Subpackage
     * @category     Some Category
     * @author       F Bloggs <[email protected]>
     */
?>
like image 574
Phil Cross Avatar asked Jan 23 '14 15:01

Phil Cross


2 Answers

But does the top of your file have two such docblocks? The first docblock is expected to be the one for the file itself, and a second docblock should pair up with the first documentable code element that appears after it.

However, if you only have one docblock at the top of the file, it will get paired up with the first code element found, thus the "file itself" will seem to be missing its docblock. That is what that error is supposed to indicate.

like image 192
ashnazg Avatar answered Nov 05 '22 07:11

ashnazg


@ashnazg is right but I want to improve your answer with an example.

A File-level DocBlock should be the first docblock and must have a Summary (in this example the summary is "Class Category | core/Category.class.php"). Then a Class-level DocBlock is placed before a class definition.

<?php
/**
 * Class Category | core/Category.class.php
 *
 * @package     MyApp XYZ
 * @subpackage  Categories
 * @author      Sandro Miguel Marques <[email protected]>
 * @version     v.1.1 (06/12/2016)
 * @copyright   Copyright (c) 2016, Sandro
 */

namespace Myapp;

use \PDO;
use \Exception;
use \PDOException;

/**
 * Class Category - active record
 *
 * Recipe categories
 */
class Category {

    ...
like image 5
SandroMarques Avatar answered Nov 05 '22 07:11

SandroMarques