Skip to content

Commit

Permalink
Merge pull request #24 from erikgaal/patch-2
Browse files Browse the repository at this point in the history
Allow whitespace in type definitions
  • Loading branch information
rubenvanassche authored Apr 6, 2022
2 parents 1371bb8 + d2603f5 commit 58448ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/TypeReflectors/MethodParameterTypeReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function getDocblock(): string

protected function docblockRegex(): string
{
return "/@param ((?:(?:[\\w?|\\\\<>,])+(?:\\[])?)+) \\\${$this->reflection->getName()}/";
return "/@param ((?:\\s?[\\w?|\\\\<>,]+(?:\\[])?)+) \\\${$this->reflection->getName()}/";
}

protected function getReflectionType(): ?ReflectionType
Expand Down
2 changes: 1 addition & 1 deletion src/TypeReflectors/MethodReturnTypeReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function getDocblock(): string

protected function docblockRegex(): string
{
return '/@return ((?:(?:[\w?|\\\\<>,])+(?:\[])?)+)/';
return '/@return ((?:\s?[\w?|\\\\<>,]+(?:\[])?)+)/';
}

protected function getReflectionType(): ?ReflectionType
Expand Down
2 changes: 1 addition & 1 deletion src/TypeReflectors/PropertyTypeReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function getDocblock(): string

protected function docblockRegex(): string
{
return '/@var ((?:(?:[\w?|\\\\<>,])+(?:\[])?)+)/';
return '/@var ((?:\s?[\\w?|\\\\<>,]+(?:\[])?)+)/';
}

protected function getReflectionType(): ?ReflectionType
Expand Down

0 comments on commit 58448ff

Please sign in to comment.