3
3
namespace Drupal \qa \Workflows ;
4
4
5
5
use Drupal \Core \DependencyInjection \ContainerInjectionInterface ;
6
- use Drupal \Core \Entity \EntityStorageInterface ;
6
+ use Drupal \Core \Config \Entity \ConfigEntityStorageInterface ;
7
+ use Drupal \Core \Entity \ContentEntityStorageInterface ;
7
8
use Drupal \Core \Entity \EntityTypeManagerInterface ;
8
9
use Drupal \Core \StringTranslation \StringTranslationTrait ;
10
+ use Drupal \qa \Workflows \ContentModerationReportBase ;
9
11
use Grafizzi \Graph \Attribute ;
10
12
use Grafizzi \Graph \Edge ;
11
13
use Grafizzi \Graph \Graph ;
12
14
use Grafizzi \Graph \Node ;
13
- use Monolog \Handler \StreamHandler ;
14
- use Monolog \Logger ;
15
15
use Pimple \Container ;
16
16
use Symfony \Component \DependencyInjection \ContainerInterface ;
17
17
@@ -26,10 +26,10 @@ class ContentModerationGraph extends ContentModerationReportBase implements Cont
26
26
*/
27
27
protected $ pimple ;
28
28
29
- public function __construct (EntityStorageInterface $ stateStorage , EntityStorageInterface $ transStorage , Container $ pimple ) {
29
+ public function __construct (ContentEntityStorageInterface $ stateStorage , ConfigEntityStorageInterface $ workflowStorage , Container $ pimple ) {
30
30
$ this ->pimple = $ pimple ;
31
31
$ this ->stateStorage = $ stateStorage ;
32
- $ this ->transStorage = $ transStorage ;
32
+ $ this ->workflowStorage = $ workflowStorage ;
33
33
}
34
34
35
35
/**
@@ -84,19 +84,21 @@ public static function create(ContainerInterface $container) {
84
84
/** @var EntityTypeManagerInterface $etm */
85
85
$ etm = $ container ->get ('entity_type.manager ' );
86
86
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 ' );
89
89
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 ' );
93
95
94
96
$ pimple = new Container ([
95
97
'logger ' => $ logger ,
96
98
'directed ' => TRUE ,
97
99
]);
98
100
99
- return new static ($ stateStorage , $ transStorage , $ pimple );
101
+ return new static ($ stateStorage , $ workflowStorage , $ pimple );
100
102
}
101
103
102
104
public function report () {
0 commit comments