Skip to content

Commit 82ca3d0

Browse files
committed
phpstan max
1 parent 67e3316 commit 82ca3d0

File tree

5 files changed

+66
-15
lines changed

5 files changed

+66
-15
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
},
1717
"require-dev": {
1818
"phpunit/phpunit": "^8.0 | ^9.0",
19-
"squizlabs/php_codesniffer": "^3.0"
19+
"squizlabs/php_codesniffer": "^3.0",
20+
"phpstan/phpstan": "^0.12.50"
2021
},
2122
"autoload" : {
2223
"psr-4" : {

composer.lock

Lines changed: 61 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CliRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(array $renderers, array $inlineRenderers, Color $col
4646

4747
/**
4848
* @param string $string
49-
* @param array|string $colourOrStyle
49+
* @param array<string>|string $colourOrStyle
5050
*
5151
* @return string
5252
*

src/Renderer/FencedCodeRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(array $syntaxHighlighters = [])
3131
* @param string $language
3232
* @param SyntaxHighlighterInterface $highlighter
3333
*/
34-
public function addSyntaxHighlighter(string $language, SyntaxHighlighterInterface $highlighter)
34+
public function addSyntaxHighlighter(string $language, SyntaxHighlighterInterface $highlighter): void
3535
{
3636
$this->highlighters[$language] = $highlighter;
3737
}

src/Renderer/HorizontalRuleRenderer.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
class HorizontalRuleRenderer implements CliBlockRendererInterface
1515
{
16-
1716
/**
1817
* @var int
1918
*/
@@ -22,17 +21,8 @@ class HorizontalRuleRenderer implements CliBlockRendererInterface
2221
/**
2322
* @param int $width
2423
*/
25-
public function __construct($width = 30)
24+
public function __construct(int $width = 30)
2625
{
27-
if (!is_int($width)) {
28-
throw new \InvalidArgumentException(
29-
sprintf(
30-
'Width should be an integer. Got: "%s"',
31-
is_object($width) ? get_class($width) : gettype($width)
32-
)
33-
);
34-
}
35-
3626
$this->width = $width;
3727
}
3828

0 commit comments

Comments
 (0)