Skip to content

Commit 96eb1d1

Browse files
committed
Fix typehints for indent width and style
split: d571de437343cd07204de0510ff9b3dd86253522
1 parent 27c47aa commit 96eb1d1

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Lexer/Partial/IndentStyleTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ trait IndentStyleTrait
2323
/**
2424
* Returns the currently used indentation style.
2525
*
26-
* @return string
26+
* @return string|null
2727
*/
2828
public function getIndentStyle()
2929
{
@@ -36,7 +36,7 @@ public function getIndentStyle()
3636
* The value needs to be one of the `Lexer::INDENT_*` constants, but you can also just
3737
* pass either a single space or a single tab for the respective style.
3838
*
39-
* @param $indentStyle
39+
* @param string|null $indentStyle
4040
*
4141
* @return $this
4242
*/
@@ -56,7 +56,7 @@ public function setIndentStyle($indentStyle)
5656
/**
5757
* Returns the currently used indentation width.
5858
*
59-
* @return int
59+
* @return int|null
6060
*/
6161
public function getIndentWidth()
6262
{
@@ -68,7 +68,7 @@ public function getIndentWidth()
6868
*
6969
* The value of this specifies if e.g. 2 spaces make up one indentation level or 4.
7070
*
71-
* @param $indentWidth
71+
* @param int|null $indentWidth
7272
*
7373
* @return $this
7474
*/

Lexer/State.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public function createToken($className)
329329
return new $className(
330330
$this->createCurrentSourceLocation(),
331331
$this->level,
332-
str_repeat((string) $this->getIndentStyle(), $this->getIndentWidth())
332+
str_repeat((string) $this->getIndentStyle(), (int) $this->getIndentWidth())
333333
);
334334
}
335335

0 commit comments

Comments
 (0)