NelmioApiDocBundle/Formatter/SimpleFormatter.php
2016-01-26 04:36:38 +01:00

56 lines
1.1 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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\Formatter;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
class SimpleFormatter extends AbstractFormatter
{
/**
* {@inheritdoc}
*/
public function formatOne(ApiDoc $annotation)
{
return $annotation->toArray();
}
/**
* {@inheritdoc}
*/
public function format(array $collection)
{
$array = array();
foreach ($collection as $coll) {
$annotationArray = $coll['annotation']->toArray();
unset($annotationArray['parsedResponseMap']);
$array[$coll['resource']][] = $annotationArray;
}
return $array;
}
/**
* {@inheritdoc}
*/
protected function renderOne(array $data)
{
}
/**
* {@inheritdoc}
*/
protected function render(array $collection)
{
}
}