Skip to content

Commit 8d3b877

Browse files
committed
PHPStan level 6
1 parent 820b1df commit 8d3b877

File tree

6 files changed

+18
-4
lines changed

6 files changed

+18
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PHPFUI\HTMLUnitTester [![Tests](https://github.com/phpfui/HTMLUnitTester/actions/workflows/tests.yml/badge.svg)](https://github.com/phpfui/HTMLUnitTester/actions?query=workflow%3Atests) [![Latest Packagist release](https://img.shields.io/packagist/v/phpfui/html-unit-tester.svg)](https://packagist.org/packages/phpfui/html-unit-tester)
1+
# PHPFUI\HTMLUnitTester [![Tests](https://github.com/phpfui/HTMLUnitTester/actions/workflows/tests.yml/badge.svg)](https://github.com/phpfui/HTMLUnitTester/actions?query=workflow%3Atests) [![Latest Packagist release](https://img.shields.io/packagist/v/phpfui/html-unit-tester.svg)](https://packagist.org/packages/phpfui/html-unit-tester) ![](https://img.shields.io/badge/PHPStan-level%206-brightgreen.svg?style=flat)
22

33
[PHPUnit](https://phpunit.de/) Testing extensions for HMTL and CSS. **PHPFUI\HTMLUnitTester** allows you to unit test HTML and CSS for errors and warnings. Often simple errors in HTML or CSS create hard to debug issues where a simple check will reveal bad code.
44

composer.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
"php": ">=7.4 <8.2",
1616
"rexxars/html-validator": ">=2.2"
1717
},
18+
"config": {
19+
"platform": {
20+
"php": "7.4"
21+
}
22+
},
1823
"require-dev": {
1924
"phpunit/phpunit": "^7.0 | <10.0",
2025
"phpfui/phpunit-syntax-coverage": ">=1.0",
2126
"roave/security-advisories": "dev-latest",
22-
"friendsofphp/php-cs-fixer": "^3.2"
27+
"friendsofphp/php-cs-fixer": "^3.2",
28+
"phpstan/phpstan": "^1.8"
2329
},
2430
"autoload": {
2531
"psr-4": {"PHPFUI\\HTMLUnitTester\\": "src/PHPFUI/HTMLUnitTester/"}

phpstan.neon.dist

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
level: 6
3+
errorFormat: raw
4+
editorUrl: '%%file%% %%line%% %%column%%: %%error%%'
5+
paths:
6+
- src
7+
- tests

src/PHPFUI/HTMLUnitTester/Extensions.php

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public function assertValidCss(string $css, string $message = '') : void
8484
* Validate all files in a directory.
8585
*
8686
* @param string $type one of 'Valid' (html), 'NotWarning' (html), 'ValidCSS', or 'NotWarningCSS'
87+
* @param array<string> $extensions
8788
*/
8889
public function assertDirectory(string $type, string $directory, string $message = '', bool $recurseSubdirectories = true, array $extensions = ['.css']) : void
8990
{

src/PHPFUI/HTMLUnitTester/Throttle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function delay() : void
4949

5050
if ($timeDifference < $this->microseconds)
5151
{
52-
\usleep(($this->microseconds - $timeDifference) * 1000000.0);
52+
\usleep((int)(($this->microseconds - $timeDifference) * 1000000.0));
5353
}
5454
$this->lastAccessed = $now = \microtime(true);
5555
}

tests/bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function classNameExists(string $className) : string
1414
return \file_exists($path) ? $path : '';
1515
}
1616

17-
function autoload($className) : void
17+
function autoload(string $className) : void
1818
{
1919
$path = \classNameExists($className);
2020

0 commit comments

Comments
 (0)