calinrada/php-apidoc — pull request #17 by lahaxearnaud (2014-07-09 20:13:46+00:00)
Title: Add class annotations to deal with inheritance

This modification allow to define a "base" path for the class and just define the sub path in method

/**
* @ApiRoute(name="/articles/")
* @ApiSector(name="Articles")
*/
class ArticlesController extends \BaseController
{
/**
* @ApiDescription(description="Create a new article")
* @ApiRoute(name="create")
* @ApiMethod(type="post")
*/
public function store()
{
// some awesome code
}
}

abstract class BaseController extends Controller
{

/**
* Display the specified resource.
*
* @param int $id
* @return Response
*
* @ApiDescription(description="Foo")
* @ApiParams(name="id", type="integer", nullable=false, description="Article id")
* @ApiRoute(name="{id}")
* @ApiMethod(type="get")
*/
public function show($id)
{
// unicorn and lolcats generator
}
}

The output will be :

![capture decran 2014-07-09 a 22 08 46](https://cloud.githubusercontent.com/assets/1364221/3530537/73baa26a-07a5-11e4-85dc-48130c869d0c.png)