diff --git a/core/lib/Drupal/Core/Controller/ControllerBase.php b/core/lib/Drupal/Core/Controller/ControllerBase.php index 937e813..c497c14 100644 --- a/core/lib/Drupal/Core/Controller/ControllerBase.php +++ b/core/lib/Drupal/Core/Controller/ControllerBase.php @@ -186,7 +186,7 @@ protected function urlGenerator() { /** * Renders a link to a route given a route name and its parameters. * - * @see \Drupal\Core\Utility\LinkGeneratorInterface::generate() for details + * @see \Drupal\Core\Utility\LinkGeneratorInterface::generate() for details * on the arguments, usage, and possible exceptions. * * @return string @@ -215,7 +215,7 @@ protected function currentUser() { * See the t() documentation for details. */ protected function t($string, array $args = array(), array $options = array()) { - return $this->getTranslationManager()->translate($string, $args, $options); + return $this->translationManager()->translate($string, $args, $options); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityListController.php b/core/lib/Drupal/Core/Entity/EntityListController.php index 3b1b580..1846b5f 100644 --- a/core/lib/Drupal/Core/Entity/EntityListController.php +++ b/core/lib/Drupal/Core/Entity/EntityListController.php @@ -219,7 +219,7 @@ public function render() { * See the t() documentation for details. */ protected function t($string, array $args = array(), array $options = array()) { - return $this->getTranslationManager()->translate($string, $args, $options); + return $this->translationManager()->translate($string, $args, $options); } /** @@ -228,7 +228,7 @@ protected function t($string, array $args = array(), array $options = array()) { * @return \Drupal\Core\StringTranslation\TranslationInterface * The translation manager. */ - protected function getTranslationManager() { + protected function translationManager() { if (!$this->translationManager) { $this->translationManager = \Drupal::translation(); } diff --git a/core/lib/Drupal/Core/Form/FormBase.php b/core/lib/Drupal/Core/Form/FormBase.php index b9310c9..cbdd0cc 100644 --- a/core/lib/Drupal/Core/Form/FormBase.php +++ b/core/lib/Drupal/Core/Form/FormBase.php @@ -60,7 +60,7 @@ public function validateForm(array &$form, array &$form_state) { * See the t() documentation for details. */ protected function t($string, array $args = array(), array $options = array()) { - return $this->getTranslationManager()->translate($string, $args, $options); + return $this->translationManager()->translate($string, $args, $options); } /** @@ -73,7 +73,7 @@ protected function t($string, array $args = array(), array $options = array()) { * The generated URL for the given route. */ public function url($route_name, $route_parameters = array(), $options = array()) { - return $this->getUrlGenerator()->generateFromRoute($route_name, $route_parameters, $options); + return $this->urlGenerator()->generateFromRoute($route_name, $route_parameters, $options); } /** @@ -82,7 +82,7 @@ public function url($route_name, $route_parameters = array(), $options = array() * @return \Drupal\Core\StringTranslation\TranslationInterface * The translation manager. */ - protected function getTranslationManager() { + protected function translationManager() { if (!$this->translationManager) { $this->translationManager = $this->container()->get('string_translation'); } @@ -132,7 +132,7 @@ public function setRequest(Request $request) { * @return \Drupal\Core\Session\AccountInterface * The current user. */ - protected function getCurrentUser() { + protected function currentUser() { return $this->getRequest()->attributes->get('_account'); } @@ -142,7 +142,7 @@ protected function getCurrentUser() { * @return \Drupal\Core\Routing\UrlGeneratorInterface * The URL generator. */ - protected function getUrlGenerator() { + protected function urlGenerator() { if (!$this->urlGenerator) { $this->urlGenerator = \Drupal::urlGenerator(); } diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index e873888..ec7e344 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -128,7 +128,7 @@ public function form(array $form, array &$form_state) { // this entire visibility settings section probably needs a separate user // interface in the near future. $visibility = $entity->get('visibility'); - $access = $this->getCurrentUser()->hasPermission('use PHP for settings'); + $access = $this->currentUser()->hasPermission('use PHP for settings'); if (!empty($visibility['path']['visibility']) && $visibility['path']['visibility'] == BLOCK_VISIBILITY_PHP && !$access) { $form['visibility']['path']['visibility'] = array( '#type' => 'value', diff --git a/core/modules/config/lib/Drupal/config/Controller/ConfigController.php b/core/modules/config/lib/Drupal/config/Controller/ConfigController.php index 83d6e6c..f3fd089 100644 --- a/core/modules/config/lib/Drupal/config/Controller/ConfigController.php +++ b/core/modules/config/lib/Drupal/config/Controller/ConfigController.php @@ -44,12 +44,10 @@ class ConfigController implements ContainerInjectionInterface { * {@inheritdoc} */ public static function create(ContainerInterface $container) { - $file_download = new FileDownloadController(); - $file_download->setContainer($container); return new static( $container->get('config.storage'), $container->get('config.storage.staging'), - $file_download + new FileDownloadController() ); } diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php index d674b18..6fc6704 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php @@ -102,7 +102,7 @@ public function getFormID() { * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { - $account = $this->getCurrentUser()->id(); + $account = $this->currentUser()->id(); $this->modules = $this->keyValueExpirable->get($account); // Redirect to the modules list page if the key value store is empty. @@ -140,7 +140,7 @@ public function buildForm(array $form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { // Remove the key value store entry. - $account = $this->getCurrentUser()->id(); + $account = $this->currentUser()->id(); $this->keyValueExpirable->delete($account); // Gets list of modules prior to install process. diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index ffe1253..6d4daef 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -395,7 +395,7 @@ public function submitForm(array &$form, array &$form_state) { // dependencies that are not enabled yet, redirect to the confirmation form. if (!empty($modules['dependencies']) || !empty($modules['missing'])) { // Write the list of changed module states into a key value store. - $account = $this->getCurrentUser()->id(); + $account = $this->currentUser()->id(); $this->keyValueExpirable->setWithExpire($account, $modules, 60); // Redirect to the confirmation form. diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php index be3d19f..53ba146 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php @@ -103,7 +103,7 @@ public function getFormID() { */ public function buildForm(array $form, array &$form_state) { // Retrieve the list of modules from the key value store. - $account = $this->getCurrentUser()->id(); + $account = $this->currentUser()->id(); $this->modules = $this->keyValueExpirable->get($account); // Prevent this page from showing when the module list is empty. @@ -128,7 +128,7 @@ public function buildForm(array $form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { // Clear the key value store entry. - $account = $this->getCurrentUser()->id(); + $account = $this->currentUser()->id(); $this->keyValueExpirable->delete($account); // Uninstall the modules. diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php index 33e402b..2dec552 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php @@ -140,7 +140,7 @@ public function submitForm(array &$form, array &$form_state) { // Save all the values in an expirable key value store. $modules = $form_state['values']['uninstall']; $uninstall = array_keys(array_filter($modules)); - $account = $this->getCurrentUser()->id(); + $account = $this->currentUser()->id(); $this->keyValueExpirable->setWithExpire($account, $uninstall, 60); // Redirect to the confirm form. diff --git a/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php b/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php index 124b8f9..052bd5a 100644 --- a/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php +++ b/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php @@ -42,7 +42,7 @@ public function triggerException() { */ public function triggerPDOException() { define('SIMPLETEST_COLLECT_ERRORS', FALSE); - $this->container->get('database')->query('SELECT * FROM bananas_are_awesome'); + $this->container()->get('database')->query('SELECT * FROM bananas_are_awesome'); } } diff --git a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php index 299a9e6..7800054 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php @@ -84,7 +84,7 @@ public function buildForm(array $form, array &$form_state) { ), ); // Allow logged in users to request this also. - $user = $this->getCurrentUser(); + $user = $this->currentUser(); if ($user->isAuthenticated()) { $form['name']['#type'] = 'value'; $form['name']['#value'] = $user->getEmail(); diff --git a/core/modules/user/lib/Drupal/user/ProfileFormController.php b/core/modules/user/lib/Drupal/user/ProfileFormController.php index 54b34f6..ee4f8c3 100644 --- a/core/modules/user/lib/Drupal/user/ProfileFormController.php +++ b/core/modules/user/lib/Drupal/user/ProfileFormController.php @@ -26,7 +26,7 @@ protected function actions(array $form, array &$form_state) { $account = $this->entity; // The user doing the editing. - $user = $this->getCurrentUser(); + $user = $this->currentUser(); $element['delete']['#type'] = 'submit'; $element['delete']['#value'] = $this->t('Cancel account'); $element['delete']['#submit'] = array(array($this, 'editCancelSubmit'));