Skip to content

[DependencyInjection][WIP] Add more information to the message when passin… #25136

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

Conversation

Simperfit
Copy link
Contributor

…g miss matching class.

Q A
Branch? 4.0
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #25122
License MIT
Doc PR none
  • Add tests

if (isset($this->ambiguousServiceTypes[$type])) {
$message = sprintf('one of these existing services: "%s"', implode('", "', $this->ambiguousServiceTypes[$type]));
} elseif (isset($this->types[$type])) {
$message = sprintf('the existing "%s" service', $this->types[$type]);
} elseif ($reference->getRequiringClass() && !$reference->canBeAutoregistered()) {
return ' It cannot be auto-registered because it is from a different root namespace.';
} elseif (is_array($this->types) && (null !== $key = array_search(strtolower($type), array_map('strtolower', $this->types)))) {
return sprintf(' Maybe you mean %s instead of %s ?', $key, $type);
Copy link
Contributor

@hhamon hhamon Nov 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean %s instead of %s?

@sroze
Copy link
Contributor

sroze commented Nov 25, 2017

To be replaced by #25155

@Simperfit Simperfit closed this Nov 26, 2017
@Simperfit Simperfit deleted the bugfix/adding-the-class-miss-match-name branch November 30, 2017 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants