-
Notifications
You must be signed in to change notification settings - Fork 95
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
[FEATURE] Command to generate XSD Schemas for ViewHelpers #876
Conversation
13073c3
to
f23b8d5
Compare
f23b8d5
to
9288a5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not through with the code-review yet. Nevertheless here already some comments. Hope it helps.
[TASK] Use ::class syntax for existing fixture classes
[TASK] Render deprecation as phpdoc instead of RST
🥳 |
I'm unhappy with the implementation as it lacks the namespace parameter which exited before 😢 Before I had individual calls to generate the schema files for each extension individually of my project which doesn't work now anymore. It also crashes for 3rd party extensions: #1005 |
This feature is a re-implementation of the XSD schema generator, which was previously
available as a separate package 1. These schema files provide auto-complete in IDEs
(like PHPStorm) for all available ViewHelpers in a composer project.
The
bin/fluid
CLI command now supports the additional commandschema
, which scansthe whole composer projects for valid ViewHelper classes. The class in question needs
to meet the following requirements, which enforces already-existing conventions:
ViewHelper.php
ViewHelpers
, which serves as a divider betweena Fluid namespace and its ViewHelpers
ViewHelper
These conditions are checked by
ViewHelperMetadataFactory
, which then creates thecorresponding
ViewHelperMetadata
value object. TheSchemaGenerator
then receivesa list of
ViewHelperMetadata
objects as well as an XML namespace (likehttp://typo3.org/ns/TYPO3Fluid/Fluid/ViewHelpers
) and generates an xsd schema filethat describes the ViewHelper and its arguments. The
ConsoleRunner
collects these files, creates unique file names and writes them asschema_*.xsd
files to the destinationfolder, specified with
--destination
.IDEs either pick up those files automatically or need to be configured manually to
do so.
Footnotes
https://github.com/TYPO3/Fluid.SchemaGenerator/ ↩