Skip to content

Commit ae92d66

Browse files
committed
Add phpstorm meta data for \Drupal\KernelTests\KernelTestBase::installEntitySchema()
1 parent 9a8a9cb commit ae92d66

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

phpcs.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<exclude name="Drupal.Commenting.DocComment.MissingShort"/>
2020
<exclude name="Drupal.Commenting.VariableComment.Missing"/>
2121
<exclude name="Drupal.Arrays.Array.LongLineDeclaration"/>
22+
<!-- Conflicts with {@selfdoc} -->
23+
<exclude name="Drupal.Commenting.DocComment.ShortNotCapital"/>
24+
<exclude name="Drupal.Commenting.DocComment.ShortFullStop"/>
2225

2326
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperator.TrailingMultiLineTernaryOperatorUsed"/>
2427
</rule>

templates/_phpstorm-meta/entity_types.php.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
namespace PHPSTORM_META {
44
55
// Entity types.
6-
expectedReturnValues(
7-
\Drupal\Core\Entity\EntityInterface::getEntityTypeId(),
6+
registerArgumentsSet('entity_type_ids',
87
{% for type, definition in definitions %}
98
'{{ type }}',
109
{% endfor %}
1110
);
1211
12+
expectedArguments(\Drupal\KernelTests\KernelTestBase::installEntitySchema(), 0, argumentsSet('entity_type_ids'));
13+
expectedReturnValues(\Drupal\Core\Entity\EntityInterface::getEntityTypeId(), argumentsSet('entity_type_ids'));
14+
1315
// Storages.
1416
override(
1517
\Drupal\Core\Entity\EntityTypeManagerInterface::getStorage(0),

tests/functional/Generator/PhpStormMetaTest.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,26 @@ private function assertPlugins(): void {
198198
self::assertSame(48, \substr_count($generated_content, 'registerArgumentsSet'));
199199
}
200200

201+
/**
202+
* {@selfdoc}
203+
*/
201204
private function assertEntityTypes(): void {
202205
$generated_content = $this->getGeneratedContent('.phpstorm.meta.php/entity_types.php');
203206

204207
$entity_types = <<< 'PHP'
205-
expectedReturnValues(
206-
\Drupal\Core\Entity\EntityInterface::getEntityTypeId(),
207-
'action',
208-
'base_field_override',
209-
'block',
210-
'block_content',
211-
'block_content_type',
212-
PHP;
208+
<?php declare(strict_types = 1);
209+
210+
namespace PHPSTORM_META {
211+
212+
// Entity types.
213+
registerArgumentsSet('entity_type_ids',
214+
'action',
215+
'base_field_override',
216+
'block',
217+
'block_content',
218+
'block_content_type',
219+
'comment',
220+
PHP;
213221
self::assertStringContainsString($entity_types, $generated_content);
214222
}
215223

0 commit comments

Comments
 (0)