Initial Drupal 11 with DDEV setup
This commit is contained in:
28
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/config_entity_ids.php.twig
vendored
Normal file
28
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/config_entity_ids.php.twig
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
{% for definition in definitions %}
|
||||
// -- {{ definition.label|replace({"\n": " ", "\r": " "}) }}.
|
||||
{% set key = definition.type ~ '__ids' %}
|
||||
registerArgumentsSet('{{ key }}',
|
||||
{% for id in definition.ids %}
|
||||
'{{ id }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments({{ definition.class }}::load(), 0, argumentsSet('{{ key }}'));
|
||||
expectedReturnValues({{ definition.class }}::id(), argumentsSet('{{ key }}'));
|
||||
{% if definition.interface %}
|
||||
expectedArguments({{ definition.interface }}::load(), 0, argumentsSet('{{ key }}'));
|
||||
expectedReturnValues({{ definition.interface }}::id(), argumentsSet('{{ key }}'));
|
||||
{% endif %}
|
||||
{% if definition.type == 'filter_format' %}
|
||||
expectedArguments(\check_markup(), 1, argumentsSet('{{ key }}'));
|
||||
{% elseif definition.type == 'view' %}
|
||||
expectedArguments(\views_embed_view(), 0, argumentsSet('{{ key }}'));
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
}
|
||||
18
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/configuration.php.twig
vendored
Normal file
18
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/configuration.php.twig
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('configs',
|
||||
{% for config in configs %}
|
||||
'{{ config }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Config\ConfigFactoryInterface::get(), 0, argumentsSet('configs'));
|
||||
expectedArguments(\Drupal\Core\Config\ConfigFactoryInterface::getEditable(), 0, argumentsSet('configs'));
|
||||
expectedArguments(\Drupal\Core\Config\ConfigFactoryInterface::reset(), 0, argumentsSet('configs'));
|
||||
expectedArguments(\Drupal::config(), 0, argumentsSet('configs'));
|
||||
expectedArguments(\Drupal\Core\Form\ConfigFormBaseTrait::config(), 0, argumentsSet('configs'));
|
||||
|
||||
}
|
||||
20
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/database.php.twig
vendored
Normal file
20
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/database.php.twig
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('database.tables',
|
||||
{% for table in tables %}
|
||||
'{{ table }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Database\Connection::select(), 0, argumentsSet('database.tables'));
|
||||
expectedArguments(\Drupal\Core\Database\Query\SelectInterface::join(), 0, argumentsSet('database.tables'));
|
||||
expectedArguments(\Drupal\Core\Database\Query\SelectInterface::leftJoin(), 0, argumentsSet('database.tables'));
|
||||
expectedArguments(\Drupal\Core\Database\Query\SelectInterface::innerJoin(), 0, argumentsSet('database.tables'));
|
||||
expectedArguments(\Drupal\Core\Database\Query\SelectInterface::addJoin(), 1, argumentsSet('database.tables'));
|
||||
expectedArguments(\Drupal\Core\Database\Query\SelectInterface::orderBy(), 1, 'ASC', 'DESC');
|
||||
expectedArguments(\Drupal\KernelTests\KernelTestBase::installSchema(), 1, argumentsSet('database.tables'));
|
||||
|
||||
}
|
||||
36
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/date_formats.php.twig
vendored
Normal file
36
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/date_formats.php.twig
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('date_formats',
|
||||
{% for date_format in date_formats %}
|
||||
'{{ date_format }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Datetime\DateFormatter::format(), 1, argumentsSet('date_formats'));
|
||||
|
||||
registerArgumentsSet('date_formats_custom',
|
||||
\Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATETIME_STORAGE_FORMAT,
|
||||
\Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATE_STORAGE_FORMAT,
|
||||
\DateTimeInterface::ATOM,
|
||||
\DateTimeInterface::COOKIE,
|
||||
\DateTimeInterface::ISO8601_EXPANDED,
|
||||
\DateTimeInterface::RFC822,
|
||||
\DateTimeInterface::RFC850,
|
||||
\DateTimeInterface::RFC1036,
|
||||
\DateTimeInterface::RFC1123,
|
||||
\DateTimeInterface::RFC7231,
|
||||
\DateTimeInterface::RFC2822,
|
||||
\DateTimeInterface::RFC3339,
|
||||
\DateTimeInterface::RFC3339_EXTENDED,
|
||||
\DateTimeInterface::RSS,
|
||||
\DateTimeInterface::W3C,
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Datetime\DateFormatter::format(), 2, argumentsSet('date_formats_custom'));
|
||||
expectedArguments(\DateTimeInterface::format(), 0, argumentsSet('date_formats_custom'));
|
||||
expectedArguments(\DateTime::createFromFormat(), 0, argumentsSet('date_formats_custom'));
|
||||
expectedArguments(\DateTimeImmutable::createFromFormat(), 0, argumentsSet('date_formats_custom'));
|
||||
|
||||
}
|
||||
27
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/entity_bundles.php.twig
vendored
Normal file
27
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/entity_bundles.php.twig
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
{% for definition in definitions %}
|
||||
// {{ definition.label|replace({"\n": " ", "\r": " "}) }}.
|
||||
{% set key = definition.type ~ '__bundles' %}
|
||||
registerArgumentsSet('{{ key }}',
|
||||
{% for bundle in definition.bundles %}
|
||||
'{{ bundle }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedReturnValues({{ definition.class }}::bundle(), argumentsSet('{{ key }}'));
|
||||
{% if definition.bundle_getter %}
|
||||
expectedReturnValues({{ definition.class }}::{{ definition.bundle_getter }}(), argumentsSet('{{ key }}'));
|
||||
{% endif %}
|
||||
{% if definition.interface %}
|
||||
expectedReturnValues({{ definition.interface }}::bundle(), argumentsSet('{{ key }}'));
|
||||
{% if definition.bundle_getter %}
|
||||
expectedReturnValues({{ definition.interface }}::{{ definition.bundle_getter }}(), argumentsSet('{{ key }}'));
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
}
|
||||
26
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/entity_links.php.twig
vendored
Normal file
26
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/entity_links.php.twig
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
{% for definition in definitions %}
|
||||
{% if definition.links|length > 0 %}
|
||||
// {{ definition.label|replace({"\n": " ", "\r": " "}) }}.
|
||||
registerArgumentsSet('{{ definition.type ~ '__links' }}',
|
||||
{% for link in definition.links %}
|
||||
'{{ link }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments({{ definition.class }}::toUrl(), 0, argumentsSet('{{ definition.type ~ '__links' }}'));
|
||||
expectedArguments({{ definition.class }}::toLink(), 1, argumentsSet('{{ definition.type ~ '__links' }}'));
|
||||
expectedArguments({{ definition.class }}::hasLinkTemplate(), 0, argumentsSet('{{ definition.type ~ '__links' }}'));
|
||||
{% if definition.interface %}
|
||||
expectedArguments({{ definition.interface }}::toUrl(), 0, argumentsSet('{{ definition.type ~ '__links' }}'));
|
||||
expectedArguments({{ definition.interface }}::toLink(), 1, argumentsSet('{{ definition.type ~ '__links' }}'));
|
||||
expectedArguments({{ definition.interface }}::hasLinkTemplate(), 0, argumentsSet('{{ definition.type ~ '__links' }}'));
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
}
|
||||
72
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/entity_types.php.twig
vendored
Normal file
72
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/entity_types.php.twig
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
// Entity types.
|
||||
registerArgumentsSet('entity_type_ids',
|
||||
{% for type, definition in definitions %}
|
||||
'{{ type }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\KernelTests\KernelTestBase::installEntitySchema(), 0, argumentsSet('entity_type_ids'));
|
||||
expectedReturnValues(\Drupal\Core\Entity\EntityInterface::getEntityTypeId(), argumentsSet('entity_type_ids'));
|
||||
|
||||
// Storages.
|
||||
override(
|
||||
\Drupal\Core\Entity\EntityTypeManagerInterface::getStorage(0),
|
||||
map([
|
||||
{% for type, definition in definitions %}
|
||||
'{{ type }}' => '{{ definition.storage }}',
|
||||
{% endfor %}
|
||||
]),
|
||||
);
|
||||
|
||||
// View builders.
|
||||
override(
|
||||
\Drupal\Core\Entity\EntityTypeManagerInterface::getViewBuilder(0),
|
||||
map([
|
||||
{% for type, definition in definitions %}
|
||||
{% if definition.view_builder %}
|
||||
'{{ type }}' => '{{ definition.view_builder }}',
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
]),
|
||||
);
|
||||
|
||||
// List builders.
|
||||
override(
|
||||
\Drupal\Core\Entity\EntityTypeManagerInterface::getListBuilder(0),
|
||||
map([
|
||||
{% for type, definition in definitions %}
|
||||
{% if definition.list_builder %}
|
||||
'{{ type }}' => '{{ definition.list_builder }}',
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
]),
|
||||
);
|
||||
|
||||
// Access control handlers.
|
||||
override(
|
||||
\Drupal\Core\Entity\EntityTypeManagerInterface::getAccessControlHandler(0),
|
||||
map([
|
||||
{% for type, definition in definitions %}
|
||||
'{{ type }}' => '{{ definition.access_control }}',
|
||||
{% endfor %}
|
||||
]),
|
||||
);
|
||||
|
||||
// Storage methods.
|
||||
{% for definition in definitions %}
|
||||
{# Using map() to work around PhpStorm bug. #}
|
||||
{# @see https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001516519 #}
|
||||
override({{ definition.storage }}::loadMultiple(), map(['' => '{{ definition.class }}[]']));
|
||||
override({{ definition.storage }}::load(), map(['' => '{{ definition.class }}']));
|
||||
override({{ definition.storage }}::create(), map(['' => '{{ definition.class }}']));
|
||||
override({{ definition.class }}::loadMultiple(), map(['' => '{{ definition.class }}[]']));
|
||||
override({{ definition.class }}::load(), map(['' => '{{ definition.class }}']));
|
||||
override({{ definition.class }}::create(), map(['' => '{{ definition.class }}']));
|
||||
|
||||
{% endfor %}
|
||||
}
|
||||
38
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/extensions.php.twig
vendored
Normal file
38
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/extensions.php.twig
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('modules',
|
||||
{% for module in modules %}
|
||||
'{{ module }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::moduleExists(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::load(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::getModule(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::addModule(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::loadAllIncludes(), 1, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::loadInclude(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::hasImplementations(), 1, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::invoke(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::invokeDeprecated(), 1, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\Core\Extension\ModuleHandlerInterface::getName(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\KernelTests\KernelTestBase::installSchema(), 0, argumentsSet('modules'));
|
||||
expectedArguments(\Drupal\KernelTests\KernelTestBase::installConfig(), 0, argumentsSet('modules'));
|
||||
|
||||
registerArgumentsSet('themes',
|
||||
{% for theme in themes %}
|
||||
'{{ theme }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Extension\ThemeHandlerInterface::getBaseThemes(), 1, argumentsSet('themes'));
|
||||
expectedArguments(\Drupal\Core\Extension\ThemeHandlerInterface::getName(), 0, argumentsSet('themes'));
|
||||
expectedArguments(\Drupal\Core\Extension\ThemeHandlerInterface::themeExists(), 0, argumentsSet('themes'));
|
||||
expectedArguments(\Drupal\Core\Extension\ThemeHandlerInterface::getTheme(), 0, argumentsSet('themes'));
|
||||
expectedArguments(\Drupal\Core\Extension\ThemeHandlerInterface::hasUi(), 0, argumentsSet('themes'));
|
||||
expectedReturnValues(\Drupal\Core\Extension\ThemeHandlerInterface::getDefault(), argumentsSet('themes'));
|
||||
expectedReturnValues(\Drupal\Core\Theme\ActiveTheme::getName(), argumentsSet('themes'));
|
||||
|
||||
}
|
||||
35
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/field_definitions.php.twig
vendored
Normal file
35
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/field_definitions.php.twig
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('display_context',
|
||||
'view',
|
||||
'form',
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions(), 0, argumentsSet('display_context'));
|
||||
expectedArguments(\Drupal\Core\Field\BaseFieldDefinition::setDisplayOptions(), 0, argumentsSet('display_context'));
|
||||
expectedArguments(\Drupal\Core\Field\BaseFieldDefinition::getDisplayOptions(), 0, argumentsSet('display_context'));
|
||||
expectedArguments(\Drupal\Core\Field\BaseFieldDefinition::setDisplayConfigurable(), 0, argumentsSet('display_context'));
|
||||
expectedArguments(\Drupal\Core\Field\BaseFieldDefinition::isDisplayConfigurable(), 0, argumentsSet('display_context'));
|
||||
|
||||
registerArgumentsSet('entity_types',
|
||||
{% for entity_type in entity_types %}
|
||||
'{{ entity_type }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedReturnValues(\Drupal\Core\Field\FieldDefinitionInterface::getTargetEntityTypeId(), argumentsSet('entity_types'));
|
||||
|
||||
registerArgumentsSet('field_types',
|
||||
{% for field_type in field_types %}
|
||||
'{{ field_type }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Field\BaseFieldDefinition::create(), 0, argumentsSet('field_types'));
|
||||
expectedReturnValues(\Drupal\Core\Field\FieldDefinitionInterface::getType(), argumentsSet('field_types'));
|
||||
|
||||
expectedArguments(\Drupal\Core\Field\BaseFieldDefinition::setCardinality(), 0, \Drupal\Core\Field\FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
|
||||
expectedReturnValues(\Drupal\Core\Field\BaseFieldDefinition::getCardinality(), \Drupal\Core\Field\FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
|
||||
|
||||
}
|
||||
25
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/fields.php.twig
vendored
Normal file
25
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/fields.php.twig
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
{% for definition in definitions %}
|
||||
// {{ definition.label|replace({"\n": " ", "\r": " "}) }}.
|
||||
{% set field_argument_set = 'fields_' ~ definition.type %}
|
||||
registerArgumentsSet('{{ field_argument_set }}',
|
||||
{% for field in definition.fields %}
|
||||
'{{ field }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments({{ definition.class }}::set(), 0, argumentsSet('{{ field_argument_set }}'));
|
||||
expectedArguments({{ definition.class }}::get(), 0, argumentsSet('{{ field_argument_set }}'));
|
||||
expectedArguments({{ definition.class }}::hasField(), 0, argumentsSet('{{ field_argument_set }}'));
|
||||
{% if definition.interface %}
|
||||
expectedArguments({{ definition.interface }}::set(), 0, argumentsSet('{{ field_argument_set }}'));
|
||||
expectedArguments({{ definition.interface }}::get(), 0, argumentsSet('{{ field_argument_set }}'));
|
||||
expectedArguments({{ definition.interface }}::hasField(), 0, argumentsSet('{{ field_argument_set }}'));
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
}
|
||||
30
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/file_system.php.twig
vendored
Normal file
30
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/file_system.php.twig
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\File\FileSystemInterface::prepareDirectory(),
|
||||
1,
|
||||
\Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY |
|
||||
\Drupal\Core\File\FileSystemInterface::MODIFY_PERMISSIONS
|
||||
);
|
||||
|
||||
registerArgumentsSet('file_system_exists_behaviour',
|
||||
\Drupal\Core\File\FileSystemInterface::EXISTS_RENAME,
|
||||
\Drupal\Core\File\FileSystemInterface::EXISTS_REPLACE,
|
||||
\Drupal\Core\File\FileSystemInterface::EXISTS_ERROR
|
||||
);
|
||||
|
||||
expectedArguments(\Drupal\Core\File\FileSystemInterface::copy(), 2, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\Drupal\Core\File\FileSystemInterface::move(), 2, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\Drupal\Core\File\FileSystemInterface::saveData(), 2, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\Drupal\Core\File\FileSystemInterface::getDestinationFilename(), 1, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\Drupal\file\FileRepositoryInterface::file_copy(), 2, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\Drupal\file\FileRepositoryInterface::file_move(), 2, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\Drupal\file\FileRepositoryInterface::file_save_data(), 2, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\file_save_upload(), 4, argumentsSet('file_system_exists_behaviour'));
|
||||
expectedArguments(\system_retrieve_file(), 3, argumentsSet('file_system_exists_behaviour'));
|
||||
|
||||
}
|
||||
20
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/hooks.php.twig
vendored
Normal file
20
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/hooks.php.twig
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('hooks',
|
||||
{% for hook in hooks %}
|
||||
'{{ hook }}',
|
||||
{% endfor %}
|
||||
);
|
||||
registerArgumentsSet('modules',
|
||||
{% for module in modules %}
|
||||
'{{ module }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Hook\Attribute\Hook::__construct(), 0, argumentsSet('hooks'));
|
||||
expectedArguments(\Drupal\Core\Hook\Attribute\Hook::__construct(), 2, argumentsSet('modules'));
|
||||
|
||||
}
|
||||
85
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/miscellaneous.php.twig
vendored
Normal file
85
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/miscellaneous.php.twig
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('miscellaneous.lang_codes',
|
||||
\Drupal\Core\Language\LanguageInterface::LANGCODE_NOT_SPECIFIED,
|
||||
\Drupal\Core\Language\LanguageInterface::LANGCODE_NOT_APPLICABLE,
|
||||
\Drupal\Core\Language\LanguageInterface::LANGCODE_DEFAULT,
|
||||
\Drupal\Core\Language\LanguageInterface::LANGCODE_SITE_DEFAULT
|
||||
);
|
||||
|
||||
expectedReturnValues(
|
||||
\Drupal\Core\Entity\EntityInterface::save(),
|
||||
\SAVED_NEW,
|
||||
\SAVED_UPDATED
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Entity\EntityViewBuilderInterface::view(),
|
||||
2,
|
||||
argumentsSet('miscellaneous.lang_codes')
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Messenger\MessengerInterface::addMessage(),
|
||||
1,
|
||||
\Drupal\Core\Messenger\MessengerInterface::TYPE_STATUS,
|
||||
\Drupal\Core\Messenger\MessengerInterface::TYPE_WARNING,
|
||||
\Drupal\Core\Messenger\MessengerInterface::TYPE_ERROR
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Entity\Query\QueryInterface::condition(),
|
||||
2,
|
||||
'=',
|
||||
'<>',
|
||||
'>',
|
||||
'>=',
|
||||
'<',
|
||||
'<=',
|
||||
'STARTS_WITH',
|
||||
'CONTAINS',
|
||||
'ENDS_WITH',
|
||||
'IN',
|
||||
'NOT IN',
|
||||
'IS NULL',
|
||||
'IS NOT NULL',
|
||||
'BETWEEN',
|
||||
'NOT BETWEEN',
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Entity\Query\QueryInterface::condition(),
|
||||
3,
|
||||
argumentsSet('miscellaneous.lang_codes')
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Entity\Query\QueryInterface::sort(),
|
||||
1,
|
||||
'ASC',
|
||||
'DESC',
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Entity\Query\QueryInterface::sort(),
|
||||
2,
|
||||
argumentsSet('miscellaneous.lang_codes')
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Entity\Query\QueryInterface::exists(),
|
||||
1,
|
||||
argumentsSet('miscellaneous.lang_codes')
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Entity\Query\QueryInterface::notExists(),
|
||||
1,
|
||||
argumentsSet('miscellaneous.lang_codes')
|
||||
);
|
||||
|
||||
}
|
||||
18
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/permissions.php.twig
vendored
Normal file
18
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/permissions.php.twig
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('permissions',
|
||||
{% for permission in permissions %}
|
||||
'{{ permission }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\Session\AccountInterface::hasPermission(), 0, argumentsSet('permissions'));
|
||||
expectedArguments(\Drupal\Core\Access\AccessResult::allowedIfHasPermission(), 1, argumentsSet('permissions'));
|
||||
expectedArguments(\Drupal\user\RoleInterface::allowedIfHasPermission(), 0, argumentsSet('permissions'));
|
||||
expectedArguments(\Drupal\user\RoleInterface::grantPermission(), 0, argumentsSet('permissions'));
|
||||
expectedArguments(\Drupal\user\RoleInterface::revokePermission(), 0, argumentsSet('permissions'));
|
||||
|
||||
}
|
||||
44
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/plugins.php.twig
vendored
Normal file
44
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/plugins.php.twig
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
{# @todo: Add meta for functions and methods that are specific to some plugin types. #}
|
||||
namespace PHPSTORM_META {
|
||||
{% for plugin in plugins %}
|
||||
|
||||
// -- {{ plugin.manager_id }}.
|
||||
{# Using map() to work around PhpStorm bug. #}
|
||||
{# @see https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001516519 #}
|
||||
{% if plugin.plugin_interface %}
|
||||
override({{ plugin.manager_class }}::createInstance(), map(['' => '{{ plugin.plugin_interface }}']));
|
||||
override({{ plugin.manager_class }}::getInstance(), map(['' => '{{ plugin.plugin_interface }}|bool']));
|
||||
{% if plugin.manager_interface %}
|
||||
override({{ plugin.manager_interface }}::createInstance(), map(['' => '{{ plugin.plugin_interface }}']));
|
||||
override({{ plugin.manager_interface }}::getInstance(), map(['' => '{{ plugin.plugin_interface }}|bool']));
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if plugin.plugin_ids|length > 0 %}
|
||||
{% set set_name = plugin.manager_id ~ '__plugin_ids' %}
|
||||
registerArgumentsSet('{{ set_name }}',
|
||||
{% for plugin_id in plugin.plugin_ids %}
|
||||
'{{ plugin_id }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments({{ plugin.manager_class }}::createInstance(), 0, argumentsSet('{{ set_name }}'));
|
||||
expectedArguments({{ plugin.manager_class }}::getDefinition(), 0, argumentsSet('{{ set_name }}'));
|
||||
expectedArguments({{ plugin.manager_class }}::hasDefinition(), 0, argumentsSet('{{ set_name }}'));
|
||||
expectedArguments({{ plugin.manager_class }}::processDefinition(), 1, argumentsSet('{{ set_name }}'));
|
||||
{% if plugin.manager_interface %}
|
||||
expectedArguments({{ plugin.manager_interface }}::createInstance(), 0, argumentsSet('{{ set_name }}'));
|
||||
expectedArguments({{ plugin.manager_interface }}::getDefinition(), 0, argumentsSet('{{ set_name }}'));
|
||||
expectedArguments({{ plugin.manager_interface }}::hasDefinition(), 0, argumentsSet('{{ set_name }}'));
|
||||
expectedArguments({{ plugin.manager_interface }}::processDefinition(), 1, argumentsSet('{{ set_name }}'));
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if plugin.manager_id == 'validation.constraint' %}
|
||||
expectedArguments(\Drupal\Core\Entity\EntityTypeInterface::addConstraint(), 0, argumentsSet('validation.constraint__plugin_ids'));
|
||||
expectedArguments(\Drupal\Core\TypedData\DataDefinitionInterface::addConstraint(), 0, argumentsSet('validation.constraint__plugin_ids'));
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
}
|
||||
16
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/roles.php.twig
vendored
Normal file
16
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/roles.php.twig
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('roles',
|
||||
{% for role in roles %}
|
||||
'{{ role }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\user\UserInterface::hasRole(), 0, argumentsSet('roles'));
|
||||
expectedArguments(\Drupal\user\UserInterface::addRole(), 0, argumentsSet('roles'));
|
||||
expectedArguments(\Drupal\user\UserInterface::removeRole(), 0, argumentsSet('roles'));
|
||||
|
||||
}
|
||||
48
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/routes.php.twig
vendored
Normal file
48
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/routes.php.twig
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('routes',
|
||||
{% for route in routes %}
|
||||
{# Use `raw` filter because some route names contain HTML entities, i.e. '<front>'. #}
|
||||
'{{ route|raw }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Symfony\Component\Routing\RouteCollection::get(), 0, argumentsSet('routes'));
|
||||
expectedArguments(\Symfony\Component\Routing\RouteCollection::remove(), 0, argumentsSet('routes'));
|
||||
expectedArguments(\Drupal\Core\Url::__construct(), 0, argumentsSet('routes'));
|
||||
expectedArguments(\Drupal\Core\Url::fromRoute(), 0, argumentsSet('routes'));
|
||||
expectedArguments(\Drupal\Core\Link::createFromRoute(), 1, argumentsSet('routes'));
|
||||
expectedReturnValues(\Drupal\Core\Url::getRouteName(), argumentsSet('routes'));
|
||||
expectedReturnValues(\Drupal\Core\Routing\RouteMatchInterface::getRouteName(), argumentsSet('routes'));
|
||||
expectedReturnValues(\Drupal\Core\Menu\ContextualLinkInterface::getRouteName(), argumentsSet('routes'));
|
||||
expectedReturnValues(\Drupal\Core\Menu\LocalActionInterface::getRouteName(), argumentsSet('routes'));
|
||||
expectedReturnValues(\Drupal\Core\Menu\LocalTaskInterface::getRouteName(), argumentsSet('routes'));
|
||||
expectedReturnValues(\Drupal\Core\Menu\MenuLinkInterface::getRouteName(), argumentsSet('routes'));
|
||||
expectedReturnValues(\Drupal\Core\Form\FormStateInterface::setRedirect(), argumentsSet('routes'));
|
||||
|
||||
registerArgumentsSet('routes.route_options',
|
||||
{% for option in route_attributes.options %}
|
||||
'{{ option }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Symfony\Component\Routing\Route::getOption(), 0, argumentsSet('routes.route_options'));
|
||||
expectedArguments(\Symfony\Component\Routing\Route::setOption(), 0, argumentsSet('routes.route_options'));
|
||||
registerArgumentsSet('routes.route_requirements',
|
||||
{% for requirement in route_attributes.requirements %}
|
||||
'{{ requirement }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Symfony\Component\Routing\Route::getRequirement(), 0, argumentsSet('routes.route_requirements'));
|
||||
expectedArguments(\Symfony\Component\Routing\Route::setRequirement(), 0, argumentsSet('routes.route_requirements'));
|
||||
registerArgumentsSet('routes.route_defaults',
|
||||
{% for default in route_attributes.defaults %}
|
||||
'{{ default }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Symfony\Component\Routing\Route::getDefault(), 0, argumentsSet('routes.route_defaults'));
|
||||
expectedArguments(\Symfony\Component\Routing\Route::setDefault(), 0, argumentsSet('routes.route_defaults'));
|
||||
|
||||
}
|
||||
31
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/services.php.twig
vendored
Normal file
31
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/services.php.twig
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
override(
|
||||
\Drupal::service(0),
|
||||
map([
|
||||
{% for service_id, class in services %}
|
||||
'{{ service_id }}' => '{{ class }}',
|
||||
{% endfor %}
|
||||
])
|
||||
);
|
||||
override(
|
||||
\Symfony\Component\DependencyInjection\ContainerInterface::get(0),
|
||||
map([
|
||||
{% for service_id, class in services %}
|
||||
'{{ service_id }}' => '{{ class }}',
|
||||
{% endfor %}
|
||||
])
|
||||
);
|
||||
|
||||
expectedArguments(
|
||||
\Symfony\Component\DependencyInjection\ContainerInterface::set(),
|
||||
0,
|
||||
{% for service_id, class in services %}
|
||||
'{{ service_id }}',
|
||||
{% endfor %}
|
||||
);
|
||||
}
|
||||
15
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/settings.php.twig
vendored
Normal file
15
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/settings.php.twig
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
expectedArguments(
|
||||
\Drupal\Core\Site\Settings::get(),
|
||||
0,
|
||||
{% for setting in settings %}
|
||||
'{{ setting }}',
|
||||
{% endfor %}
|
||||
);
|
||||
|
||||
}
|
||||
16
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/states.php.twig
vendored
Normal file
16
vendor/chi-teck/drupal-code-generator/templates/_phpstorm-meta/states.php.twig
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
registerArgumentsSet('states',
|
||||
{% for state in states %}
|
||||
'{{ state }}',
|
||||
{% endfor %}
|
||||
);
|
||||
expectedArguments(\Drupal\Core\State\StateInterface::get(), 0, argumentsSet('states'));
|
||||
expectedArguments(\Drupal\Core\State\StateInterface::set(), 0, argumentsSet('states'));
|
||||
expectedArguments(\Drupal\Core\State\StateInterface::delete(), 0, argumentsSet('states'));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user