Skip to content

Fix UsernameNotFoundException example #2125

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

Closed
wants to merge 1 commit into from
Closed

Fix UsernameNotFoundException example #2125

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 13, 2013

Exception::__construct has 3 parameters not 4

`Exception::__construct` has 3 parameters not 4
@wouterj
Copy link
Member

wouterj commented Jan 13, 2013

This is not true.

Symfony has a lot of custom exceptions which can have another signature than the default Exception class of PHP. The UsernameNotFoundException is one of those: public __construct($message, $extraInformation = null, $code, Exception $previous = null)

@ghost
Copy link
Author

ghost commented Jan 13, 2013

well something is wrong.

FatalErrorException: Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /path/to/AccountRepository.php line 68

where line 68 is
throw new UsernameNotFoundException(sprintf('Unable to find an active user object identified by "%s".', $username), null, 0, $e);

@ghost
Copy link
Author

ghost commented Jan 13, 2013

@wouterj : actually it changed in in commit: symfony/symfony@694c47c

which makes my PR wrong for 2.0

EDIT: which makes this a bug in the docs.. or a bug in symfony. Which is it?

@asm89
Copy link
Contributor

asm89 commented Jan 13, 2013

This actually changed in master. See symfony/symfony#4935 and https://github.com/symfony/symfony/pull/4935/files#diff-3.

So this PR is correct, but it should be pointed to the master branch. :)

@ghost
Copy link
Author

ghost commented Jan 13, 2013

k thanks.. will do.

@ghost ghost closed this Jan 13, 2013
This pull request was closed.
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.

2 participants