<?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')
  );

}
