Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ParserException #514

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Fix ParserException #514

merged 1 commit into from
Mar 31, 2020

Conversation

leo108
Copy link
Contributor

@leo108 leo108 commented Mar 31, 2020

$this->stringResolver->resolve($column->readableType) will throw a PHPStan\PhpDocParser\Parser\ParserException if $column->readableType is 0|1

>    PHPStan\PhpDocParser\Parser\ParserException  : Unexpected token "0", expected type at offset 0
> 
>   at phar:///Users/xxxxxxx/vendor/phpstan/phpstan/phpstan/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php:132
>     128|      * @throws \PHPStan\PhpDocParser\Parser\ParserException
>     129|      */
>     130|     private function throwError(int $expectedTokenType) : void
>     131|     {
>   ->132|         throw new \PHPStan\PhpDocParser\Parser\ParserException($this->currentTokenValue(), $this->currentTokenType(), $this->currentTokenOffset(), $expectedTokenType);
>     133|     }
>     134| }
>     135|
> 
>   Exception trace:
> 
>   1   PHPStan\PhpDocParser\Parser\TokenIterator::throwError()
>       phar:///Users/xxxxxxx/vendor/phpstan/phpstan/phpstan/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php:59
> 
>   2   PHPStan\PhpDocParser\Parser\TokenIterator::consumeTokenType()
>       phar:///Users/xxxxxxx/vendor/phpstan/phpstan/phpstan/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php:39

Copy link
Collaborator

@canvural canvural left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for this?

You can add a new boolean column to one of the migrations and add a test case if it returns boolean.

@canvural
Copy link
Collaborator

Thank you! Looks good.

@canvural canvural merged commit b25b156 into larastan:master Mar 31, 2020
@nunomaduro
Copy link
Collaborator

@canvural Thanks for being like that. Having tests every change is really what makes software solid.

@leo108 leo108 deleted the patch-2 branch August 13, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants