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

Not escaping */ in php comments #165

Open
tredvermtraud opened this issue Nov 20, 2023 · 0 comments
Open

Not escaping */ in php comments #165

tredvermtraud opened this issue Nov 20, 2023 · 0 comments

Comments

@tredvermtraud
Copy link

While using this amazing tool I noticed that Comments are parsed from xsd to php without escaping slashes ( / ).
Thus resulting in a broken class (which can easily be fixed by escaping the slash with a backslash ( \ ) ).

The following XSD:

<xs:element name="uuidUrsprungsnachricht" minOccurs="0" type="bdt:UUID">
  <xs:annotation>
    <xs:documentation>[...] xga:satz/xga:*/xga:uuid [...]</xs:documentation>
  </xs:annotation>
</xs:element>

Results in the following PHP:

  /**
   * [...] xga:satz/xga:*/xga:uuid [...].
   *
   * @var string $uuidUrsprungsnachricht
   */
  private $uuidUrsprungsnachricht = null;

It could be fixable by just adding a backslash before the slash

  /**
   * [...] xga:satz\/xga:*\/xga:uuid [...]
   *
   * @var string $uuidUrsprungsnachricht
   */
  private $uuidUrsprungsnachricht = null;

I have shortened the commentary and replaced it with [...] to prevent unnecessary bloating.
I assume a simple search and replace could be all that is needed to prevent this in the future?

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

No branches or pull requests

1 participant