Optimizer
Minifies CSS/JS assets and optimizes image files.
Table of Contents
Properties
Methods
- __construct() : mixed
- minify() : array<string|int, mixed>
- Minifies CSS or JS content in the given data array.
- optimizeImage() : int
- Optimizes an image file in-place.
Properties
$builder
protected
Builder
$builder
$config
protected
Config
$config
Methods
__construct()
public
__construct(Builder $builder) : mixed
Parameters
- $builder : Builder
minify()
Minifies CSS or JS content in the given data array.
public
minify(array<string|int, mixed> $data) : array<string|int, mixed>
Returns the updated data array, unchanged if conditions are not met.
Parameters
- $data : array<string|int, mixed>
-
Asset data array (must contain 'ext', 'path', 'content')
Tags
Return values
array<string|int, mixed> —Updated data array with minified content
optimizeImage()
Optimizes an image file in-place.
public
optimizeImage(string $filepath, string $path, int $quality) : int
Returns the new file size in bytes.
Parameters
- $filepath : string
- $path : string
- $quality : int