Skip to content

Commit 69b05de

Browse files
Tweaks
1 parent 751cb13 commit 69b05de

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/HTMLMinServiceProvider.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function setupConfig(Application $app)
6767
*/
6868
protected function enableBladeOptimisations(Application $app)
6969
{
70-
$app['view']->getEngineResolver()->register('blade', function () use ($app) {
70+
$app->view->getEngineResolver()->register('blade', function () use ($app) {
7171
$compiler = $app['htmlmin.compiler'];
7272

7373
return new CompilerEngine($compiler);
@@ -85,8 +85,8 @@ protected function enableBladeOptimisations(Application $app)
8585
*/
8686
protected function enableLiveOptimisations(Application $app)
8787
{
88-
$app['router']->after(function ($request, $response) use ($app) {
89-
$app['htmlmin']->live($response);
88+
$app->router->after(function ($request, $response) use ($app) {
89+
$app->htmlmin->live($response);
9090
});
9191
}
9292

@@ -99,8 +99,8 @@ protected function enableLiveOptimisations(Application $app)
9999
*/
100100
protected function setupFilters(Application $app)
101101
{
102-
$app['router']->filter('htmlmin', function ($route, $request, $response) use ($app) {
103-
$app['htmlmin']->live($response);
102+
$app->router->filter('htmlmin', function ($route, $request, $response) use ($app) {
103+
$app->htmlmin->live($response);
104104
});
105105
}
106106

@@ -180,7 +180,7 @@ protected function registerHtmlMinifier(Application $app)
180180
protected function registerBladeMinifier(Application $app)
181181
{
182182
$app->singleton('htmlmin.blade', function ($app) {
183-
$force = $app['config']['graham-campbell/htmlmin::force'];
183+
$force = $app->config->get('html.force', false);
184184

185185
return new Minifiers\BladeMinifier($force);
186186
});
@@ -200,7 +200,7 @@ protected function registerMinifyCompiler(Application $app)
200200
$app->singleton('htmlmin.compiler', function ($app) {
201201
$blade = $app['htmlmin.blade'];
202202
$files = $app['files'];
203-
$storagePath = $app['config']['view.compiled'];
203+
$storagePath = $app->get('view.compiled');
204204

205205
return new Compilers\MinifyCompiler($blade, $files, $storagePath);
206206
});

tests/Functional/BladeEnabledTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class BladeEnabledTest extends AbstractFunctionalTestCase
2929
*/
3030
protected function additionalSetup($app)
3131
{
32-
$app['config']->set('graham-campbell/htmlmin::blade', true);
32+
$app->config->set('htmlmin.blade', true);
3333
}
3434

3535
public function testNewSetup()
3636
{
37-
$this->app['view']->addNamespace('stubs', realpath(__DIR__.'/stubs'));
37+
$this->app->view->addNamespace('stubs', realpath(__DIR__.'/stubs'));
3838

39-
$actual = $this->app['view']->make('stubs::test')->render();
39+
$actual = $this->app->view->make('stubs::test')->render();
4040

4141
$expected = file_get_contents(__DIR__.'/stubs/blade.txt');
4242

tests/Functional/FilterEnabledTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class FilterEnabledTest extends AbstractFunctionalTestCase
2020
{
2121
public function testNewSetup()
2222
{
23-
$this->app['view']->addNamespace('stubs', realpath(__DIR__.'/stubs'));
23+
$this->app->view->addNamespace('stubs', realpath(__DIR__.'/stubs'));
2424

25-
$this->app['router']->get('htmlmin-test-route', ['after' => 'htmlmin', function () {
26-
return $this->app['view']->make('stubs::test');
25+
$this->app->router->get('htmlmin-test-route', ['after' => 'htmlmin', function () {
26+
return $this->app->view->make('stubs::test');
2727
}]);
2828

2929
$actual = $this->call('GET', 'htmlmin-test-route')->getContent();

tests/Functional/LiveEnabledTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class LiveEnabledTest extends AbstractFunctionalTestCase
3131
*/
3232
protected function additionalSetup($app)
3333
{
34-
$app['config']->set('graham-campbell/htmlmin::live', true);
34+
$app->config->set('htmlmin.live', true);
3535
}
3636

3737
public function testNewSetup()
3838
{
39-
$this->app['view']->addNamespace('stubs', realpath(__DIR__.'/stubs'));
39+
$this->app->view->addNamespace('stubs', realpath(__DIR__.'/stubs'));
4040

41-
$this->app['router']->get('htmlmin-test-route', function () {
41+
$this->app->router->get('htmlmin-test-route', function () {
4242
return Response::view('stubs::test');
4343
});
4444

@@ -51,7 +51,7 @@ public function testNewSetup()
5151

5252
public function testRedirect()
5353
{
54-
$this->app['router']->get('htmlmin-test-route', function () {
54+
$this->app->router->get('htmlmin-test-route', function () {
5555
return Redirect::to('foo');
5656
});
5757

@@ -62,7 +62,7 @@ public function testRedirect()
6262

6363
public function testJson()
6464
{
65-
$this->app['router']->get('htmlmin-test-route', function () {
65+
$this->app->router->get('htmlmin-test-route', function () {
6666
return Response::json(['foo' => 'bar', ['baz']], 200, [], JSON_PRETTY_PRINT);
6767
});
6868

0 commit comments

Comments
 (0)