2012-07-19 17:56:49 -04: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\Parser;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the interface parsers must implement in order to be registered in the ApiDocExtractor.
|
|
|
|
*/
|
|
|
|
interface ParserInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return true/false whether this class supports parsing the given class.
|
|
|
|
*
|
2012-07-23 15:44:37 -04:00
|
|
|
* @param string $item The string type of input to parse.
|
2012-07-19 17:56:49 -04:00
|
|
|
* @return boolean
|
|
|
|
*/
|
2012-07-23 15:44:37 -04:00
|
|
|
public function supports($item);
|
|
|
|
|
2012-07-19 17:56:49 -04:00
|
|
|
/**
|
|
|
|
* Returns an array of class property metadata where each item is a key (the property name) and
|
|
|
|
* an array of data with the following keys:
|
|
|
|
* - dataType string
|
|
|
|
* - required boolean
|
|
|
|
* - description string
|
|
|
|
* - readonly boolean
|
2012-08-24 11:10:25 -04:00
|
|
|
* - children (optional) array of nested property names mapped to arrays
|
|
|
|
* in the format described here
|
2012-07-19 17:56:49 -04:00
|
|
|
*
|
2012-07-23 15:44:37 -04:00
|
|
|
* @param string $item The string type of input to parse.
|
2012-07-19 17:56:49 -04:00
|
|
|
* @return array
|
|
|
|
*/
|
2012-07-23 15:44:37 -04:00
|
|
|
public function parse($item);
|
|
|
|
|
|
|
|
}
|