124 lines
2.5 KiB
PHP
Raw Normal View History

2012-04-13 14:11:54 +02:00
<?php
/*
* This file is part of the NelmioApiDocBundle.
*
* (c) Nelmio <hello@nelm.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Tests\Fixtures\Controller;
use FOS\RestBundle\Controller\Annotations\QueryParam;
use FOS\RestBundle\Controller\Annotations\RequestParam;
2012-04-13 14:11:54 +02:00
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
2012-04-13 15:18:54 +02:00
use Symfony\Component\HttpFoundation\Response;
2012-04-13 14:11:54 +02:00
class TestController
{
/**
* @ApiDoc(
* resource=true,
* description="index action",
* filters={
* {"name"="a", "dataType"="integer"},
* {"name"="b", "dataType"="string", "arbitrary"={"arg1", "arg2"}}
* }
* )
*/
public function indexAction()
{
2012-04-13 15:18:54 +02:00
return new Response('tests');
2012-04-13 14:11:54 +02:00
}
/**
* @ApiDoc(
* description="create test",
2012-07-24 14:39:43 -04:00
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Form\TestType"
2012-04-13 14:11:54 +02:00
* )
*/
public function postTestAction()
{
}
2012-04-13 14:42:28 +02:00
public function anotherAction()
{
}
2012-04-13 15:00:46 +02:00
/**
* @ApiDoc(description="Action without HTTP verb")
*/
public function anyAction()
{
}
/**
* This method is useful to test if the getDocComment works.
* And, it supports multilines until the first '@' char.
*
* @ApiDoc()
*
2012-05-23 00:33:01 +02:00
* @param int $id A nice comment
* @param int $page
*/
public function myCommentedAction()
{
}
/**
* @ApiDoc()
*/
public function yetAnotherAction()
{
}
/**
* @ApiDoc(
* description="create another test",
2012-07-24 14:39:43 -04:00
* input="dependency_type"
* )
*/
public function anotherPostAction()
{
}
/**
* @ApiDoc()
* @QueryParam(name="page", requirements="\d+", default="1", description="Page of the overview.")
*/
public function zActionWithQueryParamAction()
{
}
2012-08-07 21:57:36 -04:00
/**
* @ApiDoc(
* description="Testing JMS",
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Model\JmsTest"
* )
*/
public function jmsInputTestAction()
{
}
2012-08-27 12:56:19 -04:00
/**
* @ApiDoc(
* description="Testing return",
2012-08-27 13:25:03 -04:00
* return="dependency_type"
2012-08-27 12:56:19 -04:00
* )
*/
public function jmsReturnTestAction()
{
}
/**
* @ApiDoc()
* @RequestParam(name="param1", requirements="string", nullable=false, description="Param1 description.")
*/
public function zActionWithRequestParamAction()
{
}
2012-04-13 14:11:54 +02:00
}