PHP Class Dingo\Blueprint\Blueprint

Show file Open project: dingo/blueprint Class Usage Examples

Protected Properties

Property Type Description
$files Illuminate\Filesystem\Filesystem Filesytsem instance.
$includePath string Include path for documentation files.
$reader Doctrine\Common\Annotations\SimpleAnnotationReader Simple annotation reader instance.

Public Methods

Method Description
__construct ( Doctrine\Common\Annotations\SimpleAnnotationReader $reader, Illuminate\Filesystem\Filesystem $files ) : void Create a new generator instance.
generate ( Collection $controllers, string $name, string $version, string $includePath ) : boolean Generate documentation with the name and version.

Protected Methods

Method Description
appendAttributes ( string &$contents, Collection $attributes, integer $indent ) : void Append the attributes subsection to a resource or action.
appendBody ( string &$contents, string $body ) : void Append a body subsection to an action.
appendHeaders ( string &$contents, array $headers ) : void Append a headers subsection to an action.
appendParameters ( string &$contents, Collection $parameters ) : void Append the parameters subsection to a resource or action.
appendRequest ( string &$contents, Dingo\Blueprint\Annotation\Request $request, Resource $resource ) : void Append a request subsection to an action.
appendResponse ( string &$contents, Dingo\Blueprint\Annotation\Response $response, Resource $resource ) : void Append a response subsection to an action.
appendSection ( string &$contents, string $name, integer $indent, integer $lines = 2 ) : void Append a subsection to an action.
generateContentsFromResources ( Collection $resources, string $name ) : string Generate the documentation contents from the resources collection.
getFormat ( ) : string Get the API Blueprint format.
line ( integer $repeat = 1 ) : string Create a new line character.
prepareBody ( string $body, string $contentType ) : string Prepare a body.
registerAnnotationLoader ( ) : void Register the annotation loader.
tab ( integer $repeat = 1 ) : string Create a tab character.

Method Details

__construct() public method

Create a new generator instance.
public __construct ( Doctrine\Common\Annotations\SimpleAnnotationReader $reader, Illuminate\Filesystem\Filesystem $files ) : void
$reader Doctrine\Common\Annotations\SimpleAnnotationReader
$files Illuminate\Filesystem\Filesystem
return void

appendAttributes() protected method

Append the attributes subsection to a resource or action.
protected appendAttributes ( string &$contents, Collection $attributes, integer $indent ) : void
$contents string
$attributes Illuminate\Support\Collection
$indent integer
return void

appendBody() protected method

Append a body subsection to an action.
protected appendBody ( string &$contents, string $body ) : void
$contents string
$body string
return void

appendHeaders() protected method

Append a headers subsection to an action.
protected appendHeaders ( string &$contents, array $headers ) : void
$contents string
$headers array
return void

appendParameters() protected method

Append the parameters subsection to a resource or action.
protected appendParameters ( string &$contents, Collection $parameters ) : void
$contents string
$parameters Illuminate\Support\Collection
return void

appendRequest() protected method

Append a request subsection to an action.
protected appendRequest ( string &$contents, Dingo\Blueprint\Annotation\Request $request, Resource $resource ) : void
$contents string
$request Dingo\Blueprint\Annotation\Request
$resource Resource
return void

appendResponse() protected method

Append a response subsection to an action.
protected appendResponse ( string &$contents, Dingo\Blueprint\Annotation\Response $response, Resource $resource ) : void
$contents string
$response Dingo\Blueprint\Annotation\Response
$resource Resource
return void

appendSection() protected method

Append a subsection to an action.
protected appendSection ( string &$contents, string $name, integer $indent, integer $lines = 2 ) : void
$contents string
$name string
$indent integer
$lines integer
return void

generate() public method

Generate documentation with the name and version.
public generate ( Collection $controllers, string $name, string $version, string $includePath ) : boolean
$controllers Illuminate\Support\Collection
$name string
$version string
$includePath string
return boolean

generateContentsFromResources() protected method

Generate the documentation contents from the resources collection.
protected generateContentsFromResources ( Collection $resources, string $name ) : string
$resources Illuminate\Support\Collection
$name string
return string

getFormat() protected method

Get the API Blueprint format.
protected getFormat ( ) : string
return string

line() protected method

Create a new line character.
protected line ( integer $repeat = 1 ) : string
$repeat integer
return string

prepareBody() protected method

Prepare a body.
protected prepareBody ( string $body, string $contentType ) : string
$body string
$contentType string
return string

registerAnnotationLoader() protected method

Register the annotation loader.
protected registerAnnotationLoader ( ) : void
return void

tab() protected method

Create a tab character.
protected tab ( integer $repeat = 1 ) : string
$repeat integer
return string

Property Details

$files protected property

Filesytsem instance.
protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$includePath protected property

Include path for documentation files.
protected string $includePath
return string

$reader protected property

Simple annotation reader instance.
protected SimpleAnnotationReader,Doctrine\Common\Annotations $reader
return Doctrine\Common\Annotations\SimpleAnnotationReader