PHP Class Phrocco\Phrocco

It works on a single language file, delegating the processing to an adapter class, then writes the resulting parsed content to an output file using the built-in templates.
Author: Ross Riley
Exibir arquivo Open project: rossriley/phrocco Class Usage Examples

Public Properties

Property Type Description
$adapter `AdapterInterface` This is primarily for internal use, storing a reference to the adapter class that will handle conversion.
$file `string` The file that we will operate on.
$layoutFile `string` Pass in standalone template files / css files to change the way the documentation looks.
$output_file `string` The output file that the final html doc file will be written to.
$sections `array` ####Class Variables Sections array is the main storage for code mapped to documentation.
$stylesheetFile
$title `string` Gets passed into the template file to become the HTML page title.

Protected Properties

Property Type Description
$adapterTypes array #### Available adapter types.

Public Methods

Method Description
__construct ( `string` $language, `string` $file, `array` $options = [] ) : `void` ###Class Constructor
parse ( ) : `void` Proxies the parsing responsibility to the selected adapter.
render ( ) : `string` ### Template Render By this point the sections array will be populated with either side of the Comment / Code divide.
write ( $content ) : `void` ### Template Write method By this point the sections array will be populated with either side of the Comment / Code divide.

Protected Methods

Method Description
createAdapter ( `string` $type ) : `AdapterInterface` ###Create adapter by type.

Method Details

__construct() public method

###Class Constructor
public __construct ( `string` $language, `string` $file, `array` $options = [] ) : `void`
$language `string`
$file `string`
$options `array`
return `void`

createAdapter() protected method

###Create adapter by type.
protected createAdapter ( `string` $type ) : `AdapterInterface`
$type `string`
return `AdapterInterface`

parse() public method

Proxies the parsing responsibility to the selected adapter.
public parse ( ) : `void`
return `void`

render() public method

This method includes the template file and returns the generated content ready to write to file.
public render ( ) : `string`
return `string`

write() public method

This method includes the template file and writes the final buffer to the output file.
public write ( $content ) : `void`
return `void`

Property Details

$adapter public_oe property

This is primarily for internal use, storing a reference to the adapter class that will handle conversion.
public `AdapterInterface` $adapter
return `AdapterInterface`

$adapterTypes protected_oe static_oe property

#### Available adapter types.
protected static array $adapterTypes
return array

$file public_oe property

The file that we will operate on.
public `string` $file
return `string`

$layoutFile public_oe property

Pass in standalone template files / css files to change the way the documentation looks.
public `string` $layoutFile
return `string`

$output_file public_oe property

The output file that the final html doc file will be written to.
public `string` $output_file
return `string`

$sections public_oe property

####Class Variables Sections array is the main storage for code mapped to documentation.
public `array` $sections
return `array`

$stylesheetFile public_oe property

public $stylesheetFile

$title public_oe property

Gets passed into the template file to become the HTML page title.
public `string` $title
return `string`