Skip to content

DCOM-93 - Add ReflectionService and RuntimeReflectionService, change Cla... #89

Merged
merged 4 commits into from Dec 29, 2011

5 participants

@beberlei
Doctrine member

...ssMetadata to use it and ClassMetadataFactory to delegate reflection init/wakup to metadata. This way we can remove the ClassMetadata + ClassMetadataInfo double madness in all the managers.

beberlei added some commits Dec 29, 2011
@beberlei beberlei DCOM-93 - Add ReflectionService and RuntimeReflectionService, change …
…ClassMetadata to use it and ClassMetadataFactory to delegate reflection init/wakup to metadata. This way we can remove the ClassMetadata + ClassMetadataInfo double madness in all the managers.
80cd74e
@beberlei beberlei DCOM-93 - Fix typo 6150024
@guilhermeblanco

Shouldn't it be wakeUpReflection?

Doctrine member

yes

@guilhermeblanco

Util is not a good namespace to place such an important Mapping feature.
I'd rather create a subnamespace inside of Mapping for that (Reflection is my suggestion).

Doctrine member

This feature has nothing to do with mapping Its just a simple abstraction/factory for the reflection stuff.

@guilhermeblanco

I didn't like the *Service here. The purpose of this class contract is not to expose a Service, but rather a Implementor.
My naming suggestion for this interface is "Implementor".

Doctrine member

by that reason every reason would be named "implementor". I don't like that name, it conveys no further meaning.

@guilhermeblanco

Following the same idea of the other class, this class would be called:

Doctrine\Common\Mapping\Reflection\RuntimeReflectionImplementor

Doctrine member

Do you plan to provide a cache based reflection service? Otherwise a class with some static methods should be enough, no?

@beberlei beberlei merged commit 44ca64d into master Dec 29, 2011
@suxxes
suxxes commented Jan 19, 2012

Why is "getClass" in "StaticReflectionService", while stating it should return ReflectionClass|null, returns always null, which leads to generate:entities in Symfony2 not working? Shouldn't it be something like that instead (which is working)?

return $class ? new \ReflectionClass($class) : null;
@stof
Doctrine member
stof commented Jan 19, 2012

because this implementation is meant to be used in the EntityGenerator, when the class does not exist yet. So it cannot return a Reflection in such place (you would have an exception)

@suxxes
suxxes commented Jan 19, 2012

So this seems to be a temporary Symfony2 issue.

@stof
Doctrine member
stof commented Jan 19, 2012

@suxxes btw, which version of Symfony are you using ? 2.0.x or master ?

@suxxes
suxxes commented Jan 19, 2012

@stof in this case it's an s-s edition, which is the master for Symfony2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.