Skip to content
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

RFC Deprecation descriptions markdowns renderer #54

Open
SerafimArts opened this issue Dec 22, 2017 · 0 comments
Open

RFC Deprecation descriptions markdowns renderer #54

SerafimArts opened this issue Dec 22, 2017 · 0 comments

Comments

@SerafimArts
Copy link
Member

SerafimArts commented Dec 22, 2017

type Example {
    field: String @deprecated(reason: """
Because:
- This is an example.
- Because I can!
""")
}

Current behaviour:

\var_dump($field->getDeprecationReason());

// string(...) "Because:\n- This is an example.\n- Because I can!"

Required behaviour:

\var_dump($field->getDeprecationReason());

// string(...) "Because:\n- This is an example.\n- Because I can!"

$renderer = new HtmlRenderer();
\var_dump($field->getDeprecationReason($renderer));

// string(...) "<p>Because:</p><ul><li>This is an example.</li><li>Because I can!</li></ul>"

The method signature must be updated:

public function getDeprecationReason(Renderer $renderer = null): string
{
    return $renderer ? $renderer->render(/* reason */) : /* reason */;
}

Related with:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant