34 $this->assets = $coll->
all();
40 if (
false === $pos = strrpos($this->output,
'.')) {
41 $this->output .=
'_*';
43 $this->output = substr($this->output, 0, $pos).
'_*'.substr($this->output, $pos);
56 $asset =
current($this->assets);
63 if (!isset($this->clones[$asset])) {
64 $clone = $this->clones[$asset] = clone $asset;
67 $name =
sprintf(
'%s_%d', pathinfo($asset->getSourcePath(), PATHINFO_FILENAME) ?:
'part', $this->key() + 1);
71 $clone->setTargetPath(str_replace(
'*', $name, $this->output));
73 $clone = $this->clones[$asset];
77 foreach ($this->filters as $filter) {
78 $clone->ensureFilter($filter);
86 return key($this->assets);
91 return next($this->assets);
96 return reset($this->assets);
101 return false !==
current($this->assets);
119 foreach ($this->vars as $var) {
121 if (
false !== strpos($name, $var) &&
false !== strpos($this->output, $var)) {
122 $name = str_replace($var,
'', $name);
sprintf('%.4f', $callTime)
Iterates over an asset collection.
removeDuplicateVar($name)
__construct(AssetCollectionInterface $coll, \SplObjectStorage $clones)
getChildren()
@uses current()
current($raw=false)
Returns a copy of the current asset with filters and a target URL applied.
An exception for terminatinating execution or to throw for unit testing.
all()
Returns all child assets.
getFilters()
Returns an array of filters currently applied.
getVars()
Returns an array of variable names for this asset.
getTargetPath()
Returns the URL for the current asset.