Cecil

Css extends AbstractOptimize

CSS optimization step.

This class extends the AbstractOptimize class and provides functionality to optimize CSS files. It uses the MatthiasMullie\Minify library to minify CSS files, reducing their size and improving load times. It initializes with the type 'css' and processes files by minifying them.

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.
getName()  : string
Returns the step name.
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

getName()

Returns the step name.

public getName() : string
Return values
string

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 processFile(SplFileInfo $file) : string
Parameters
$file : SplFileInfo
Return values
string

setProcessor()

Set file processor object.

public setProcessor() : void
 
On this page

Search results