-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] Rename FileLoaderLoadException to LoaderLoadException #28027
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
[Config] Rename FileLoaderLoadException to LoaderLoadException #28027
Conversation
* Exception class for when a resource cannot be loaded or imported. | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should start a real docblock: /**
and in order to help IDEs and composer detect the deprecation and the alias, it should be on a real class declaration:
if (false) {
/**
* @deprecated since Symfony 4.2, use LoaderLoadException instead.
*/
class FileLoaderLoadException extends LoaderLoadException
{
}
}
then a real deprecation should also be triggered (outside of the "if"):
@trigger_error(..., E_USER_DEPRECATED);
|
||
parent::__construct($message, $code, $previous); | ||
} | ||
@trigger_error('Deprecated since Symfony 4.2, use LoaderLoadException instead', E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "%s" class is deprecated since...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with a minor comment
what about naming the new exception LoaderException
by the way?
|
||
parent::__construct($message, $code, $previous); | ||
} | ||
@trigger_error('The FileLoaderLoadException class is deprecated since Symfony 4.2, use LoaderLoadException instead', E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I was too laconic in my previous messages: we should to the same as in other places: put the FQCN, and double quotes around the class name:
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use "%s" instead.', FileLoaderLoadException::class, LoaderLoadException::class), E_USER_DEPRECATED);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok.
I think |
That wouldn't work: now that we throw the new kind, doing this would break existing catch and instanceof blocks that check for thrown exceptions. |
Ok, thanks. Is it all that needed for merge? |
It needs more people reviewing before, but basically yes :) |
0175962
to
1b54be7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I removed the class_alias()
and replaced it with regular inheritance, so not break blocks like catch/instanceof FileLoaderLoadException
)
UPGRADE-4.2.md
Outdated
@@ -10,6 +10,7 @@ Config | |||
------ | |||
|
|||
* Deprecated constructing a `TreeBuilder` without passing root node information. | |||
* Deprecated `FileLoaderLoadException`. Renamed to `LoaderLoadException`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need an entry in the UPGRADE-5.0.md
file too mentioning the removal of the FileLoaderLoadException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1b54be7
to
24471a2
Compare
Thank you @ProgMiner. |
…xception (ProgMiner) This PR was merged into the 4.2-dev branch. Discussion ---------- [Config] Rename FileLoaderLoadException to LoaderLoadException | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #27895 | License | MIT | Doc PR | - Renamed `FileLoaderLoadException` to `LoaderLoadException`. Commits ------- 24471a2 [Config] Rename FileLoaderLoadException to LoaderLoadException
Renamed
FileLoaderLoadException
toLoaderLoadException
.