Skip to content

Commit 3761e48

Browse files
authored
Applied fixes from StyleCI (#1)
1 parent 99b16fa commit 3761e48

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

src/Http2ServerPushMiddleware.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
use Illuminate\Http\Request;
77

88
/**
9-
* Class Http2ServerPushMiddleware
10-
* @package TomSchlick\ServerPush
9+
* Class Http2ServerPushMiddleware.
1110
*/
1211
class Http2ServerPushMiddleware
1312
{
@@ -16,6 +15,7 @@ class Http2ServerPushMiddleware
1615
/**
1716
* @param Request $request
1817
* @param Closure $next
18+
*
1919
* @return mixed
2020
*/
2121
public function handle(Request $request, Closure $next)
@@ -31,7 +31,7 @@ public function handle(Request $request, Closure $next)
3131

3232
protected function addServerPushHeaders()
3333
{
34-
if(app('server-push')->hasLinks()) {
34+
if (app('server-push')->hasLinks()) {
3535
$link = implode(',', app('server-push')->generateLinks());
3636
$this->response->headers->set('Link', $link, true);
3737
}

src/HttpPush.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
<?php
22

3-
43
namespace TomSchlick\ServerPush;
54

6-
75
/**
8-
* Class HttpPush
9-
* @package TomSchlick\ServerPush
6+
* Class HttpPush.
107
*/
118
class HttpPush
129
{
@@ -39,7 +36,7 @@ public function generateLinks() : array
3936
$links = [];
4037

4138
foreach ($this->resources as $row) {
42-
$links[] = '<' . $row['path'] . '>; rel=preload; as=' . $row['type'];
39+
$links[] = '<'.$row['path'].'>; rel=preload; as='.$row['type'];
4340
}
4441

4542
return $links;

src/ServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
66

77
/**
8-
* Class ServiceProvider
9-
* @package TomSchlick\ServerPush
8+
* Class ServiceProvider.
109
*/
1110
class ServiceProvider extends BaseServiceProvider
1211
{
13-
1412
/**
1513
* Register the service provider.
1614
*

tests/HttpPushTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
use TomSchlick\ServerPush\HttpPush;
77

88
/**
9-
* Class HttpPushTest
10-
* @package TomSchlick\ServerPush\Tests
9+
* Class HttpPushTest.
1110
*/
1211
class HttpPushTest extends PHPUnit_Framework_TestCase
1312
{
@@ -35,7 +34,7 @@ public function test_add_resources_to_queue()
3534
[
3635
'path' => 'style.css',
3736
'type' => 'style',
38-
]
37+
],
3938
];
4039
$this->assertEquals($expected, $this->instance->resources);
4140
}
@@ -44,7 +43,7 @@ public function test_resource_generates_link_string()
4443
{
4544
$this->instance->queueResource('/assets/app.js.min', 'script');
4645

47-
$this->assertEquals("</assets/app.js.min>; rel=preload; as=script", $this->instance->generateLinks()[0]);
46+
$this->assertEquals('</assets/app.js.min>; rel=preload; as=script', $this->instance->generateLinks()[0]);
4847
}
4948

5049
public function test_clear_resources()
@@ -55,5 +54,4 @@ public function test_clear_resources()
5554
$this->instance->clear();
5655
$this->assertTrue(empty($this->instance->resources));
5756
}
58-
5957
}

0 commit comments

Comments
 (0)