Cecil

AbstractOptimize extends AbstractStep

AbstractYes

Abstract class for optimization steps.

This class provides a base implementation for steps that optimize files of a specific type (e.g., CSS, JS). It handles the initialization of the optimization process, file processing, and caching of optimized files.

Table of Contents

Properties

$builder  : Builder
$canProcess  : bool
$config  : Config
$options  : Builder::OPTIONS
Configuration options for the step.
$processor  : mixed
$type  : string

Methods

__construct()  : mixed
StepInterface constructor.
canProcess()  : bool
Method to know if the step can be processed.
decode()  : string|null
Decode file content.
encode()  : string|null
Encode file content.
init()  : void
This method is called before the step is processed to initialize the step with necessary options and to determine if it can be executed.
process()  : void
Process implementation.
processFile()  : string
Process a file.
setProcessor()  : void
Set file processor object.

Properties

$options

Configuration options for the step.

protected Builder::OPTIONS $options

Methods

canProcess()

Method to know if the step can be processed.

public canProcess() : bool

If init() is used, true by default.

Return values
bool

decode()

Decode file content.

public decode([string|null $content = null ]) : string|null
Parameters
$content : string|null = null
Return values
string|null

encode()

Encode file content.

public encode([string|null $content = null ]) : string|null
Parameters
$content : string|null = null
Return values
string|null

init()

This method is called before the step is processed to initialize the step with necessary options and to determine if it can be executed.

public init(array<string|int, mixed> $options) : void
Parameters
$options : array<string|int, mixed>

processFile()

Process a file.

public abstract processFile(SplFileInfo $file) : string
Parameters
$file : SplFileInfo
Return values
string

setProcessor()

Set file processor object.

public abstract setProcessor() : void
 
On this page

Search results