ChangeSet
in package
implements
ChangeSetInterface
Table of Contents
Interfaces
Properties
- $htmlFilters : array<string|int, mixed>
- $name : string
- $resFilters : array<string|int, mixed>
Methods
- alterHtml() : ChangeSet
- Declare a change to HTML.
- alterResource() : ChangeSet
- Declare a change to a resource.
- applyResourceFilters() : mixed
- Update a listing of resources.
- create() : ChangeSetInterface
- getName() : string
- Get the symbolic name of the changeset.
- requires() : ChangeSet
- Declare that $module requires additional dependencies.
- setName() : mixed
- createRegex() : string
- Convert a string with a wildcard (*) to a regex.
- applyHtmlFilters() : array<string|int, mixed>
- Update a set of HTML snippets.
Properties
$htmlFilters
protected
array<string|int, mixed>
$htmlFilters
= []
Each item is an array with keys:
- regex: string
- callback: function
$name
protected
string
$name
$resFilters
protected
array<string|int, mixed>
$resFilters
= []
Each item is an array with keys:
- resourceType: string
- callback: function
Methods
alterHtml()
Declare a change to HTML.
public
alterHtml(string $file, callable $callback) : ChangeSet
Parameters
- $file : string
-
A file name, wildcard, or regex. Ex: '~/crmHello/intro.html' (filename) Ex: '~/crmHello/*.html' (wildcard) Ex: ';(Edit|List)Ctrl.html$;' (regex)
- $callback : callable
-
Function which accepts up to two parameters:
- phpQueryObject $doc
- string $path
Return values
ChangeSetalterResource()
Declare a change to a resource.
public
alterResource(string $resourceType, callable $callback) : ChangeSet
Parameters
- $resourceType : string
- $callback : callable
Return values
ChangeSetapplyResourceFilters()
Update a listing of resources.
public
static applyResourceFilters(array<string|int, mixed> $changeSets, string $resourceType, array<string|int, mixed> $resources) : mixed
Parameters
- $changeSets : array<string|int, mixed>
-
Array(ChangeSet).
- $resourceType : string
-
Ex: 'requires', 'settings'
- $resources : array<string|int, mixed>
-
The list of resources.
create()
public
static create(string $name) : ChangeSetInterface
Parameters
- $name : string
-
Symbolic name for this changeset.
Return values
ChangeSetInterfacegetName()
Get the symbolic name of the changeset.
public
getName() : string
Return values
stringrequires()
Declare that $module requires additional dependencies.
public
requires(string $module, string|array<string|int, mixed> $dependencies) : ChangeSet
Parameters
- $module : string
- $dependencies : string|array<string|int, mixed>
Return values
ChangeSetsetName()
public
setName(string $name) : mixed
Parameters
- $name : string
createRegex()
Convert a string with a wildcard (*) to a regex.
protected
createRegex(string $filterExpr) : string
Parameters
- $filterExpr : string
-
Ex: "/foo/*.bar"
Return values
string —Ex: ";^/foo/[^/]*.bar$;"
applyHtmlFilters()
Update a set of HTML snippets.
private
static applyHtmlFilters(array<string|int, mixed> $changeSets, array<string|int, mixed> $strings) : array<string|int, mixed>
Parameters
- $changeSets : array<string|int, mixed>
-
Array(ChangeSet).
- $strings : array<string|int, mixed>
-
Array(string $path => string $html).
Tags
Return values
array<string|int, mixed> —Updated list of $strings.