🔖 Feature description
Add a generic wrap(width, prefix) Twig filter to SDK.php that wraps a string to a given column width and prefixes each line with a given string. It will replace 10+ near-identical hardcoded comment filters spread across language classes and templates.
🎤 Pitch
Right now, the same wordwrap() logic is copy-pasted in around 8-10 places across the codebase, each hardcoded to a specific comment prefix: like in SDK.php, Web.php, Swift.php etc...
Also, 24 Twig templates (Kotlin, Android, Web, Node, React Native) do comment prefixing inline with replace({"\n": "\n * "}), which does not word-wrap at all. A single generic filter would fix all of this.
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
🔖 Feature description
Add a generic
wrap(width, prefix)Twig filter toSDK.phpthat wraps a string to a given column width and prefixes each line with a given string. It will replace 10+ near-identical hardcoded comment filters spread across language classes and templates.🎤 Pitch
Right now, the same
wordwrap()logic is copy-pasted in around 8-10 places across the codebase, each hardcoded to a specific comment prefix: like in SDK.php, Web.php, Swift.php etc...Also, 24 Twig templates (Kotlin, Android, Web, Node, React Native) do comment prefixing inline with
replace({"\n": "\n * "}), which does not word-wrap at all. A single generic filter would fix all of this.👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?