Skip to content

Commit

Permalink
bug #11756 [DependencyInjection] fix @return anno created by PhpDumpe…
Browse files Browse the repository at this point in the history
…r (jakubkulhan)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11756).

Discussion
----------

[DependencyInjection] fix @return anno created by PhpDumper

| Q             | A
| ------------- | ---
| Fixed tickets | ---
| License       | MIT

If a generated container is inside namespace, generated @return annos are not valid.

Commits
-------

39c4cc3 [DependencyInjection] fix @return anno created by PhpDumper
  • Loading branch information
fabpot committed Aug 26, 2014
2 parents baf9796 + 39c4cc3 commit 0c44306
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Expand Up @@ -508,7 +508,7 @@ private function addService($id, $definition)
if ($definition->isSynthetic()) {
$return[] = '@throws RuntimeException always since this service is expected to be injected dynamically';
} elseif ($class = $definition->getClass()) {
$return[] = sprintf("@return %s A %s instance.", 0 === strpos($class, '%') ? 'object' : $class, $class);
$return[] = sprintf("@return %s A %s instance.", 0 === strpos($class, '%') ? 'object' : "\\".$class, $class);
} elseif ($definition->getFactoryClass()) {
$return[] = sprintf('@return object An instance returned by %s::%s().', $definition->getFactoryClass(), $definition->getFactoryMethod());
} elseif ($definition->getFactoryService()) {
Expand Down
Expand Up @@ -44,7 +44,7 @@ public function __construct()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return stdClass A stdClass instance.
* @return \stdClass A stdClass instance.
*/
protected function getTestService()
{
Expand Down
Expand Up @@ -42,7 +42,7 @@ public function __construct()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return stdClass A stdClass instance.
* @return \stdClass A stdClass instance.
*/
protected function getFooService()
{
Expand Down
Expand Up @@ -47,7 +47,7 @@ public function __construct()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return FooClass A FooClass instance.
* @return \FooClass A FooClass instance.
*/
protected function getBarService()
{
Expand All @@ -64,7 +64,7 @@ protected function getBarService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Baz A Baz instance.
* @return \Baz A Baz instance.
*/
protected function getBazService()
{
Expand All @@ -81,7 +81,7 @@ protected function getBazService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return stdClass A stdClass instance.
* @return \stdClass A stdClass instance.
*/
protected function getDependsOnRequestService()
{
Expand All @@ -98,7 +98,7 @@ protected function getDependsOnRequestService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Bar A Bar instance.
* @return \Bar A Bar instance.
*/
protected function getFactoryServiceService()
{
Expand All @@ -111,7 +111,7 @@ protected function getFactoryServiceService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return FooClass A FooClass instance.
* @return \FooClass A FooClass instance.
*/
protected function getFooService()
{
Expand Down Expand Up @@ -164,7 +164,7 @@ protected function getFooBarService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Foo A Foo instance.
* @return \Foo A Foo instance.
*/
protected function getFooWithInlineService()
{
Expand All @@ -181,7 +181,7 @@ protected function getFooWithInlineService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return FooClass A FooClass instance.
* @return \FooClass A FooClass instance.
*/
protected function getMethodCall1Service()
{
Expand Down Expand Up @@ -234,7 +234,7 @@ protected function synchronizeRequestService()
* If you want to be able to request this service from the container directly,
* make it public, otherwise you might end up with broken code.
*
* @return Bar A Bar instance.
* @return \Bar A Bar instance.
*/
protected function getInlinedService()
{
Expand Down
Expand Up @@ -55,7 +55,7 @@ public function __construct()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return FooClass A FooClass instance.
* @return \FooClass A FooClass instance.
*/
protected function getBarService()
{
Expand All @@ -72,7 +72,7 @@ protected function getBarService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Baz A Baz instance.
* @return \Baz A Baz instance.
*/
protected function getBazService()
{
Expand All @@ -89,7 +89,7 @@ protected function getBazService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return stdClass A stdClass instance.
* @return \stdClass A stdClass instance.
*/
protected function getDependsOnRequestService()
{
Expand All @@ -106,7 +106,7 @@ protected function getDependsOnRequestService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Bar A Bar instance.
* @return \Bar A Bar instance.
*/
protected function getFactoryServiceService()
{
Expand All @@ -119,7 +119,7 @@ protected function getFactoryServiceService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return FooClass A FooClass instance.
* @return \FooClass A FooClass instance.
*/
protected function getFooService()
{
Expand All @@ -143,7 +143,7 @@ protected function getFooService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return BazClass A BazClass instance.
* @return \BazClass A BazClass instance.
*/
protected function getFoo_BazService()
{
Expand All @@ -157,7 +157,7 @@ protected function getFoo_BazService()
/**
* Gets the 'foo_bar' service.
*
* @return FooClass A FooClass instance.
* @return \FooClass A FooClass instance.
*/
protected function getFooBarService()
{
Expand All @@ -170,7 +170,7 @@ protected function getFooBarService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Foo A Foo instance.
* @return \Foo A Foo instance.
*/
protected function getFooWithInlineService()
{
Expand All @@ -192,7 +192,7 @@ protected function getFooWithInlineService()
* This service is shared.
* This method always returns the same instance of the service.
*
* @return FooClass A FooClass instance.
* @return \FooClass A FooClass instance.
*/
protected function getMethodCall1Service()
{
Expand Down

0 comments on commit 0c44306

Please sign in to comment.