184 lines
3.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;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
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
2013-03-21 12:15:44 +01:00
/**
* @ApiDoc(
* description="post test 2",
* resource=true
* )
*/
public function postTest2Action()
{
}
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
2013-05-03 14:37:52 +01:00
* @param int $paramType The param type
* @param int $param The param id
*/
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()
{
}
2013-04-30 16:21:12 +04:00
/**
* @ApiDoc()
* @QueryParam(strict=true, name="page", requirements="\d+", description="Page of the overview.")
*/
public function zActionWithQueryParamStrictAction()
{
}
/**
* @ApiDoc()
* @QueryParam(name="page", requirements="\d+", default="1", description="Page of the overview.")
*/
public function zActionWithQueryParamAction()
{
}
2012-08-07 21:57:36 -04:00
2013-04-30 16:21:12 +04:00
/**
* @ApiDoc()
* @QueryParam(name="page", requirements="\d+", description="Page of the overview.")
*/
public function zActionWithQueryParamNoDefaultAction()
{
}
/**
* @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",
* output="dependency_type"
2012-08-27 12:56:19 -04:00
* )
*/
public function jmsReturnTestAction()
{
}
/**
* @ApiDoc()
2013-02-15 11:37:02 +01:00
* @RequestParam(name="param1", requirements="string", description="Param1 description.")
*/
public function zActionWithRequestParamAction()
{
}
/**
* @ApiDoc()
*/
public function secureRouteAction()
{
}
2012-12-26 12:23:28 +01:00
/**
* @ApiDoc(
* authentication=true
* )
*/
public function authenticatedAction()
{
}
/**
* @ApiDoc()
* @Cache(maxage=60, public=1)
*/
public function cachedAction()
{
}
2013-04-16 19:40:29 +01:00
/**
* @ApiDoc()
* @deprecated
*/
public function deprecatedAction()
{
}
2012-04-13 14:11:54 +02:00
}