diff --git a/core/lib/Drupal/Core/Controller/ControllerBase.php b/core/lib/Drupal/Core/Controller/ControllerBase.php index 3947f03..fae15e9 100644 --- a/core/lib/Drupal/Core/Controller/ControllerBase.php +++ b/core/lib/Drupal/Core/Controller/ControllerBase.php @@ -55,15 +55,6 @@ protected function keyValueExpirable($collection) { } /** - * Returns the locking layer instance. - * - * @return \Drupal\Core\Lock\LockBackendInterface - */ - protected function lock() { - return $this->container->get('lock'); - } - - /** * Retrieves a configuration object. * * This is the main entry point to the configuration API. Calling @@ -83,32 +74,6 @@ protected function config($name) { } /** - * Returns a queue for the given queue name. - * - * The following variables can be set by variable_set or $conf overrides: - * - queue_class_$name: The class to be used for the queue $name. - * - queue_default_class: The class to use when queue_class_$name is not - * defined. Defaults to \Drupal\Core\Queue\System, a reliable backend using - * SQL. - * - queue_default_reliable_class: The class to use when queue_class_$name is - * not defined and the queue_default_class is not reliable. Defaults to - * \Drupal\Core\Queue\System. - * - * @param string $name - * The name of the queue to work with. - * @param bool $reliable - * (optional) TRUE if the ordering of items and guaranteeing every item - * executes at least once is important, FALSE if scalability is the main - * concern. Defaults to FALSE. - * - * @return \Drupal\Core\Queue\QueueInterface - * The queue object for a given name. - */ - protected function queue($name, $reliable = FALSE) { - return $this->container->get('queue')->get($name, $reliable); - } - - /** * Returns a key/value storage collection. * * @param string $collection @@ -136,16 +101,6 @@ protected function state() { } /** - * Returns the default http client. - * - * @return \Guzzle\Http\ClientInterface - * A guzzle http client instance. - */ - protected function httpClient() { - return $this->container->get('http_default_client'); - } - - /** * Returns the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface @@ -165,13 +120,26 @@ protected function urlGenerator() { } /** - * Returns the string translation service. - * - * @return \Drupal\Core\StringTranslation\TranslationManager - * The string translation manager. + * Translates a string to the current language or to a given language using + * the string translation service. + * + * @param string $string + * A string containing the English string to translate. + * @param array $args + * An associative array of replacements to make after translation. Based + * on the first character of the key, the value is escaped and/or themed. + * See \Drupal\Core\Utility\String::format() for details. + * @param array $options + * An associative array of additional options, with the following elements: + * - 'langcode': The language code to translate to a language other than + * what is used to display the page. + * - 'context': The context the source string belongs to. + * + * @return string + * The translated string. */ - protected function translation() { - return $this->container->get('string_translation'); + protected function t($string, array $args = array(), array $options = array()) { + return $this->container->get('string_translation')->translate($string, $args, $options); } /**