File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace DrupalEntity ;
4
4
5
+ use Drupal \node \NodeStorage ;
5
6
use function PHPStan \Testing \assertType ;
6
7
assertType (
7
8
'array<int, string> ' ,
95
96
->count ();
96
97
assertType ('int ' , $ query ->execute ());
97
98
99
+ $ anotherTypedNodeStorage = \Drupal::entityTypeManager ()->getStorage ('node ' );
100
+ if ($ anotherTypedNodeStorage instanceof NodeStorage) {
101
+ assertType (
102
+ 'array<int, string> ' ,
103
+ $ anotherTypedNodeStorage ->getQuery ()
104
+ ->accessCheck (TRUE )
105
+ ->execute ()
106
+ );
107
+ $ query = $ anotherTypedNodeStorage ->getQuery ()
108
+ ->accessCheck (TRUE );
109
+ assertType ('array<int, string> ' , $ query ->execute ());
110
+ assertType (
111
+ 'int ' ,
112
+ $ anotherTypedNodeStorage ->getQuery ()
113
+ ->accessCheck (TRUE )
114
+ ->count ()
115
+ ->execute ()
116
+ );
117
+ $ query = $ anotherTypedNodeStorage ->getQuery ()
118
+ ->accessCheck (TRUE )
119
+ ->count ();
120
+ assertType ('int ' , $ query ->execute ());
121
+ }
122
+
98
123
assertType (
99
124
'array<string, string> ' ,
100
125
\Drupal::entityTypeManager ()->getStorage ('block ' )->getQuery ()
You can’t perform that action at this time.
0 commit comments