Conversation
|
|
||
| class HashExtension extends AbstractExtension | ||
| { | ||
| private $hashes = []; |
There was a problem hiding this comment.
is it possible for us to force higher PHP version here and use its features, like strict type in this case? I'd go for the latest PHP 8.
There was a problem hiding this comment.
Technically possible, it's an internal tool.
Well, copied from an open source library afaik.
However, I'm not sure what versions of PHP our doc team have, and I'm not sure if we can just force PHP 8. PHP 7.4 would be more suitable?
There was a problem hiding this comment.
I propose #1898 as quick fix for PHP 7.4 as it doesn't work with 7.2 anymore.
For PHP 8.1+, I'll make a survey.
There was a problem hiding this comment.
We're all good with at least PHP 8.1
There was a problem hiding this comment.
Let's merge this w/ 7.4 and I'll continue my 8.1 PR afterward.
* Stabilized render of REST HTML * raml2html: Upgrade to PHP 7.4 (#1898)
* Stabilized render of REST HTML * raml2html: Upgrade to PHP 7.4 (#1898)
This PR ensures that HTML generated for REST API documentation remains the same across multiple re-renders.
What it basically does, it replaces the
uuidfunction usage withhashfunction. Since the context provided to the hashing function does not change, it ensures that each and every time the same ID string is generated.What we will need to see is if we ever encounter the same hash twice, as that would mean we have the same context in multiple locations. To prevent collision, all hashes are stored and rendering will fail if the same hash is generated twice.
Checklist