-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support for array shape descriptions - Copy changes from jdpedrie/Sami ? #13
Comments
Hi @williamdes, Here is the comparison of changes I made. I'd love to help get it added here, but my free time is limited at the moment. I may be able to work on it in the near future, but not right now. Additionally, I doubt my changes would meet the acceptable standards for the library! It is sort of a hack that I made without deep knowledge of Sami. For anyone curious, here is an example of what my change handles, and here is the output. |
Hi @jdpedrie |
That would be great! Please let me know if I can help with review or testing, and again if I find some time I'll let you know and try to jump back in with more concrete assistance. |
Psalm also has a custom format, this should be implemented too I think |
I'm agnostic as to the format supported, except unless I've missed something, these formats don't appear to support array member descriptions, which is a requirement for us. I'd love to provide documentation in a format recognized by static analyzers, so long as we can also provide the descriptions. |
@muglug @ondrejmirtes do you have some suggestions on this idea ? |
Sorry, I don't know what the question is about, can you rephrase it in such a way so I can respond? |
Sorry for that, here is the question: Actually the world has array shapes for array phpdocs, but no description. The changes @jdpedrie had made where to support this syntax Example render: https://googleapis.github.io/google-auth-library-php/master/Google/Auth/AccessToken.html#method_verify * @param array $options [optional] Configuration options.
* @param string $options.audience The indended recipient of the token.
* @param string $options.issuer The intended issuer of the token.
* @param string $options.cacheKey The cache key of the cached certs. Defaults to
* the sha1 of $certsLocation if provided, otherwise is set to
* "federated_signon_certs_v3".
* So, what do you think would be best for the PHP world @ondrejmirtes ? The goal is not to support a different syntax for each dev of course, but more to find a good description syntax. TLDR: we have array shape type syntax, but no way to describe them |
If you have such advanced needs, you should really use objects and properties instead of array shapes. Sorry, I'm not interested in extending the syntax beyond what it does now. |
Would love to see support for array-shapes using the PHPStan has a great phpdoc-parser library that is separate from the core of the analyzer that could make keeping up with conventions simpler in the long run, whilst also minimizing differences between tools that are consuming the same data source. It would probably take more work upfront to move to using a separate library for the parsing, but it would be simpler to keep up-to-date and consistent. Perhaps a goal for the next major release? Anyway, thanks for your continued work on doctum, i look forwards to the addition of support for array shapes, however you decide to make it work :) |
Well, I already tried to migrate to this cool lib but phpstan/phpdoc-parser#72 was blocking me and it seems like @ondrejmirtes would not want to alter the lib because it is an internal tool, I understand the point. I would love to see this syntax supported soon, just need to find the right lib to make it work |
This just got merged: phpDocumentor/ReflectionDocBlock#343 So array shapes will be official in Doctum soon (normally). |
Hi @jdpedrie
You made changes on https://github.com/jdpedrie/Sami and implemented them for https://github.com/googleapis/google-api-php-client
You you mind implementing them here ?
The text was updated successfully, but these errors were encountered: