Minify
in package
AbstractYes
Abstract minifier class.
Please report bugs on https://github.com/matthiasmullie/minify/issues
Tags
Table of Contents
Methods
- __construct() : mixed
- Init the minify class - optionally, code may be passed along already.
- add() : static
- Add a file or straight-up code to be minified.
- addFile() : static
- Add a file to be minified.
- cache() : CacheItemInterface
- Minify the data & write it to a CacheItemInterface object.
- execute() : string
- Minify the data.
- gzip() : string
- Minify & gzip the data & (optionally) saves it to a file.
- minify() : string
- Minify the data & (optionally) saves it to a file.
Methods
__construct()
Init the minify class - optionally, code may be passed along already.
public
__construct() : mixed
add()
Add a file or straight-up code to be minified.
public
add(string|array<string|int, string> $data) : static
Parameters
- $data : string|array<string|int, string>
Return values
staticaddFile()
Add a file to be minified.
public
addFile(string|array<string|int, string> $data) : static
Parameters
- $data : string|array<string|int, string>
Tags
Return values
staticcache()
Minify the data & write it to a CacheItemInterface object.
public
cache(CacheItemInterface $item) : CacheItemInterface
Parameters
- $item : CacheItemInterface
-
Cache item to write the data to
Return values
CacheItemInterface —Cache item with the minifier data
execute()
Minify the data.
public
abstract execute([mixed $path = null ]) : string
Parameters
- $path : mixed = null
-
Path to write the data to
Return values
string —The minified data
gzip()
Minify & gzip the data & (optionally) saves it to a file.
public
gzip([mixed $path = null ][, mixed $level = 9 ]) : string
Parameters
- $path : mixed = null
-
Path to write the data to
- $level : mixed = 9
-
Compression level, from 0 to 9
Return values
string —The minified & gzipped data
minify()
Minify the data & (optionally) saves it to a file.
public
minify([mixed $path = null ]) : string
Parameters
- $path : mixed = null
-
Path to write the data to
Return values
string —The minified data