-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
readonly flag should be set before setter, because the setter depends on that being set #154
Conversation
… on that being set
@@ -166,6 +166,11 @@ protected function loadMetadataFromFile(\ReflectionClass $class, $path) | |||
$pMetadata->xmlKeyValuePairs = 'true' === (string) $pElem->attributes()->{'xml-key-value-pairs'}; | |||
} | |||
|
|||
//we need read-only before setter and getter set, because that method depends on flag being set | |||
if (null !== $readOnly = $pElem->attributes()->{'read-only'}) { | |||
//$pMetadata->readOnly = 'true' === strtolower($readOnly); |
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.
Why is this line commented? There seems to be something wrong here. Could you add a test which covers this?
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.
aw. i was testing.... and it seems that I left it commented
@schmittjoh I have no idea on how to test, that the above is executed before setter and getter methods are called. |
Looking at it, the AnnotationDriver seems fine as we always call I'd suggest to add a simple config which has a read-only property and only a getter configured to the BaseDriver test. Currently, this should throw an exception. After your patch, it should not throw one. |
done |
@@ -159,14 +159,15 @@ public function loadMetadataForClass(\ReflectionClass $class) | |||
$propertyMetadata->xmlValue = true; | |||
} else if ($annot instanceof AccessType) { | |||
$AccessType = $annot->type; | |||
//we need ReadOnly before setter and getter set, because that method depends on flag being set |
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.
this comment should be removed. Moving it here does not ensure anything about the order in which the annotations are found
…erialization Fix XML null DateTime deserialization
No description provided.