Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Conversation

@ryross
Copy link

@ryross ryross commented Sep 23, 2016

I wanted to get values from xsd:enumeration elements in my project and I saw that @demonkoryu had done work to add that feature. This repo has been updated a bit since @demonkoryu forked and added that feature so I took the liberty of merging the changes in, and added a feature to allow numeric constants, and an empty string constant.

Thoughts?

Tobias Hoffmann and others added 13 commits May 29, 2015 18:35
* goetasmaster: (37 commits)
  2.1 branch
  Fix tests for the latest runtime
  Fixed dependencies that should allow to use the official jms serializer
  added group check
  readme.md fix
  misspell and additional requirement added to make serializer example works
  use semantic version install
  Update .scrutinizer.yml
  test fix
  symfony is not needed
  Referenced elements should receive the namespace of the scheme of the element that's being referenced.
  Updated doc
  re format all the code
  Move to https://github.com/goetas-webservices/xsd-reader
  Fixed some dependencies
  Fixed code coverage upload
  split xsd2php into two components, xsd2php and xsd2php runtime
  split repo, dymanic part goes on xsd2php-runtime
  new jms serializer require php 5.5
  added support for serializer 1.0
  ...

# Conflicts:
#	composer.json
#	lib/Php/ClassGenerator.php
#	lib/Php/PhpConverter.php
#	lib/Php/Structure/PHPClass.php
@ryross
Copy link
Author

ryross commented Sep 23, 2016

For the record, here's the issue where I found out about the fork: #35

And here's the fork: https://github.com/rtsde/xsd2php

@goetas
Copy link
Owner

goetas commented Sep 24, 2016

Tests are failing

@discordier
Copy link
Contributor

I wonder how the test may fail, in the end, this is simply the second PHP 5.5 build with prefer lowest and it can't call a method which should be available in Zend ClassGenerator.
The test SHOULD pass unless composer pulled a broken version of Zend framework

@goetas
Copy link
Owner

goetas commented Sep 28, 2016

add constant was added in 2.4. the minimum is 2.3 at the moment

@discordier
Copy link
Contributor

I see, the prefer-lowest is the culprit

@discordier
Copy link
Contributor

@goetas So what is the way to go now?
Wrap the addConstant with if (method_exists()) or bump the min req?

@goetas
Copy link
Owner

goetas commented Oct 22, 2016

In previous version of the library i had this feature, but i have removed it (and added) many times.
So at the moment I'm not propense to accept this PR.

Talking for my self, I found out that having constants does not provide a real advantage, and there are so many edge cases that can not be handled.
Plus there is not a real way to enforce PHP to use constants, instead of hardcoded strings.. (maybe value objects?)
At the end, in some of the latest iterations i have decided simply to not implement it. (unless someone proposes a really good solution obviously).

Keeping this open anyway. Maybe a great solution will pop up one day :)

Ah, as it stands in the readme, I'm moving the development to https://github.com/goetas-webservices/xsd2php

* enumeration-cdata-fix:
  make enumeration elements not use CDATA
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants