X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Fdependency-injection%2FTests%2FFixtures%2Fphp%2Fservices19.php;fp=vendor%2Fsymfony%2Fdependency-injection%2FTests%2FFixtures%2Fphp%2Fservices19.php;h=985f0a96283d5d3f56af163ca2223b0d9bdd20ff;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php new file mode 100644 index 000000000..985f0a962 --- /dev/null +++ b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php @@ -0,0 +1,63 @@ +methodMap = array( + 'service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService', + 'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService', + ); + } + + /** + * Gets the 'service_from_anonymous_factory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Bar\FooClass A Bar\FooClass instance + */ + protected function getServiceFromAnonymousFactoryService() + { + return $this->services['service_from_anonymous_factory'] = call_user_func(array(new \Bar\FooClass(), 'getInstance')); + } + + /** + * Gets the 'service_with_method_call_and_factory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Bar\FooClass A Bar\FooClass instance + */ + protected function getServiceWithMethodCallAndFactoryService() + { + $this->services['service_with_method_call_and_factory'] = $instance = new \Bar\FooClass(); + + $instance->setBar(\Bar\FooClass::getInstance()); + + return $instance; + } +}