File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Drupal\Core\Field;
4
+
5
+ use Drupal\Core\TypedData\Plugin\DataType\ItemList;
6
+
7
+ class FieldItemList extends ItemList implements FieldItemListInterface {
8
+
9
+ /**
10
+ * @return \Drupal\Core\Field\FieldItemInterface
11
+ */
12
+ protected function createItem($offset = 0, $value = NULL): \Drupal\Core\Field\FieldItemInterface {
13
+ }
14
+
15
+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ final class EntityTypesTest extends TypeInferenceTestCase
14
14
public function dataFileAsserts (): iterable
15
15
{
16
16
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/entity-type-stubs.php ' );
17
+ yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-499.php ' );
17
18
}
18
19
19
20
/**
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Bug499 ;
4
+
5
+ use Drupal \Core \Field \FieldItemList ;
6
+ use Drupal \Core \TypedData \ComputedItemListTrait ;
7
+ use function PHPStan \Testing \assertType ;
8
+
9
+ class ComputedFieldItemList extends FieldItemList {
10
+ use ComputedItemListTrait;
11
+
12
+ protected function computeValue ()
13
+ {
14
+ $ item = $ this ->createItem (0 , 'foo ' );
15
+ assertType ('Drupal\Core\Field\FieldItemInterface ' , $ item );
16
+ $ this ->list [0 ] = $ item ;
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments