-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add missing service properties #145
base: master
Are you sure you want to change the base?
Conversation
@@ -64,6 +64,19 @@ public function convert(ClassHierarchyMetadata $metadata) | |||
$definition->setTags($classMetadata->tags); | |||
$definition->setProperties($classMetadata->properties); | |||
|
|||
if (null !== $classMetadata->lazy) { | |||
$definition->setLazy($classMetadata->lazy); |
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.
Shouldn't there be a check for setLazy using method_exists (cf. initMethod below)?
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.
good idea, will commit a change.
Could you check the minor indentation issue that @stof mentioned? If you can have a look at why Travis fails that would cool too. |
Hey guys. I think we should write new Factory annotation like it was said here #115 |
@schmittjoh fixed the indentation issue. its a circular reference problem when running "composer install --dev" |
@molchanoviv the factory* properties are integral part of a service definition in symfony. Be it in the PHP Interface, the YML Config or the XML Schema. Therefore they belong to a @service Annotation also. |
any news on this? |
@schmittjoh ping |
@jaypea can you rebase your PR on master please? |
Conflicts: composer.lock
…urrent symfony service configuration
this is not part of a service definition itself.
10d72a5
to
f162d22
Compare
@Ener-Getick, I just rebased. |
@@ -76,6 +80,11 @@ public function serialize() | |||
$this->lookupMethods, | |||
$this->properties, | |||
$this->initMethod, | |||
$this->initMethods, |
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.
You should add them at the end of the array to avoid BC breaks
BTW you should wait for #238 otherwise there'll be many conflicts. |
this adds missing properties from symfony services to the @service annotation.
this is basically a copy of #115 with the "lazy" field of a service and fixed unit tests. thanks to @molchanoviv for starting this.
my use case is slightly different so i want to bring this issue back to your attention.
I use the Annotations to configure my services in the class itself, instead of maintaining xml or yml config files. to be fully compatible with the other configurations, i need the factoryService and factoryMethod and since symfony now has the "lazy" option for services, i decided this would be helpful as well.
My use case is a genery cache proxy for method calls to services. the factory in my case does not know, which service it will provide a proxy for, its all configured in the service itself.