Ruud Kamphuis

Results 363 comments of Ruud Kamphuis

Smart. Turns out it is for stuff like this: ```php $value = null; $callback = function () use (&$value) : void { $value = new DateTime(); }; assertType('DateTime|null', $value); assertNativeType('DateTime|null',...

It does something, but there is a problem that the scope gets corrupted, before the assigns are done. See line 11, that one should not be `Ruud` at that point....

Some alternative flavors: https://phpstan.org/r/5bbbd12f-b9ba-4115-9f43-cd67804aeaf7 https://phpstan.org/r/a12de121-e07e-4f93-a0c8-04dfbfb82e68

Why doesn't PHPUnit warn / error about this?

@Haehnchen Would it be possible to make the types in `{% types %}` clickable too? For example: ```twig {% types { payment: 'App\Payment', } %} ``` I'd like to CMD...

If I may suggest: instead of deciding the possible var type values, why not accept any valid PHPDoc type. Together with [PHPStan's PHPDoc Parser](https://github.com/phpstan/phpdoc-parser) we can parse them into PhpDocNode's...

```twig {% var variable Type %} ``` I think that the order should be the [same as with inline PHPDocs](https://phpstan.org/writing-php-code/phpdocs-basics#inline-%40var): ```twig {% var Type variable %} ```

> We could also consider an optional description. [phpDocumentor supports this](https://docs.phpdoc.org/2.9/references/phpdoc/tags/var.html#), but PHPStan doesn't seem to. What's the point of providing a description there? The reason why PHPStan doesn't support...

`boolean` is a valid PHPStan type, but `number` is not. See https://phpstan.org/writing-php-code/phpdoc-types Can we maybe update the example, to not use a `number` instead? [TwigStan](https://github.com/twigstan/twigstan) will only accept PHPStan types,...

The documentation is not up to date. PHPStan _does_ properly understand `number` 🎉 I'll fix the docs. See https://phpstan.org/r/24895f82-975a-4e08-b7b1-5da29d058ddd