protected function saveToFile($data, $filePath)
    {
        $fileContent = "<?php\nreturn " . VarDumper::export($data) . ";\n";
        $self = $this;
        return Reaction\Helpers\FileHelperAsc::putContents($filePath, $fileContent, 'cwt')->then(
            function() use ($self, $filePath) {
                $self->invalidateScriptCache($filePath);
            }
        );
    }