8000 Various fixes by pborreli · Pull Request #119 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Various fixes #119

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

Merged
16 commits merged into from
Feb 27, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[DependencyInjection] Removed useless else
  • Loading branch information
pborreli committed Feb 27, 2011
commit 66f4d8bf6d8c74263def15967ba855fd52c8dfec
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ protected function resolveValue($value)
return $resolved;
} else if (is_string($value)) {
return $this->resolveString($value);
} else {
return $value;
}

return $value;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,12 @@ protected function addServiceConfigurator($id, $definition, $variableName = 'ins
if (is_array($callable)) {
if (is_object($callable[0]) && $callable[0] instanceof Reference) {
return sprintf(" %s->%s(\$%s);\n", $this->getServiceCall((string) $callable[0]), $callable[1], $variableName);
} else {
return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName);
}
} else {
return sprintf(" %s(\$%s);\n", $callable, $variableName);

return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName);
}

return sprintf(" %s(\$%s);\n", $callable, $variableName);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ protected function dumpValue($value)
return $this->getParameterCall((string) $value);
} elseif (is_object($value) || is_resource($value)) {
throw new \RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
} else {
return $value;
}

return $value;
}

/**
Expand All @@ -222,9 +222,9 @@ protected function getServiceCall($id, Reference $reference = null)
{
if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) {
return sprintf('@?%s', $id);
} else {
return sprintf('@%s', $id);
}

return sprintf('@%s', $id);
}

/**
Expand Down
0