bug #34795 [Routing][ObjectLoader] Remove forgotten deprecation after merge (fancyweb)

This PR was merged into the 5.0 branch.

Discussion
----------

[Routing][ObjectLoader] Remove forgotten deprecation after merge

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

https://github.com/symfony/symfony/pull/34621 needs to be gone on 5.0. We want to throw here. I think it was forgotten when merging in 5.0.

Commits
-------

4e60b9db22 [Routing][ObjectLoader] Remove forgotten deprecation after merge
This commit is contained in:
Fabien Potencier 2019-12-04 07:40:02 +01:00
commit 98694d8677

View File

@ -42,15 +42,10 @@ abstract class ObjectLoader extends Loader
*/
public function load($resource, string $type = null)
{
if (!preg_match('/^[^\:]+(?:::?(?:[^\:]+))?$/', $resource)) {
if (!preg_match('/^[^\:]+(?:::(?:[^\:]+))?$/', $resource)) {
throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the %s route loader: use the format "object_id::method" or "object_id" if your object class has an "__invoke" method.', $resource, \is_string($type) ? '"'.$type.'"' : 'object'));
}
if (1 === substr_count($resource, ':')) {
$resource = str_replace(':', '::', $resource);
@trigger_error(sprintf('Referencing object route loaders with a single colon is deprecated since Symfony 4.1. Use %s instead.', $resource), E_USER_DEPRECATED);
}
$parts = explode('::', $resource);
$method = $parts[1] ?? '__invoke';