Issue #2316561 by jmolivas | YesCT: Type hint hooks with interface: ConfigurableLanguageInterface instead of LanguageEntity/ConfigurableLanguage.
parent
0dfd0cadbd
commit
4d86f97385
|
@ -8,7 +8,7 @@
|
|||
use Drupal\block\BlockInterface;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\language\Entity\ConfigurableLanguage;
|
||||
use Drupal\language\ConfigurableLanguageInterface;
|
||||
use Drupal\system\Entity\Menu;
|
||||
use Drupal\block\Entity\Block;
|
||||
|
||||
|
@ -315,7 +315,7 @@ function block_menu_delete(Menu $menu) {
|
|||
*
|
||||
* Delete the potential block visibility settings of the deleted language.
|
||||
*/
|
||||
function block_configurable_language_delete(ConfigurableLanguage $language) {
|
||||
function block_configurable_language_delete(ConfigurableLanguageInterface $language) {
|
||||
// Remove the block visibility settings for the deleted language.
|
||||
foreach (Block::loadMultiple() as $block) {
|
||||
/** @var $block \Drupal\block\BlockInterface */
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\language\Entity\ConfigurableLanguage;
|
||||
use Drupal\language\ConfigurableLanguageInterface;
|
||||
use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI;
|
||||
use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
|
||||
use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrlFallback;
|
||||
|
@ -418,7 +418,7 @@ function language_modules_uninstalled($modules) {
|
|||
/**
|
||||
* Implements hook_ENTITY_TYPE_insert() for 'configurable_language'.
|
||||
*/
|
||||
function language_configurable_language_insert(ConfigurableLanguage $language) {
|
||||
function language_configurable_language_insert(ConfigurableLanguageInterface $language) {
|
||||
if ($language->isLocked()) {
|
||||
return;
|
||||
}
|
||||
|
@ -432,7 +432,7 @@ function language_configurable_language_insert(ConfigurableLanguage $language) {
|
|||
/**
|
||||
* Implements hook_ENTITY_TYPE_delete() for 'configurable_language'.
|
||||
*/
|
||||
function language_configurable_language_delete(ConfigurableLanguage $language) {
|
||||
function language_configurable_language_delete(ConfigurableLanguageInterface $language) {
|
||||
// Remove language from language prefix list.
|
||||
$prefixes = language_negotiation_url_prefixes();
|
||||
unset($prefixes[$language->id()]);
|
||||
|
|
|
@ -20,7 +20,7 @@ use Drupal\Core\Language\Language;
|
|||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\Core\StringTranslation\TranslationWrapper;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Drupal\language\Entity\ConfigurableLanguage;
|
||||
use Drupal\language\ConfigurableLanguageInterface;
|
||||
use Drupal\Component\Utility\Crypt;
|
||||
|
||||
/**
|
||||
|
@ -198,7 +198,7 @@ function locale_theme() {
|
|||
/**
|
||||
* Implements hook_ENTITY_TYPE_insert() for 'configurable_language'.
|
||||
*/
|
||||
function locale_configurable_language_insert(ConfigurableLanguage $language) {
|
||||
function locale_configurable_language_insert(ConfigurableLanguageInterface $language) {
|
||||
// @todo move these two cache clears out. See http://drupal.org/node/1293252
|
||||
// Changing the language settings impacts the interface: clear render cache.
|
||||
\Drupal::cache('render')->deleteAll();
|
||||
|
@ -209,7 +209,7 @@ function locale_configurable_language_insert(ConfigurableLanguage $language) {
|
|||
/**
|
||||
* Implements hook_ENTITY_TYPE_update() for 'configurable_language'.
|
||||
*/
|
||||
function locale_configurable_language_update(ConfigurableLanguage $language) {
|
||||
function locale_configurable_language_update(ConfigurableLanguageInterface $language) {
|
||||
// @todo move these two cache clears out. See http://drupal.org/node/1293252
|
||||
// Changing the language settings impacts the interface: clear render cache.
|
||||
\Drupal::cache('render')->deleteAll();
|
||||
|
@ -220,7 +220,7 @@ function locale_configurable_language_update(ConfigurableLanguage $language) {
|
|||
/**
|
||||
* Implements hook_ENTITY_TYPE_delete() for 'configurable_language'.
|
||||
*/
|
||||
function locale_configurable_language_delete(ConfigurableLanguage $language) {
|
||||
function locale_configurable_language_delete(ConfigurableLanguageInterface $language) {
|
||||
// Remove translations.
|
||||
\Drupal::service('locale.storage')->deleteTranslations(array('language' => $language->id()));
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
|
|||
use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
use Drupal\file\Entity\File;
|
||||
use Drupal\language\Entity\ConfigurableLanguage;
|
||||
use Drupal\language\ConfigurableLanguageInterface;
|
||||
use Drupal\block\Entity\Block;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
|
||||
|
@ -1400,7 +1400,7 @@ function node_modules_uninstalled($modules) {
|
|||
/**
|
||||
* Implements hook_ENTITY_TYPE_delete() for 'configurable_language'.
|
||||
*/
|
||||
function node_configurable_language_delete(ConfigurableLanguage $language) {
|
||||
function node_configurable_language_delete(ConfigurableLanguageInterface $language) {
|
||||
// On nodes with this language, unset the language.
|
||||
\Drupal::entityManager()->getStorage('node')->clearRevisionsLanguage($language);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue