Before:
------ --------------------------------------------------------------------------------------------------------------------------------------------
Line stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php
------ --------------------------------------------------------------------------------------------------------------------------------------------
80 Usage of deprecated trait Drupal\Core\Routing\UrlGeneratorTrait in class Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper:
in Drupal 8.0.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Url instead.
159 \Drupal calls should be avoided in classes, use dependency injection instead
203 Call to deprecated method url() of class Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Url::fromUri() instead.
------ --------------------------------------------------------------------------------------------------------------------------------------------

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vrs11 created an issue. See original summary.

andypost’s picture

There's no way to inject container into stream wrappers yet, so just add @todo pointing to #3048126: Make it easier to inject the FileSystem service

andypost’s picture

Status: Needs review » Active
vrs11’s picture

andypost’s picture

+++ b/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php
@@ -156,7 +160,7 @@ class SessionStreamWrapper implements StreamWrapperInterface {
-    $this->sessionHelper = \Drupal::service('stream_wrapper_example.session_helper');
+    $this->sessionHelper = $this->getSessionHelper();

this a bit out of scope of deprecated code clean-up but I went ahead and fixed it

andypost’s picture

Still better not introduce new method's as fate unclear

andypost’s picture

Status: Needs review » Reviewed & tested by the community

that's should be enough

  • valthebald committed 83552e6 on 8.x-1.x
    Issue #3072433 by andypost, vrs11: fix drupal check on report on...
valthebald’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x-1.x, thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Kristen Pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.