Initial Drupal 11 with DDEV setup

This commit is contained in:
gluebox
2025-10-08 11:39:17 -04:00
commit 89ef74b305
25344 changed files with 2599172 additions and 0 deletions

View 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 %}
}

View 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'));
}

View 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'));
}

View 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'));
}

View 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 %}
}

View 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 %}
}

View 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 %}
}

View 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'));
}

View 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);
}

View 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 %}
}

View 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'));
}

View 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'));
}

View 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')
);
}

View 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'));
}

View 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 %}
}

View 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'));
}

View 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'));
}

View 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 %}
);
}

View 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 %}
);
}

View 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'));
}