Skip to content

Commit 0be3fe7

Browse files
committed
update dev dependencies
1 parent d0d6f00 commit 0be3fe7

File tree

6 files changed

+50
-20
lines changed

6 files changed

+50
-20
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ install:
1414
script:
1515
- composer run build
1616

17-
after_script:
18-
- php vendor/bin/coveralls -v
17+
after_success:
18+
- travis_retry php vendor/bin/php-coveralls -v

composer.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
"symfony/http-kernel": "^3.3|^4.0"
2727
},
2828
"require-dev": {
29-
"consistence/coding-standard": "2.2.1",
30-
"jakub-onderka/php-parallel-lint": "0.9.2",
31-
"matthiasnoback/symfony-config-test": "3.0.1",
32-
"matthiasnoback/symfony-dependency-injection-test": "2.2.0",
33-
"phpstan/phpstan-shim": "0.8.4",
34-
"phpunit/phpunit": "6.4.3",
35-
"satooshi/php-coveralls": "1.0.1"
29+
"consistence/coding-standard": "3.5",
30+
"jakub-onderka/php-parallel-lint": "1.0.0",
31+
"matthiasnoback/symfony-config-test": "4.0.0",
32+
"matthiasnoback/symfony-dependency-injection-test": "3.0.0",
33+
"phpstan/phpstan-shim": "0.10.5",
34+
"phpstan/phpstan-phpunit": "0.10",
35+
"phpunit/phpunit": "7.4.4",
36+
"php-coveralls/php-coveralls": "2.1.0"
3637
},
3738
"autoload": {
3839
"psr-4": {
@@ -64,7 +65,8 @@
6465
],
6566
"phplint": "parallel-lint src tests",
6667
"phpcs": "phpcs --standard=ruleset.xml src tests",
67-
"phpstan": "php vendor/phpstan/phpstan-shim/phpstan.phar analyse src tests --level 7 --no-progress",
68+
"phpcbf": "phpcbf --standard=ruleset.xml src tests",
69+
"phpstan": "php vendor/phpstan/phpstan-shim/phpstan.phar analyse -c phpstan.neon src tests --level 7 --no-progress",
6870
"phpunit": "phpunit"
6971
}
7072
}

phpstan.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
includes:
2+
- vendor/phpstan/phpstan-phpunit/extension.neon
3+
4+
parameters:
5+
ignoreErrors:
6+
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.#'

src/EventListener/JsErrorToAlertListener.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,24 @@ public function onKernelResponse(FilterResponseEvent $event): void
3030
return;
3131
}
3232

33-
if ($response->headers->has('Content-Type') && strpos($response->headers->get('Content-Type'), 'html') === false) {
34-
return;
33+
if ($response->headers->has('Content-Type')) {
34+
/** @var string $contentTypeHeader */
35+
$contentTypeHeader = $response->headers->get('Content-Type');
36+
if (strpos($contentTypeHeader, 'html') === false) {
37+
return;
38+
}
3539
}
3640

3741
if ($request->getRequestFormat() !== 'html') {
3842
return;
3943
}
4044

41-
if ($response->headers->has('Content-Disposition') && stripos($response->headers->get('Content-Disposition'), 'attachment;') !== false) {
42-
return;
45+
if ($response->headers->has('Content-Disposition')) {
46+
/** @var string $contentDispositionHeader */
47+
$contentDispositionHeader = $response->headers->get('Content-Disposition');
48+
if (stripos($contentDispositionHeader, 'attachment;') !== false) {
49+
return;
50+
}
4351
}
4452

4553
$this->injectScript($response, $request);

tests/DependencyInjection/JavaScriptErrorHandlerExtensionTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ class JavaScriptErrorHandlerExtensionTest extends AbstractExtensionTestCase
1212

1313
private const LISTENER_CLASS_NAME = JsErrorToAlertListener::class;
1414

15-
protected function getContainerExtensions()
15+
/**
16+
* @return \Symfony\Component\DependencyInjection\Extension\Extension[]
17+
*/
18+
protected function getContainerExtensions(): array
1619
{
1720
return [
1821
new JavaScriptErrorHandlerExtension(),

tests/EventListener/JsErrorToAlertListenerTest.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testIsSubscribedToKernelResponse(): void
2929
* @param string $responseBody
3030
* @param string $expectedResponse
3131
*/
32-
public function testInjectScript(string $responseBody, string $expectedResponse)
32+
public function testInjectScript(string $responseBody, string $expectedResponse): void
3333
{
3434
$listener = new JsErrorToAlertListener();
3535
$injectScriptReflection = new ReflectionMethod($listener, 'injectScript');
@@ -47,7 +47,7 @@ public function testInjectScript(string $responseBody, string $expectedResponse)
4747
* @param string $responseBody
4848
* @param string $expectedResponse
4949
*/
50-
public function testScriptIsInjected(string $responseBody, string $expectedResponse)
50+
public function testScriptIsInjected(string $responseBody, string $expectedResponse): void
5151
{
5252
$response = new Response($responseBody);
5353

@@ -103,7 +103,7 @@ public function htmlScriptDataProvider(): array
103103
* @dataProvider redirectCodesDataProvider
104104
* @param int $statusCode
105105
*/
106-
public function testScriptIsNotInjectedOnRedirection(int $statusCode)
106+
public function testScriptIsNotInjectedOnRedirection(int $statusCode): void
107107
{
108108
$response = new Response(self::BASIC_HTML, $statusCode);
109109

@@ -123,7 +123,10 @@ public function testScriptIsNotInjectedOnRedirection(int $statusCode)
123123
);
124124
}
125125

126-
public function redirectCodesDataProvider()
126+
/**
127+
* @return int[][]
128+
*/
129+
public function redirectCodesDataProvider(): array
127130
{
128131
return [
129132
[301],
@@ -253,6 +256,9 @@ public function testScriptIsNotInjectedOnNonHtmlContentType(): void
253256
);
254257
}
255258

259+
/**
260+
* @return \PHPUnit_Framework_MockObject_MockObject|\Symfony\Component\HttpKernel\Kernel
261+
*/
256262
protected function getKernelMock()
257263
{
258264
/** @var \Symfony\Component\HttpKernel\Kernel|\PHPUnit_Framework_MockObject_MockObject $kernelMock */
@@ -263,7 +269,12 @@ protected function getKernelMock()
263269
return $kernelMock;
264270
}
265271

266-
protected function getRequestMock($isXmlHttpRequest = false, $requestFormat = 'html')
272+
/**
273+
* @param bool $isXmlHttpRequest
274+
* @param string $requestFormat
275+
* @return \PHPUnit_Framework_MockObject_MockObject|\Symfony\Component\HttpFoundation\Request
276+
*/
277+
protected function getRequestMock(bool $isXmlHttpRequest = false, string $requestFormat = 'html')
267278
{
268279
/** @var \Symfony\Component\HttpFoundation\Request|\PHPUnit_Framework_MockObject_MockObject $request */
269280
$request = $this

0 commit comments

Comments
 (0)