- Issue created by @MegaChriz
\Drupal\feeds\Plugin\Type\PluginBase
has a few methods that are calling a Drupal service. These methods are:
linkGenerator()
urlGenerator()
These methods are called only within the same class by these methods respectively:
l()
url()
l()
is nowhere called in the Feeds code base and url()
is only called once by \Drupal\feeds\Feeds\Processor\EntityProcessorBase::entityValidate()
.
Finally, to support access to these services, there is a method called container()
which calls \Drupal::getContainer()
.
Since the low usage and since this doesn't use dependency injection, I think we should deprecate all 5 methods. The method container()
is private, so should never be called outside of the class, but I think it's handy to deprecate anyway to not forget to remove it in the future.
Deprecate the following methods from \Drupal\feeds\Plugin\Type\PluginBase
:
l()
url()
linkGenerator()
urlGenerator()
container()
And make sure that \Drupal\feeds\Feeds\Processor\EntityProcessorBase::entityValidate()
is updated.
Code example:
@trigger_error(__METHOD__ . '() is deprecated in feeds:3.0.0-rc1 and is removed from feeds:4.0.0. There is no replacement. See https://www.drupal.org/node/xxx', E_USER_DEPRECATED);
'xxx' should be the node ID of the change record.
None.
From the class \Drupal\feeds\Plugin\Type\PluginBase
, the methods l()
, url()
, linkGenerator()
, urlGenerator()
and container()
will be deprecated.
None.
Active
3.0
Code