Zend\Code\Generator\FileGenerator
Synopsis
class FileGenerator
extends AbstractGenerator
{
- // Inherited constants from AbstractGenerator
- const LINE_FEED = "\n";
- // members
- protected string $filename;
- protected DocBlockGenerator $docBlock;
- protected array $requiredFiles;
- protected string $namespace;
- protected array $uses;
- protected array $classes;
- protected string $body;
- // Inherited members from AbstractGenerator
- protected bool $isSourceDirty;
- protected int|string $indentation;
- protected string $sourceContent;
- // methods
- public void __construct()
- public static FileGenerator fromReflectedFileName()
- public static FileGenerator fromReflection()
- public static FileGenerator fromArray()
- public FileGenerator setDocBlock()
- public DocBlockGenerator getDocBlock()
- public FileGenerator setRequiredFiles()
- public array getRequiredFiles()
- public FileGenerator setClasses()
- public string getNamespace()
- public FileGenerator setNamespace()
- public array getUses()
- public FileGenerator setUses()
- public FileGenerator setUse()
- public ClassGenerator getClass()
- public FileGenerator setClass()
- public FileGenerator setFilename()
- public string getFilename()
- public array getClasses()
- public FileGenerator setBody()
- public string getBody()
- public bool isSourceDirty()
- public string generate()
- public FileGenerator write()
- // Inherited methods from AbstractGenerator
- public void __construct()
- public AbstractGenerator setSourceDirty()
- public bool isSourceDirty()
- public AbstractGenerator setIndentation()
- public string getIndentation()
- public AbstractGenerator setSourceContent()
- public string getSourceContent()
- public AbstractGenerator setOptions()
Hierarchy
Tasks
Line | Task |
---|---|
375 | check for dup here |
496 | marker replacement for required files |
Constants
Name | Value |
---|---|
LINE_FEED | "\n" |
Members
protected
- $body — string
- $classes — array
- $docBlock — Zend\Code\Generator\DocBlockGenerator
- $filename — string
- $indentation — Zend\Code\Generator\int|string
- $isSourceDirty — Zend\Code\Generator\bool
- $namespace — string
- $requiredFiles — array
- $sourceContent — string
- $uses — array
Methods
public
- __construct() — Passes $options to {@link setOptions()}.
- fromArray()
- fromReflectedFileName() — Use this if you intend on generating code generation objects based on the same file.
- fromReflection()
- generate()
- getBody()
- getClass()
- getClasses()
- getDocBlock()
- getFilename()
- getNamespace()
- getRequiredFiles()
- getUses() — Returns an array with the first element the use statement, second is the as part.
- isSourceDirty()
- setBody()
- setClass()
- setClasses()
- setDocBlock()
- setFilename()
- setNamespace()
- setRequiredFiles()
- setUse()
- setUses()
- write()