public function current($raw = false)
    {
        $asset = current($this->assets);

        if ($raw) {
            return $asset;
        }

        // clone once
        if (!isset($this->clones[$asset])) {
            $clone = $this->clones[$asset] = clone $asset;

            // generate a target path based on asset name
            $name = sprintf('%s_%d', pathinfo($asset->getSourcePath(), PATHINFO_FILENAME) ?: 'part', $this->key() + 1);

            $name = $this->removeDuplicateVar($name);

            $clone->setTargetPath(str_replace('*', $name, $this->output));
        } else {
            $clone = $this->clones[$asset];
        }

        // cascade filters
        foreach ($this->filters as $filter) {
            $clone->ensureFilter($filter);
        }

        return $clone;
    }
public function current($raw = false)
    {
        $asset = current($this->assets);

        if ($raw) {
            return $asset;
        }

        // clone once
        if (!isset($this->clones[$asset])) {
            $clone = $this->clones[$asset] = clone $asset;

            // generate a target path based on asset name
            $name = sprintf('%s_%d', pathinfo($asset->getSourcePath(), PATHINFO_FILENAME) ?: 'part', $this->key() + 1);

            $name = $this->removeDuplicateVar($name);

            $clone->setTargetPath(str_replace('*', $name, $this->output));
        } else {
            $clone = $this->clones[$asset];
        }

        // cascade filters
        foreach ($this->filters as $filter) {
            $clone->ensureFilter($filter);
        }

        return $clone;
    }
public function current ( $ raw = false ) { $ asset = current ( $ this -> assets ) ; if ( $ raw ) { return $ asset ; } // clone once if ( ! isset ( $ this -> clones [ $ asset ] ) ) { $ clone = $ this -> clones [ $ asset ] = clone $ asset ; // generate a target path based on asset name $ name = sprintf ( '%s_%d' , pathinfo ( $ asset -> getSourcePath ( ) , PATHINFO_FILENAME ) ? : 'part' , $ this -> key ( ) + 1 ) ; $ name = $ this -> removeDuplicateVar ( $ name ) ; $ clone -> setTargetPath ( str_replace ( '*' , $ name , $ this -> output ) ) ; } else { $ clone = $ this -> clones [ $ asset ] ; } // cascade filters foreach ( $ this -> filters as $ filter ) { $ clone -> ensureFilter ( $ filter ) ; } return $ clone ; }
Returns a copy of the current asset with filters and a target URL applied.

@param Boolean $raw Returns the unmodified asset if true

@return \Assetic\Asset\AssetInterface
Returns a copy of the current asset with filters and a target URL applied .