Skip to content

Add missing service properties - #145

Open
jaypea wants to merge 6 commits into
schmittjoh:masterfrom
jaypea:add_missing_service_properties
Open

Add missing service properties#145
jaypea wants to merge 6 commits into
schmittjoh:masterfrom
jaypea:add_missing_service_properties

Conversation

@jaypea

@jaypea jaypea commented Dec 3, 2013

Copy link
Copy Markdown

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.

Comment thread Metadata/MetadataConverter.php Outdated

Copy link
Copy Markdown

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)?

Copy link
Copy Markdown
Author

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.

@schmittjoh

Copy link
Copy Markdown
Owner

Could you check the minor indentation issue that @stof mentioned? If you can have a look at why Travis fails that would cool too.

@molchanoviv

Copy link
Copy Markdown

Hey guys. I think we should write new Factory annotation like it was said here #115

@jaypea

jaypea commented Dec 16, 2013

Copy link
Copy Markdown
Author

@schmittjoh fixed the indentation issue.
travis fails for the same reason, the master branch failes. Its a composer issue:
"Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for jms/security-extra-bundle 1.5.0 -> satisfiable by jms/security-extra-bundle[1.5.0].
- jms/security-extra-bundle 1.5.0 requires jms/di-extra-bundle 1.3.* -> no matching package found."

its a circular reference problem when running "composer install --dev"

@jaypea

jaypea commented Dec 16, 2013

Copy link
Copy Markdown
Author

@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.

@jaypea

jaypea commented Jan 21, 2014

Copy link
Copy Markdown
Author

any news on this?

@jaypea

jaypea commented Feb 3, 2014

Copy link
Copy Markdown
Author

@schmittjoh ping

@GuilhemN

Copy link
Copy Markdown
Collaborator

@jaypea can you rebase your PR on master please?

Jan Prieser and others added 5 commits February 16, 2016 16:45
@jaypea
jaypea force-pushed the add_missing_service_properties branch from 10d72a5 to f162d22 Compare February 16, 2016 15:55
@jaypea

jaypea commented Feb 16, 2016

Copy link
Copy Markdown
Author

@Ener-Getick, I just rebased.
thanks for taking care!

$this->lookupMethods,
$this->properties,
$this->initMethod,
$this->initMethods,

Copy link
Copy Markdown
Collaborator

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

@GuilhemN

Copy link
Copy Markdown
Collaborator

BTW you should wait for #238 otherwise there'll be many conflicts.

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

Successfully merging this pull request may close these issues.

6 participants