Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Machy8 committed Sep 23, 2017
2 parents dce3a12 + a4639c1 commit 67626cb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
47 changes: 27 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

# Google Closure Compiler
[![Build Status](https://travis-ci.org/Machy8/google-closure-compiler.svg?branch=master)](https://travis-ci.org/Machy8/google-closure-compiler)
[![Coverage Status](https://coveralls.io/repos/github/Machy8/google-closure-compiler/badge.svg?branch=master)](https://coveralls.io/github/Machy8/google-closure-compiler?branch=master)
[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/Machy8/google-closure-compiler/blob/master/license.md)

⚡ PHP client for the [Google Closure Compiler](https://closure-compiler.appspot.com/home) API in one file.

## Requirements
- PHP 7.0+
- If you use Nette Framework - v2.3+
Expand Down Expand Up @@ -28,29 +35,29 @@ if ($compiled) {
*Nette framework:*
```PHP

use GoogleClosureCompiler\Compiler;

/**
* @var Compiler
*/
private $compiler;

public function __construct(Compiler $compiler)
{
$this->compiler = $compiler;
}

public function renderDefault()
{
$code = file_get_contents('/path/to/script.js');
$this->template->jsCode = $this->compiler->setJsCode($code)->compiler();
}
use GoogleClosureCompiler\Compiler;

/**
* @var Compiler
*/
private $compiler;


public function __construct(Compiler $compiler)
{
$this->compiler = $compiler;
}


public function renderDefault()
{
$code = file_get_contents('/path/to/script.js');
$this->template->jsCode = $this->compiler->setJsCode($code)->compile();
}
```

And in the config neon
```
extensions:
- GoogleClosureCompiler\Bridges\CompilerNette\GoogleClosureCompilerExtension
```
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "machy8/google-closure-compiler",
"description": "PHP client for the Google Closure Compiler API in one file.",
"description": "PHP client for the Google Closure Compiler API in one file.",
"keywords": ["javascript", "minification", "compress", "google", "api", "php", "closure"],
"license": "New BSD License",
"require": {
Expand Down

0 comments on commit 67626cb

Please sign in to comment.