33namespace Drupal \qa \Workflows ;
44
55use Drupal \Core \DependencyInjection \ContainerInjectionInterface ;
6- use Drupal \Core \Entity \EntityStorageInterface ;
6+ use Drupal \Core \Config \Entity \ConfigEntityStorageInterface ;
7+ use Drupal \Core \Entity \ContentEntityStorageInterface ;
78use Drupal \Core \Entity \EntityTypeManagerInterface ;
89use Drupal \Core \StringTranslation \StringTranslationTrait ;
10+ use Drupal \qa \Workflows \ContentModerationReportBase ;
911use Grafizzi \Graph \Attribute ;
1012use Grafizzi \Graph \Edge ;
1113use Grafizzi \Graph \Graph ;
1214use Grafizzi \Graph \Node ;
13- use Monolog \Handler \StreamHandler ;
14- use Monolog \Logger ;
1515use Pimple \Container ;
1616use Symfony \Component \DependencyInjection \ContainerInterface ;
1717
@@ -26,10 +26,10 @@ class ContentModerationGraph extends ContentModerationReportBase implements Cont
2626 */
2727 protected $ pimple ;
2828
29- public function __construct (EntityStorageInterface $ stateStorage , EntityStorageInterface $ transStorage , Container $ pimple ) {
29+ public function __construct (ContentEntityStorageInterface $ stateStorage , ConfigEntityStorageInterface $ workflowStorage , Container $ pimple ) {
3030 $ this ->pimple = $ pimple ;
3131 $ this ->stateStorage = $ stateStorage ;
32- $ this ->transStorage = $ transStorage ;
32+ $ this ->workflowStorage = $ workflowStorage ;
3333 }
3434
3535 /**
@@ -84,19 +84,21 @@ public static function create(ContainerInterface $container) {
8484 /** @var EntityTypeManagerInterface $etm */
8585 $ etm = $ container ->get ('entity_type.manager ' );
8686
87- $ stateStorage = $ etm -> getStorage ( ' moderation_state ' );
88- $ transStorage = $ etm ->getStorage ('moderation_state_transition ' );
87+ /** @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $stateStorage */
88+ $ stateStorage = $ etm ->getStorage ('content_moderation_state ' );
8989
90- $ logger = new Logger (basename (__FILE__ , '.php ' ));
91- // Change the minimum logging level using the Logger:: constants.
92- $ logger ->pushHandler (new StreamHandler ('php://stderr ' , Logger::INFO ));
90+ /** @var \Psr\Log\LoggerInterface $logger */
91+ $ logger = $ container ->get ('logger.channel.qa ' );
92+
93+ /** @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $stateStorage */
94+ $ workflowStorage = $ etm ->getStorage ('workflow ' );
9395
9496 $ pimple = new Container ([
9597 'logger ' => $ logger ,
9698 'directed ' => TRUE ,
9799 ]);
98100
99- return new static ($ stateStorage , $ transStorage , $ pimple );
101+ return new static ($ stateStorage , $ workflowStorage , $ pimple );
100102 }
101103
102104 public function report () {
0 commit comments