fix: add url to the ClassParser for twig templates by soyuka · Pull Request #37 · php-documentation-generator/php-documentation-generator · GitHub
Skip to content

fix: add url to the ClassParser for twig templates - #37

Open
soyuka wants to merge 1 commit into
php-documentation-generator:mainfrom
soyuka:fix/class-parser-url
Open

soyuka wants to merge 1 commit into
php-documentation-generator:mainfrom
soyuka:fix/class-parser-url

Conversation

@soyuka

@soyuka soyuka commented Feb 14, 2023

Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think injecting the url argument in parsers is a good design. Parsers are designed to be created with a single Reflection object from any place. Adding this url argument will impose to carry it from parser to parser.

ClassParser objects are created:

  • in Twig extensions
  • in parsers: TypeParser, ClassParser, MethodParser
  • in Commands

As the url is dedicated for rendering the view, converting the parser object as a view object (handling this url argument) and injecting it to the view might be better, as you suggested.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this type for?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants