Sourcecode
extends WriterAbstract
in package
Uses
IoTrait
Sourcecode transformation writer; generates syntax highlighted source files in a destination's subfolder.
Table of Contents
- $pathGenerator : PathGenerator
- __construct() : mixed
- __toString() : string
- checkRequirements() : void
- This method verifies whether PHP has all requirements needed to run this writer.
- getName() : string
- Name of this writer, used to identify this writer.
- transform() : void
- This method writes every source code entry in the structure file to a highlighted file.
- copy() : void
- persistTo() : void
- readSourceFile() : string
- copyDirectory() : void
- isGlobalTemplateReference() : bool
- normalizeDestination() : string
- normalizeSourcePath() : string
- stripFirstPartOfPath() : string
Properties
$pathGenerator
private
PathGenerator
$pathGenerator
Methods
__construct()
public
__construct(PathGenerator $pathGenerator) : mixed
Parameters
- $pathGenerator : PathGenerator
Return values
mixed —__toString()
public
__toString() : string
Return values
string —checkRequirements()
This method verifies whether PHP has all requirements needed to run this writer.
public
checkRequirements() : void
If one of the requirements is missing for this Writer then an exception of type RequirementMissing should be thrown; this indicates to the calling process that this writer will not function.
Tags
Return values
void —getName()
Name of this writer, used to identify this writer.
public
getName() : string
This name is also used in Collection as key and should match the name provided in the template definitions' transformations.
Return values
string —transform()
This method writes every source code entry in the structure file to a highlighted file.
public
transform(ProjectDescriptor $project, Transformation $transformation) : void
Parameters
- $project : ProjectDescriptor
-
Document containing the structure.
- $transformation : Transformation
-
Transformation to execute.
Return values
void —copy()
protected
copy(Transformation $transformation, string $path, string $destination) : void
Parameters
- $transformation : Transformation
- $path : string
- $destination : string
Return values
void —persistTo()
protected
persistTo(Transformation $transformation, string $path, string $contents) : void
Parameters
- $transformation : Transformation
- $path : string
- $contents : string
Return values
void —readSourceFile()
protected
readSourceFile(Transformation $transformation, string $path) : string
Parameters
- $transformation : Transformation
- $path : string
Return values
string —copyDirectory()
private
copyDirectory(Transformation $transformation, string $path, string $destination) : void
Parameters
- $transformation : Transformation
- $path : string
- $destination : string
Return values
void —isGlobalTemplateReference()
private
isGlobalTemplateReference(string $path) : bool
Parameters
- $path : string
Return values
bool —normalizeDestination()
private
normalizeDestination(string $destination) : string
Parameters
- $destination : string
Return values
string —normalizeSourcePath()
private
normalizeSourcePath(string $path) : string
Parameters
- $path : string
Return values
string —stripFirstPartOfPath()
private
stripFirstPartOfPath(string $path) : string
Parameters
- $path : string