Jeroen Versteeg
Jeroen Versteeg
> I think that the order should be the [same as with inline PHPDocs](https://phpstan.org/writing-php-code/phpdocs-basics#inline-%40var): Agreed. I've updated the OP. (While I prefer the original order, we should follow existing conventions.)...
> it would be nice to be able to provide a default value for any optional variables in the same place that I denote the type, replacing the need for...
> What's the point of providing a description there? The reason why PHPStan doesn't support it at that position is that the `@var` is already inside a comment. So you...
> > I personally actually disagree on principle: declaring the type and any value should not be mixed. > > @drjayvee can you explain more? @willrowe, absolutely! I should have...
> @drjayvee > > > {% var ?\Name\Space\ClassName baz %} > > What does it mean? What is `\Name\Space\ClassName` and how is such a type supposed to be declared? This...
@willrowe thanks for your detailed response. It does indeed appear we have slightly different use cases in mind. Documenting / specifying the template's context variables similar to function arguments is...
> @drjayvee thanks. How do you declare to the twig compiler that this class exist? Said differently, at compile-time, how is the compiler expected to check that this type exist?...
> @drjayvee you are explaining how the php implementation would work. But how would the other implementations work? More generally, from a specification point of view, how would `\Foo\Bar` be...
@willrowe > I think there are two different things we are talking about here in regards to a template's context variables: Oh, do I understand correctly that you'd want the...
@ericmorand > @drjayvee, what about other compiler implementations like twig.js or Twing? What would be the logic that they need to implement? I honestly wasn't aware of these! It's interesting...