Unverified Commit 08766c5d authored by alexpott's avatar alexpott
Browse files

Issue #2903911 by joshmiller, longwave, anmolgoyal74, ankithashetty, init90,...

Issue #2903911 by joshmiller, longwave, anmolgoyal74, ankithashetty, init90, Pooja Ganjage, _gradient_, daffie, borisson_: Fix 'Drupal.Commenting.FunctionComment.ParamMissingDefinition' coding standard
parent 4ae7ef90
......@@ -17,10 +17,14 @@ class InvalidPluginDefinitionException extends PluginException {
/**
* Constructs an InvalidPluginDefinitionException.
*
* For the remaining parameters see \Exception.
*
* @param string $plugin_id
* The plugin ID of the mapper.
* @param string $message
* The exception message.
* @param int $code
* The exception code.
* @param \Exception|null $previous
* The previous throwable used for exception chaining.
*
* @see \Exception
*/
......
......@@ -10,10 +10,14 @@ class PluginNotFoundException extends PluginException {
/**
* Construct a PluginNotFoundException exception.
*
* For the remaining parameters see \Exception.
*
* @param string $plugin_id
* The plugin ID that was not found.
* @param string $message
* The exception message.
* @param int $code
* The exception code.
* @param \Exception|null $previous
* The previous throwable used for exception chaining.
*
* @see \Exception
*/
......
......@@ -452,10 +452,12 @@ protected function isValidUri($string) {
* The containing library definition.
* @param array $sub_key
* An array containing the sub-keys specifying the library asset, e.g.
* @code['js']@endcode or @code['css', 'component']@endcode
* ['js'] or ['css', 'component'].
* @param array $overrides
* Specifies the overrides, this is an array where the key is the asset to
* be overridden while the value is overriding asset.
* @param string $theme_path
* The theme or base theme.
*/
protected function setOverrideValue(array &$library, array $sub_key, array $overrides, $theme_path) {
foreach ($overrides as $original => $replacement) {
......
......@@ -64,6 +64,8 @@ public function getExtension() {
*
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The string translation service.
* @param string $extension
* The name of the extension that is being installed.
*
* @return string
*/
......
......@@ -103,13 +103,16 @@ protected function ensureIdentifiersLength($table_identifier_part, $column_ident
* We introspect the database to collect the information required by insert
* and update queries.
*
* @param $table_name
* @param string $table
* The non-prefixed name of the table.
*
* @return
* @return mixed|object
* An object with two member variables:
* - 'blob_fields' that lists all the blob fields in the table.
* - 'sequences' that lists the sequences used in that table.
* - 'blob_fields' that lists all the blob fields in the table.
* - 'sequences' that lists the sequences used in that table.
*
* @throws \Exception
* Exception thrown when the query for the table information fails.
*/
public function queryTableInformation($table) {
// Generate a key to reference this table's information on.
......@@ -233,6 +236,9 @@ protected function resetTableInformation($table) {
*
* @return array
* An array containing all the constraint names for the field.
*
* @throws \Exception
* Exception thrown when the query for the table information fails.
*/
public function queryFieldInformation($table, $field, $constraint_type = 'c') {
assert(in_array($constraint_type, ['c', 'f', 'p', 'u', 't', 'x']));
......@@ -267,12 +273,12 @@ public function queryFieldInformation($table, $field, $constraint_type = 'c') {
/**
* Generate SQL to create a new table from a Drupal schema definition.
*
* @param $name
* @param string $name
* The name of the table to create.
* @param $table
* @param array $table
* A Schema API table definition array.
*
* @return
* @return array
* An array of SQL statements to create the table.
*/
protected function createTableSql($name, $table) {
......
......@@ -72,13 +72,13 @@ public function nextPlaceholder() {
/**
* Get information about the table name and schema from the prefix.
*
* @param
* @param string $table
* Name of table to look prefix up for. Defaults to 'default' because that's
* default key for prefix.
* @param $add_prefix
* @param bool $add_prefix
* Boolean that indicates whether the given table name should be prefixed.
*
* @return
* @return array
* A keyed array with information about the schema, table name and prefix.
*/
protected function getPrefixInfo($table = 'default', $add_prefix = TRUE) {
......@@ -238,9 +238,9 @@ public function findTables($table_expression) {
/**
* Check if a column exists in the given table.
*
* @param $table
* @param string $table
* The name of the table in drupal (no prefixing).
* @param $column
* @param string $column
* The name of the column.
*
* @return
......
......@@ -77,8 +77,6 @@ public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entit
* the submitted form values are copied to entity properties. The form's
* entity remains unchanged.
*
* @see \Drupal\Core\Entity\EntityFormInterface::getEntity()
*
* @param array $form
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
......@@ -86,6 +84,8 @@ public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entit
*
* @return \Drupal\Core\Entity\EntityInterface
* An updated copy of the form's entity object.
*
* @see \Drupal\Core\Entity\EntityFormInterface::getEntity()
*/
public function buildEntity(array $form, FormStateInterface $form_state);
......
......@@ -50,6 +50,8 @@ class EntityDeriver implements ContainerDeriverInterface {
* The base plugin ID.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info_service
* The bundle info service.
*/
public function __construct($base_plugin_id, EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $bundle_info_service) {
$this->basePluginId = $base_plugin_id;
......
......@@ -34,10 +34,11 @@ public function condition($field, $function = NULL, $value = NULL, $operator = N
/**
* Queries for the existence of a field.
*
* @param $field
* @param string $field
* @param string $function
* @param string $langcode
*
* @return ConditionInterface
* @return \Drupal\Core\Entity\Query\ConditionInterface
*
* @see \Drupal\Core\Entity\Query\QueryInterface::exists()
*/
......@@ -47,8 +48,10 @@ public function exists($field, $function, $langcode = NULL);
* Queries for the nonexistence of a field.
*
* @param string $field
* @param string $function
* @param string $langcode
*
* @return ConditionInterface
* @return \Drupal\Core\Entity\Query\ConditionInterface
*
* @see \Drupal\Core\Entity\Query\QueryInterface::notExists()
*/
......
......@@ -54,6 +54,8 @@ public function exists($field, $langcode = NULL);
*
* @param string $field
* @param string $langcode
* (optional) For which language the entity should be prepared, defaults to
* the current content language.
*
* @return $this
*
......
......@@ -369,14 +369,32 @@ protected function ensureEntityTable($index_prefix, $property, $type, $langcode,
}
/**
* Join field table if necessary.
* Ensure the field table is joined if necessary.
*
* @param $field_name
* Name of the field.
* @param string $index_prefix
* The table array index prefix. For a base table this will be empty,
* for a target entity reference like 'field_tags.entity:taxonomy_term.name'
* this will be 'entity:taxonomy_term.target_id.'.
* @param \Drupal\Core\Field\FieldStorageDefinitionInterface &$field
* The field storage definition for the field being joined.
* @param string $type
* The join type.
* @param string $langcode
* The langcode we use on the join.
* @param string $base_table
* The table to join to. It can be either the table name, its alias or the
* 'base_table' placeholder.
* @param string $entity_id_field
* The name of the ID field/property for the current entity. For instance:
* tid, nid, etc.
* @param string $field_id_field
* The column representing the id for the field. For example, 'revision_id'
* or 'entity_id'.
* @param string $delta
* A delta which should be used as additional condition.
*
* @return string
*
* @throws \Drupal\Core\Entity\Query\QueryException
* The alias of the joined table.
*/
protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field, $delta) {
$field_name = $field->getName();
......@@ -435,6 +453,7 @@ protected function addJoin($type, $table, $join_condition, $langcode, $delta = N
*
* @param string $table
* The table name.
* @param string $entity_type_id
*
* @return array|false
* An associative array of table field mapping for the given table, keyed by
......
......@@ -15,6 +15,9 @@ class EntityDataDefinition extends ComplexDataDefinitionBase implements EntityDa
* @param string $entity_type_id
* (optional) The ID of the entity type, or NULL if the entity type is
* unknown. Defaults to NULL.
* @param string $bundle
* (optional) The bundle of the entity type, or NULL if the bundle is
* unknown. Defaults to NULL.
*
* @return static
*/
......
......@@ -37,6 +37,8 @@ class ConfigSnapshotSubscriber implements EventSubscriberInterface {
/**
* Constructs the ConfigSnapshotSubscriber object.
*
* @param \Drupal\Core\Config\ConfigManagerInterface $config_manager
* The configuration manager.
* @param \Drupal\Core\Config\StorageInterface $source_storage
* The source storage used to discover configuration changes.
* @param \Drupal\Core\Config\StorageInterface $snapshot_storage
......
......@@ -37,6 +37,8 @@ class SiteSettingsForm extends FormBase {
*
* @param string $site_path
* The site path.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
*/
public function __construct($site_path, RendererInterface $renderer) {
$this->sitePath = $site_path;
......
......@@ -212,9 +212,13 @@ public static function getHashSalt() {
* module directories setting apcu_ensure_unique_prefix would allow the sites
* to share APCu cache items.
*
* @param $identifier
* @param string $identifier
* An identifier for the prefix. For example, 'class_loader' or
* 'cache_backend'.
* @param string $root
* The app root.
* @param string $site_path
* (optional) The site path. Defaults to an empty string.
*
* @return string
* The prefix for APCu user cache keys.
......
......@@ -48,6 +48,9 @@ public function getValue() {
*
* @param array|null $values
* An array of values of the field items, or NULL to unset the field.
* @param bool $notify
* (optional) Whether to notify the parent object of the change. Defaults to
* TRUE.
*/
public function setValue($values, $notify = TRUE) {
if (!isset($values) || $values === []) {
......
......@@ -70,6 +70,10 @@ public function getValue() {
*
* @param array|null $values
* An array of property values.
* @param bool $notify
* (optional) Whether to notify the parent object of the change. Defaults to
* TRUE. If a property is updated from a parent object, set it to FALSE to
* avoid being notified again.
*/
public function setValue($values, $notify = TRUE) {
if (isset($values) && !is_array($values)) {
......@@ -214,6 +218,8 @@ public function __clone() {
/**
* {@inheritdoc}
*
* @param $property_name
* The name of the property.
* @param bool $notify
* (optional) Whether to forward the notification to the parent. Defaults to
* TRUE. By passing FALSE, overrides of this method can re-use the logic
......
......@@ -14,6 +14,10 @@ class ActionAddForm extends ActionFormBase {
/**
* {@inheritdoc}
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param string $action_id
* The action ID.
*/
......
......@@ -48,6 +48,10 @@ public function getFormId() {
/**
* {@inheritdoc}
*
* @param array $form
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param string $default_ip
* (optional) IP address to be passed on to
* \Drupal::formBuilder()->getForm() for use as the default value of the IP
......
......@@ -80,6 +80,10 @@ public function getCancelUrl() {
/**
* {@inheritdoc}
*
* @param array $form
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param string $ban_id
* The IP address record ID to unban.
*/
......
......@@ -70,6 +70,8 @@ class BlockListBuilder extends ConfigEntityListBuilder implements FormInterface
* The theme manager.
* @param \Drupal\Core\Form\FormBuilderInterface $form_builder
* The form builder.
* @param \Drupal\Core\Messenger\MessengerInterface $messenger
* The messenger service.
*/
public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ThemeManagerInterface $theme_manager, FormBuilderInterface $form_builder, MessengerInterface $messenger) {
parent::__construct($entity_type, $storage);
......
......@@ -74,6 +74,8 @@ public static function create(ContainerInterface $container) {
* The entity type bundle service.
* @param \Drupal\Component\Datetime\TimeInterface $time
* The time service.
* @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
* The entity field manager service.
*/
public function __construct(EntityRepositoryInterface $entity_repository, AccountInterface $current_user, RendererInterface $renderer, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, EntityFieldManagerInterface $entity_field_manager = NULL) {
parent::__construct($entity_repository, $entity_type_bundle_info, $time);
......
......@@ -95,6 +95,8 @@ class EntityTypeInfo implements ContainerInjectionInterface {
* Bundle information service.
* @param \Drupal\Core\Session\AccountInterface $current_user
* Current user.
* @param \Drupal\content_moderation\StateTransitionValidationInterface $validator
* State transition validator.
*/
public function __construct(TranslationInterface $translation, ModerationInformationInterface $moderation_information, EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $bundle_info, AccountInterface $current_user, StateTransitionValidationInterface $validator) {
$this->stringTranslation = $translation;
......
......@@ -67,6 +67,8 @@ class ContentModeration extends WorkflowTypeBase implements ContentModerationInt
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
* The entity type bundle info.
* @param \Drupal\content_moderation\ModerationInformationInterface $moderation_info
* Moderation information service.
*/
......
......@@ -116,6 +116,8 @@ class ContentTranslationHandler implements ContentTranslationHandlerInterface, E
* The messenger service.
* @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
* The date formatter service.
* @param \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository
* The installed entity definition repository service.
*/
public function __construct(EntityTypeInterface $entity_type, LanguageManagerInterface $language_manager, ContentTranslationManagerInterface $manager, EntityTypeManagerInterface $entity_type_manager, AccountInterface $current_user, MessengerInterface $messenger, DateFormatterInterface $date_formatter, EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository) {
$this->entityTypeId = $entity_type->id();
......@@ -667,6 +669,10 @@ protected function addTranslatabilityClue(&$element) {
* The type of the entity.
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity whose form is being built.
* @param array $form
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @see \Drupal\content_translation\ContentTranslationHandler::entityFormAlter()
*/
......
......@@ -93,8 +93,14 @@ protected function setUp(): void {
* Whether or not the entity is the default translation.
* @param bool $translation_form
* Whether or not the form is a translation form.
* @param bool $is_submitted
* Whether or not the form should be marked as submitted.
* @param bool $is_rebuilding
* Whether or not the form should be flagged for rebuild.
* @param array $expected
* The expected altered element.
* @param bool $display_warning
* Whether or not the warning message should be displayed.
*
* @dataProvider providerTestEntityFormSharedElements
*
......
......@@ -57,6 +57,10 @@ public function getFormId() {
/**
* {@inheritdoc}
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param \Drupal\editor\Entity\Editor $editor
* The text editor to which this dialog corresponds.
*/
......
......@@ -27,8 +27,14 @@ public function getFormId() {
/**
* {@inheritdoc}
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param \Drupal\editor\Entity\Editor $editor
* The text editor to which this dialog corresponds.
*
* @return array
*/
public function buildForm(array $form, FormStateInterface $form_state, Editor $editor = NULL) {
// The default values are set directly from \Drupal::request()->request,
......
......@@ -90,6 +90,9 @@ class FieldConfig extends FieldConfigBase implements FieldConfigInterface {
* bundle to which the field is attached to. Other array elements will be
* used to set the corresponding properties on the class; see the class
* property documentation for details.
* @param string $entity_type
* (optional) The entity type on which the field should be created.
* Defaults to "field_config".
*/
public function __construct(array $values, $entity_type = 'field_config') {
// Allow either an injected FieldStorageConfig object, or a field_name and
......
......@@ -245,6 +245,9 @@ class FieldStorageConfig extends ConfigEntityBase implements FieldStorageConfigI
* a 'field_name' property can be accepted in place of 'id'.
* - entity_type: required.
* - type: required.
* @param string $entity_type
* (optional) The entity type on which the field should be created.
* Defaults to "field_storage_config".
*/
public function __construct(array $values, $entity_type = 'field_storage_config') {
// Check required properties.
......
......@@ -56,6 +56,8 @@ class FieldStorageConfigListBuilder extends ConfigEntityListBuilder {
* The entity type manager.
* @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager
* The 'field type' plugin manager.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info_service
* The bundle info service.
*/
public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, FieldTypePluginManagerInterface $field_type_manager, EntityTypeBundleInfoInterface $bundle_info_service) {
parent::__construct($entity_type, $entity_type_manager->getStorage($entity_type->id()));
......
......@@ -41,6 +41,10 @@ public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entit
/**
* {@inheritdoc}
*
* @param array $form
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param string $field_config
* The ID of the field config whose field storage config is being edited.
*/
......
......@@ -39,6 +39,10 @@ public function getFormId() {
/**
* {@inheritdoc}
*
* @param array $form
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param \Drupal\image\ImageStyleInterface $image_style
* The image style.
* @param string $image_effect
......
......@@ -40,6 +40,8 @@ class ImageStyleTest extends UnitTestCase {
* The image effect ID.
* @param \Drupal\image\ImageEffectInterface|\PHPUnit\Framework\MockObject\MockObject $image_effect
* The image effect used for testing.
* @param array $stubs
* An array of additional method names to mock.
*
* @return \Drupal\image\ImageStyleInterface
* The mocked image style.
......
......@@ -122,6 +122,8 @@ class TemporaryJsonapiFileFieldUploader {
* The lock service.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher
* (optional) The event dispatcher.
*/
public function __construct(LoggerInterface $logger, FileSystemInterface $file_system, $mime_type_guesser, Token $token, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, EventDispatcherInterface $event_dispatcher = NULL) {
$this->logger = $logger;
......
......@@ -86,6 +86,9 @@ class ContentLanguageSettings extends ConfigEntityBase implements ContentLanguag
* - target_bundle: The bundle.
* Other array elements will be used to set the corresponding properties on
* the class; see the class property documentation for details.
* @param string $entity_type
* (optional) The entity type ID that is being created. Defaults to
* "language_content_settings".
*/
public function __construct(array $values, $entity_type = 'language_content_settings') {
if (empty($values['target_entity_type_id'])) {
......
......@@ -81,6 +81,8 @@ class LanguageNegotiator implements LanguageNegotiatorInterface {
* The configuration factory.
* @param \Drupal\Core\Site\Settings $settings
* The settings instance.
* @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
* The request stack service.
*/
public function __construct(ConfigurableLanguageManagerInterface $language_manager, PluginManagerInterface $negotiator_manager, ConfigFactoryInterface $config_factory, Settings $settings, RequestStack $requestStack) {
$this->languageManager = $language_manager;
......
......@@ -37,6 +37,8 @@ class LanguageTestController implements ContainerInjectionInterface {
*
* @param \Symfony\Component\HttpKernel\HttpKernelInterface $httpKernel
* An HTTP kernel.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public function __construct(HttpKernelInterface $httpKernel, LanguageManagerInterface $language_manager) {
$this->httpKernel = $httpKernel;
......
......@@ -56,6 +56,8 @@ class LocaleDefaultConfigStorage {
* The storage object to use for reading configuration data.
* @param \Drupal\language\ConfigurableLanguageManagerInterface $language_manager
* The language manager.
* @param string $install_profile