Filter.php
public static function filterCoffeeScript(Node $node, $indent, $newLine)
    {

        if (!class_exists('CoffeeScript\\Compiler'))
            throw new Compiler\Exception(
                "Failed to compile CoffeeScript: "
                ."Please install the coffeescript/coffeescript composer package"
            );

        $js = \CoffeeScript\Compiler::compile($node->text(), [
            'header' => '',
            'filename' => 'Imported-at-('.$node->line.':'.$node->offset.').coffee'
        ]);

        return '<script>'.$newLine.$indent.$js.$newLine.$indent.'</script>';
    }
public static function filterCoffeeScript(Node $node, $indent, $newLine)
    {

        if (!class_exists('CoffeeScript\\Compiler'))
            throw new Compiler\Exception(
                "Failed to compile CoffeeScript: "
                ."Please install the coffeescript/coffeescript composer package"
            );

        $js = \CoffeeScript\Compiler::compile($node->text(), [
            'header' => '',
            'filename' => 'Imported-at-('.$node->line.':'.$node->offset.').coffee'
        ]);

        return '<script>'.$newLine.$indent.$js.$newLine.$indent.'</script>';
    }
public static function filterCoffeeScript ( Node $ node , $ indent , $ newLine ) { if ( ! class_exists ( 'CoffeeScript\\Compiler' ) ) throw new Compiler \ Exception ( "Failed to compile CoffeeScript: " . "Please install the coffeescript/coffeescript composer package" ) ; $ js = \ CoffeeScript \ Compiler :: compile ( $ node -> text ( ) , [ 'header' => '' , 'filename' => 'Imported-at-(' . $ node -> line . ':' . $ node -> offset . ').coffee' ] ) ; return '<script>' . $ newLine . $ indent . $ js . $ newLine . $ indent . '</script>' ; }
Compiles the CoffeeScript content to JavaScript

@param Node   $node    the node to be compiled
@param string $indent  the indentation to use on each child
@param string $newLine the new-line to append after each line

@return string the wrapped JavaScript-HTML-string
@throws Compiler\Exception when the CoffeeScript package is not installed
Compiles the CoffeeScript content to JavaScript