diff --git a/core/modules/locale/locale.api.php b/core/modules/locale/locale.api.php
index 7dfc6f3fb36ddcbdbb7f6ef6137f4fc964c16940..bd1b479cef09a2b9c56d8013fb1ebbbda937af5a 100644
--- a/core/modules/locale/locale.api.php
+++ b/core/modules/locale/locale.api.php
@@ -45,7 +45,8 @@
  * Multiple custom modules or themes sharing the same po file should have
  * matching definitions. Such as modules and sub-modules or multiple modules in
  * the same project/code tree. Both "interface translation project" and
- * "interface translation server pattern" definitions of these modules should match.
+ * "interface translation server pattern" definitions of these modules should
+ * match.
  *
  * Example .info.yml file properties for a custom module with a po file located
  * on a remote translation server.
@@ -109,7 +110,7 @@
  * @param array $projects
  *   Project data as returned by update_get_projects().
  *
- * @see locale_translation_project_list().
+ * @see locale_translation_project_list()
  * @ingroup interface_translation_properties
  */
 function hook_locale_translation_projects_alter(&$projects) {
diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc
index f2e7330292d0cdf9a0695a17549e69aeba8e1477..fbda3e83517219e0ca2071da28bff070a3a424cf 100644
--- a/core/modules/locale/locale.batch.inc
+++ b/core/modules/locale/locale.batch.inc
@@ -2,7 +2,7 @@
 
 /**
  * @file
- *   Batch process to check the availability of remote or local po files.
+ * Batch process to check the availability of remote or local po files.
  */
 
 use GuzzleHttp\Exception\RequestException;
@@ -85,7 +85,7 @@ function locale_translation_batch_status_check($project, $langcode, $options = a
 /**
  * Batch finished callback: Set result message.
  *
- * @param boolean $success
+ * @param bool $success
  *   TRUE if batch successfully completed.
  * @param array $results
  *   Batch results.
@@ -93,13 +93,13 @@ function locale_translation_batch_status_check($project, $langcode, $options = a
 function locale_translation_batch_status_finished($success, $results) {
   if ($success) {
     if (isset($results['failed_files'])) {
-        if (\Drupal::moduleHandler()->moduleExists('dblog')) {
-          $message = format_plural(count($results['failed_files']), 'One translation file could not be checked. <a href="@url">See the log</a> for details.', '@count translation files could not be checked. <a href="@url">See the log</a> for details.', array('@url' => url('admin/reports/dblog')));
-        }
-        else {
-          $message = format_plural(count($results['failed_files']), 'One translation files could not be checked. See the log for details.', '@count translation files could not be checked. See the log for details.');
-        }
-        drupal_set_message($message, 'error');
+      if (\Drupal::moduleHandler()->moduleExists('dblog')) {
+        $message = format_plural(count($results['failed_files']), 'One translation file could not be checked. <a href="@url">See the log</a> for details.', '@count translation files could not be checked. <a href="@url">See the log</a> for details.', array('@url' => url('admin/reports/dblog')));
+      }
+      else {
+        $message = format_plural(count($results['failed_files']), 'One translation files could not be checked. See the log for details.', '@count translation files could not be checked. See the log for details.');
+      }
+      drupal_set_message($message, 'error');
     }
     if (isset($results['files'])) {
       drupal_set_message(format_plural(
@@ -201,9 +201,9 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$
 /**
  * Batch finished callback: Set result message.
  *
- * @param boolean $success
+ * @param bool $success
  *   TRUE if batch successfully completed.
- * @param array
+ * @param array $results
  *   Batch results.
  */
 function locale_translation_batch_fetch_finished($success, $results) {
@@ -220,7 +220,7 @@ function locale_translation_batch_fetch_finished($success, $results) {
  * @param string $uri
  *   URI of remote file.
  *
- * @return array|boolean
+ * @return array|bool
  *   Associative array of file data with the following elements:
  *   - last_modified: Last modified timestamp of the translation file.
  *   - (optional) location: The location of the translation file. Is only set
diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc
index f1fe8e8fcabe4289de01994f1a7aa8065ebd7d7c..3dd25b7f5f96f32f613358c2173568ae5b24e201 100644
--- a/core/modules/locale/locale.bulk.inc
+++ b/core/modules/locale/locale.bulk.inc
@@ -24,7 +24,6 @@
  *     LOCALE_NOT_CUSTOMIZED.
  *   - 'finish_feedback': Whether or not to give feedback to the user when the
  *     batch is finished. Optional, defaults to TRUE.
- *
  * @param $force
  *   (optional) Import all available files, even if they were imported before.
  *
@@ -75,8 +74,8 @@ function locale_translate_batch_import_files($options, $force = FALSE) {
  *   Project names from which to get the translation files and history.
  *   Defaults to all projects.
  * @param array $langcodes
- *   Language codes from which to  get the translation files and history.
- *   Defaults to all languagues
+ *   Language codes from which to get the translation files and history.
+ *   Defaults to all languages.
  *
  * @return array
  *   An array of interface translation files keyed by their URI.
@@ -112,7 +111,6 @@ function locale_translate_get_interface_translation_files($projects = array(), $
  *
  * @param $files
  *   Array of file objects to import.
- *
  * @param array $options
  *   An array with options that can have the following elements:
  *   - 'langcode': The language code. Optional, defaults to NULL, which means
@@ -142,7 +140,7 @@ function locale_translate_batch_build($files, $options) {
       $operations[] = array('locale_translate_batch_import', array($file, $options));
     }
     // Save the translation status of all files.
-    $operations[] =  array('locale_translate_batch_import_save', array());
+    $operations[] = array('locale_translate_batch_import_save', array());
 
     // Add a final step to refresh JavaScript and configuration strings.
     $operations[] = array('locale_translate_batch_refresh', array());
@@ -167,10 +165,9 @@ function locale_translate_batch_build($files, $options) {
  *
  * @param object $file
  *   A file object of the gettext file to be imported. The file object must
- *   contain a language parameter
- *   (other than LanguageInterface::LANGCODE_NOT_SPECIFIED). This is used as
- *   the language of the import.
- *
+ *   contain a language parameter (other than
+ *   LanguageInterface::LANGCODE_NOT_SPECIFIED). This is used as the language of
+ *   the import.
  * @param array $options
  *   An array with options that can have the following elements:
  *   - 'langcode': The language code.
@@ -182,7 +179,6 @@ function locale_translate_batch_build($files, $options) {
  *     LOCALE_NOT_CUSTOMIZED.
  *   - 'message': Alternative message to display during import. Note, this must
  *     be sanitized text.
- *
  * @param $context
  *   Contains a list of files imported.
  */
@@ -474,9 +470,9 @@ function locale_translate_file_attach_properties($file, $options = array()) {
  *   Defaults to all projects.
  * @param array $langcodes
  *   Language codes from which to delete the translation files and history.
- *   Defaults to all languagues
+ *   Defaults to all languages.
  *
- * @return boolean
+ * @return bool
  *   TRUE if files are removed successfully. FALSE if one or more files could
  *   not be deleted.
  */
@@ -543,10 +539,10 @@ function locale_config_batch_build(array $names, array $langcodes, $options = ar
   foreach ($names as $name) {
     $batch_names[] = $name;
     $i++;
-    // During installation the caching of configuration objects is disabled
-    // so it is very expensive to initialize the \Drupal::config() object on each request.
-    // We batch a small number of configuration object upgrades together to
-    // improve the overall performance of the process.
+    // During installation the caching of configuration objects is disabled so
+    // it is very expensive to initialize the \Drupal::config() object on each
+    // request. We batch a small number of configuration object upgrades
+    // together to improve the overall performance of the process.
     if ($i % 20 == 0) {
       $operations[] = array('locale_config_batch_refresh_name', array($batch_names, $langcodes));
       $batch_names = array();
@@ -571,7 +567,7 @@ function locale_config_batch_build(array $names, array $langcodes, $options = ar
 /**
  * Performs configuration translation refresh as a batch step.
  *
- * @param string $name
+ * @param string $names
  *   Name of configuration object to update.
  * @param array $langcodes
  *   (optional) Array of language codes to update. Defaults to all languages.
@@ -595,12 +591,12 @@ function locale_config_batch_refresh_name(array $names, array $langcodes, array
 /**
  * Finishes callback of system page locale import batch.
  *
- * @see locale_config_batch_build()
- *
  * @param bool $success
  *   Information about the success of the batch import.
  * @param array $results
  *   Information about the results of the batch import.
+ *
+ * @see locale_config_batch_build()
  */
 function locale_config_batch_finished($success, array $results) {
   if ($success) {
diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc
index dad67a8510846fec608e4eb596f46f1180b30829..941c3903561ff8fc4731056974c4bad2fbbbda2b 100644
--- a/core/modules/locale/locale.compare.inc
+++ b/core/modules/locale/locale.compare.inc
@@ -114,8 +114,8 @@ function locale_translation_build_projects() {
       ))
       ->execute();
 
-      // Invalidate the cache of translatable projects.
-      locale_translation_clear_cache_projects();
+    // Invalidate the cache of translatable projects.
+    locale_translation_clear_cache_projects();
   }
   return $projects;
 }
@@ -193,7 +193,8 @@ function _locale_translation_prepare_project_list($data, $type) {
 function locale_translation_default_translation_server() {
   $pattern = \Drupal::config('locale.settings')->get('translation.default_server_pattern');
   // An additional check is required here. During the upgrade process
-  // \Drupal::config()->get() returns NULL. We use the defined value as fallback.
+  // \Drupal::config()->get() returns NULL. We use the defined value as
+  // fallback.
   $pattern  = $pattern ? $pattern : LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN;
 
   return array(
@@ -211,8 +212,9 @@ function locale_translation_default_translation_server() {
  *
  * @return array
  *   Available sources indexed by project and language.
+ *
+ * @todo Return batch or NULL.
  */
-// @todo Return batch or NULL
 function locale_translation_check_projects($projects = array(), $langcodes = array()) {
   if (locale_translation_use_remote_source()) {
     // Retrieve the status of both remote and local translation sources by
diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install
index c62c842eab9951b46131a08440bd1da369f46dc6..dd004129679f6c59488ea7c255278dfd3f84bac9 100644
--- a/core/modules/locale/locale.install
+++ b/core/modules/locale/locale.install
@@ -123,7 +123,7 @@ function locale_schema() {
       ),
     ),
     'indexes' => array(
-      'lid'      => array('lid'),
+      'lid' => array('lid'),
     ),
   );
 
@@ -170,8 +170,8 @@ function locale_schema() {
       ),
     ),
     'indexes' => array(
-       'string_id' => array('sid'),
-       'string_type' => array('sid', 'type'),
+      'string_id' => array('sid'),
+      'string_type' => array('sid', 'type'),
     ),
   );
 
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index a0efd9fc06739060d6ae093fef2d5a0bb0e7a73c..0728d0762f6fead89f7406a4f8cda68847d0e86a 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -155,13 +155,14 @@ function locale_help($route_name, RouteMatchInterface $route_match) {
       return $output;
 
     case 'language.admin_overview':
-        return '<p>' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. The report <a href="!update">Available translation updates</a> shows the status. Interface text can be customized in the <a href="!translate">user interface translation</a> page.', array('!update' => \Drupal::url('locale.translate_status'), '!translate' => \Drupal::url('locale.translate_page'))) . '</p>';
+      return '<p>' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. The report <a href="!update">Available translation updates</a> shows the status. Interface text can be customized in the <a href="!translate">user interface translation</a> page.', array('!update' => \Drupal::url('locale.translate_status'), '!translate' => \Drupal::url('locale.translate_page'))) . '</p>';
+
     case 'locale.translate_page':
       $output = '<p>' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: Because translation tasks involve many strings, it may be more convenient to <a title="User interface translation export" href="!export">export</a> strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings in a specific language.', array('!export' => \Drupal::url('locale.translate_export'))) . '</p>';
       return $output;
 
     case 'locale.translate_import':
-      $output = '<p>' . t('Translation files are automatically downloaded and imported when <a title="Languages" href="!language">languages</a> are added, or when modules or themes are enabled.', array('!language' => \Drupal::url('language.admin_overview'))). '</p>';
+      $output = '<p>' . t('Translation files are automatically downloaded and imported when <a title="Languages" href="!language">languages</a> are added, or when modules or themes are enabled.', array('!language' => \Drupal::url('language.admin_overview'))) . '</p>';
       $output .= '<p>' . t('This page allows translators to manually import translated strings contained in a Gettext Portable Object (.po) file. Manual import may be used for customized translations or for the translation of custom modules and themes. To customize translations you can download a translation file from the <a href="!url">Drupal translation server</a> or <a title="User interface translation export" href="!export">export</a> translations from the site, customize the translations using a Gettext translation editor, and import the result using this page.', array('!url' => 'https://localize.drupal.org', '!export' => \Drupal::url('locale.translate_export'))) . '</p>';
       $output .= '<p>' . t('Note that importing large .po files may take several minutes.') . '</p>';
       return $output;
@@ -290,6 +291,7 @@ function locale_translatable_language_list() {
  * @param $langcode
  *   Optional language code to translate to a language other than
  *   what is used to display the page.
+ *
  * @return
  *   The numeric index of the plural variant to use for this $langcode and
  *   $count combination or -1 if the language was not found or does not have a
@@ -412,7 +414,7 @@ function locale_queue_info() {
  * queue data.
  *
  * @param array $data
- * Queue data array containing:
+ *   Queue data array containing:
  *   - Function name.
  *   - Array of function arguments. Optionally contains the batch context data.
  *
@@ -481,7 +483,8 @@ function locale_system_update(array $components) {
     $projects = array_keys(locale_translation_build_projects());
     if ($list = array_intersect($list, $projects)) {
       module_load_include('fetch.inc', 'locale');
-      // Get translation status of the projects, download and update translations.
+      // Get translation status of the projects, download and update
+      // translations.
       $options = _locale_translation_default_update_options();
       $batch = locale_translation_batch_update_build($list, array(), $options);
       batch_set($batch);
@@ -514,7 +517,8 @@ function locale_system_remove($components) {
     \Drupal\locale\Locale::config()->deleteComponentTranslations($components, array_keys($language_list));
 
     // Only when projects are removed, the translation files and records will be
-    // deleted. Not each disabled module will remove a project. E.g. sub modules.
+    // deleted. Not each disabled module will remove a project, e.g., sub
+    // modules.
     $projects = array_keys(locale_translation_get_projects());
     if ($list = array_intersect($list, $projects)) {
       locale_translation_file_history_delete($list);
@@ -561,6 +565,7 @@ function locale_js_alter(&$javascript) {
  *
  * @param array $files
  *   An array of local file paths.
+ *
  * @return string|null
  *   The filepath to the translation file or NULL if no translation is
  *   applicable.
@@ -693,7 +698,7 @@ function locale_form_language_admin_overview_form_alter(&$form, &$form_state) {
 }
 
 /**
- * Implements hook_form_FORM_ID_alter() for language_admin_add_form(().
+ * Implements hook_form_FORM_ID_alter() for language_admin_add_form().
  */
 function locale_form_language_admin_add_form_alter(&$form, &$form_state) {
   $form['predefined_submit']['#submit'][] = 'locale_form_language_admin_add_form_alter_submit';
@@ -847,7 +852,7 @@ function locale_translation_get_file_history() {
  * @param object $file
  *   Object representing the file just imported.
  *
- * @return integer
+ * @return int
  *   FALSE on failure. Otherwise SAVED_NEW or SAVED_UPDATED.
  */
 function locale_translation_update_file_history($file) {
@@ -874,7 +879,7 @@ function locale_translation_update_file_history($file) {
  * @param array $projects
  *   Project name(s) to be deleted from the file history. If both project(s) and
  *   language code(s) are specified the conditions will be ANDed.
- * @param array $langcode
+ * @param array $langcodes
  *   Language code(s) to be deleted from the file history.
  */
 function locale_translation_file_history_delete($projects = array(), $langcodes = array()) {
@@ -963,6 +968,7 @@ function locale_translation_status_save($project, $langcode, $type, $data) {
           }
         }
         break;
+
       case LOCALE_TRANSLATION_CURRENT:
         $data->last_checked = REQUEST_TIME;
         $status[$project][$langcode]->timestamp = $data->timestamp;
@@ -1200,7 +1206,8 @@ function _locale_parse_js_file($filepath) {
     $source = \Drupal::service('locale.storage')->findString($match);
 
     if (!$source) {
-      // We don't have the source string yet, thus we insert it into the database.
+      // We don't have the source string yet, thus we insert it into the
+      // database.
       $source = \Drupal::service('locale.storage')->createString($match);
     }
 
@@ -1267,7 +1274,7 @@ function _locale_rebuild_js($langcode = NULL) {
   // Only add strings with a translation to the translations array.
   $conditions = array(
     'type' => 'javascript',
-    'language' =>  $language->id,
+    'language' => $language->id,
     'translated' => TRUE,
   );
   $translations = array();
@@ -1296,7 +1303,8 @@ function _locale_rebuild_js($langcode = NULL) {
   // There is (on purpose) no front end to edit that variable.
   $dir = 'public://' . $config->get('javascript.directory');
 
-  // Delete old file, if we have no translations anymore, or a different file to be saved.
+  // Delete old file, if we have no translations anymore, or a different file to
+  // be saved.
   $locale_javascripts = \Drupal::state()->get('locale.translation.javascript') ?: array();
   $changed_hash = !isset($locale_javascripts[$language->id]) || ($locale_javascripts[$language->id] != $data_hash);
   if (!empty($locale_javascripts[$language->id]) && (!$data || $changed_hash)) {
@@ -1353,17 +1361,21 @@ function _locale_rebuild_js($langcode = NULL) {
 
     case 'rebuilt':
       $logger->warning('JavaScript translation file %file.js was lost.', array('%file' => $locale_javascripts[$language->id]));
-    // Proceed to the 'created' case as the JavaScript translation file has
-    // been created again.
+      // Proceed to the 'created' case as the JavaScript translation file has
+      // been created again.
+
     case 'created':
       $logger->notice('Created JavaScript translation file for the language %language.', array('%language' => $language->name));
       return TRUE;
+
     case 'deleted':
       $logger->notice('Removed JavaScript translation file for the language %language because no translations currently exist for that language.', array('%language' => $language->name));
       return TRUE;
+
     case 'error':
       $logger->error('An error occurred during creation of the JavaScript translation file for the language %language.', array('%language' => $language->name));
       return FALSE;
+
     default:
       // No operation needed.
       return TRUE;
diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc
index fab2a21f279fee732ded14c9679a8d8c53d41032..a9129898801dfb7d28445d973ab00a4c1a350519 100644
--- a/core/modules/locale/locale.translation.inc
+++ b/core/modules/locale/locale.translation.inc
@@ -9,6 +9,7 @@
  * Comparison result of source files timestamps.
  *
  * Timestamp of source 1 is less than the timestamp of source 2.
+ *
  * @see _locale_translation_source_compare()
  */
 const LOCALE_TRANSLATION_SOURCE_COMPARE_LT = -1;
@@ -17,6 +18,7 @@
  * Comparison result of source files timestamps.
  *
  * Timestamp of source 1 is equal to the timestamp of source 2.
+ *
  * @see _locale_translation_source_compare()
  */
 const LOCALE_TRANSLATION_SOURCE_COMPARE_EQ = 0;
@@ -25,6 +27,7 @@
  * Comparison result of source files timestamps.
  *
  * Timestamp of source 1 is greater than the timestamp of source 2.
+ *
  * @see _locale_translation_source_compare()
  */
 const LOCALE_TRANSLATION_SOURCE_COMPARE_GT = 1;
@@ -41,8 +44,8 @@
  * disabled this function will return the last known module state. The status
  * will only be updated once Update module is enabled.
  *
- *  @params array $project_names
- *    Array of names of the projects to get.
+ * @param array $project_names
+ *   Array of names of the projects to get.
  *
  * @return array
  *   Array of project data for translation update.
@@ -107,7 +110,7 @@ function locale_translation_load_sources($projects = NULL, $langcodes = NULL) {
   $status = locale_translation_get_status();
 
   // Use only the selected projects and languages for update.
-  foreach($projects as $project) {
+  foreach ($projects as $project) {
     foreach ($langcodes as $langcode) {
       $sources[$project][$langcode] = isset($status[$project][$langcode]) ? $status[$project][$langcode] : NULL;
     }
@@ -158,7 +161,7 @@ function locale_translation_build_sources($projects = array(), $langcodes = arra
  * @param object $source
  *   Translation source object.
  *
- * @return stdClass
+ * @return object
  *   Source file object of the po file, updated with:
  *   - "uri": File name and path.
  *   - "timestamp": Last updated time of the po file.
@@ -203,8 +206,8 @@ function locale_translation_source_check_file($source) {
  *   - "files": Array of file objects containing properties of local and remote
  *     translation files.
  *   Other processes can add the following properties:
- *   - "type": Most recent translation source found. LOCALE_TRANSLATION_REMOTE and
- *      LOCALE_TRANSLATION_LOCAL indicate available new translations,
+ *   - "type": Most recent translation source found. LOCALE_TRANSLATION_REMOTE
+ *      and LOCALE_TRANSLATION_LOCAL indicate available new translations,
  *      LOCALE_TRANSLATION_CURRENT indicate that the current translation is them
  *      most recent. "type" sorresponds with a key of the "files" array.
  *   - "timestamp": The creation time of the "type" translation (file).
@@ -367,7 +370,7 @@ function locale_cron_fill_queue() {
  * @param string $uri
  *   The URI or URI pattern of the file.
  *
- * @return boolean
+ * @return bool
  *   TRUE if the $uri is a remote file.
  */
 function _locale_translation_file_is_remote($uri) {
@@ -389,7 +392,7 @@ function _locale_translation_file_is_remote($uri) {
  * @param object $source2
  *   Source object of available update.
  *
- * @return integer
+ * @return int
  *   - "LOCALE_TRANSLATION_SOURCE_COMPARE_LT": $source1 < $source2 OR $source1
  *     is missing.
  *   - "LOCALE_TRANSLATION_SOURCE_COMPARE_EQ":  $source1 == $source2 OR both
diff --git a/core/modules/locale/src/Form/ExportForm.php b/core/modules/locale/src/Form/ExportForm.php
index 70f611caa623fef97d56080353af8b146446c6ef..ea4a153fe03968285fe64cd6e4dc6293595b803d 100644
--- a/core/modules/locale/src/Form/ExportForm.php
+++ b/core/modules/locale/src/Form/ExportForm.php
@@ -115,11 +115,11 @@ public function buildForm(array $form, array &$form_state) {
     }
 
     $form['actions'] = array(
-      '#type' => 'actions'
+      '#type' => 'actions',
     );
     $form['actions']['submit'] = array(
       '#type' => 'submit',
-      '#value' => $this->t('Export')
+      '#value' => $this->t('Export'),
     );
     return $form;
   }
@@ -137,13 +137,13 @@ public function submitForm(array &$form, array &$form_state) {
     }
     $content_options = isset($form_state['values']['content_options']) ? $form_state['values']['content_options'] : array();
     $reader = new PoDatabaseReader();
-    $languageName = '';
+    $language_name = '';
     if ($language != NULL) {
       $reader->setLangcode($language->id);
       $reader->setOptions($content_options);
       $languages = $this->languageManager->getLanguages();
-      $languageName = isset($languages[$language->id]) ? $languages[$language->id]->name : '';
-      $filename = $language->id .'.po';
+      $language_name = isset($languages[$language->id]) ? $languages[$language->id]->name : '';
+      $filename = $language->id . '.po';
     }
     else {
       // Template required.
@@ -155,9 +155,9 @@ public function submitForm(array &$form, array &$form_state) {
       $uri = tempnam('temporary://', 'po_');
       $header = $reader->getHeader();
       $header->setProjectName($this->config('system.site')->get('name'));
-      $header->setLanguageName($languageName);
+      $header->setLanguageName($language_name);
 
-      $writer = new PoStreamWriter;
+      $writer = new PoStreamWriter();
       $writer->setUri($uri);
       $writer->setHeader($header);
 
diff --git a/core/modules/locale/src/Form/ImportForm.php b/core/modules/locale/src/Form/ImportForm.php
index f1ae6a1c79058a5f6e464ec28d40f2314421a953..544dc36f287de67a16987016c5f2e7b0d8989fda 100644
--- a/core/modules/locale/src/Form/ImportForm.php
+++ b/core/modules/locale/src/Form/ImportForm.php
@@ -109,7 +109,7 @@ public function buildForm(array $form, array &$form_state) {
         '#theme' => 'file_upload_help',
         '#description' => $this->t('A Gettext Portable Object file.'),
         '#upload_validators' => $validators,
-       ),
+      ),
       '#size' => 50,
       '#upload_validators' => $validators,
       '#attributes' => array('class' => array('file-import-input')),
@@ -145,11 +145,11 @@ public function buildForm(array $form, array &$form_state) {
     );
 
     $form['actions'] = array(
-      '#type' => 'actions'
+      '#type' => 'actions',
     );
     $form['actions']['submit'] = array(
       '#type' => 'submit',
-      '#value' => $this->t('Import')
+      '#value' => $this->t('Import'),
     );
     return $form;
   }
@@ -174,7 +174,7 @@ public function submitForm(array &$form, array &$form_state) {
     $language = $this->languageManager->getLanguage($form_state['values']['langcode']);
     if (empty($language)) {
       $language = new Language(array(
-        'id' => $form_state['values']['langcode']
+        'id' => $form_state['values']['langcode'],
       ));
       $language = language_save($language);
       drupal_set_message($this->t('The language %language has been created.', array('%language' => $this->t($language->name))));
diff --git a/core/modules/locale/src/Form/LocaleSettingsForm.php b/core/modules/locale/src/Form/LocaleSettingsForm.php
index 5bc2968ac15df4b7e9f7888f803d4c6cdabec406..e1b13d07016005b61c20cc8d4f44d21e73851b40 100644
--- a/core/modules/locale/src/Form/LocaleSettingsForm.php
+++ b/core/modules/locale/src/Form/LocaleSettingsForm.php
@@ -108,12 +108,14 @@ public function submitForm(array &$form, array &$form_state) {
           ->set('translation.overwrite_not_customized', TRUE)
           ->save();
         break;
+
       case LOCALE_TRANSLATION_OVERWRITE_NON_CUSTOMIZED:
         $config
           ->set('translation.overwrite_customized', FALSE)
           ->set('translation.overwrite_not_customized', TRUE)
           ->save();
         break;
+
       case LOCALE_TRANSLATION_OVERWRITE_NONE:
         $config
           ->set('translation.overwrite_customized', FALSE)
@@ -122,8 +124,8 @@ public function submitForm(array &$form, array &$form_state) {
         break;
     }
 
-    // Invalidate the cached translation status when the configuration setting of
-    // 'use_source' changes.
+    // Invalidate the cached translation status when the configuration setting
+    // of 'use_source' changes.
     if ($form['use_source']['#default_value'] != $form_state['values']['use_source']) {
       locale_translation_clear_status();
     }
diff --git a/core/modules/locale/src/Form/TranslateEditForm.php b/core/modules/locale/src/Form/TranslateEditForm.php
index c846026ffeb9ab96bbca455fddb756e02ce190bc..c01accbffd6d8914093f096d5918b88576f2394a 100644
--- a/core/modules/locale/src/Form/TranslateEditForm.php
+++ b/core/modules/locale/src/Form/TranslateEditForm.php
@@ -83,7 +83,7 @@ public function buildForm(array $form, array &$form_state) {
             '#type' => 'item',
             '#title' => $this->t('Singular form'),
             '#markup' => '<span lang="en">' . String::checkPlain($source_array[0]) . '</span>',
-            '#prefix' => '<span class="visually-hidden">' . $this->t('Source string (@language)', array('@language' => $this->t('Built-in English'))) . '</span>'
+            '#prefix' => '<span class="visually-hidden">' . $this->t('Source string (@language)', array('@language' => $this->t('Built-in English'))) . '</span>',
           );
           $form['strings'][$string->lid]['original_plural'] = array(
             '#type' => 'item',
@@ -120,7 +120,7 @@ public function buildForm(array $form, array &$form_state) {
                 '#rows' => $rows,
                 '#default_value' => isset($translation_array[$i]) ? $translation_array[$i] : '',
                 '#attributes' => array('lang' => $langcode),
-                '#prefix' => $i == 0 ? ('<span class="visually-hidden">' . $this->t('Translated string (@language)',  array('@language' => $langname)) . '</span>') : '',
+                '#prefix' => $i == 0 ? ('<span class="visually-hidden">' . $this->t('Translated string (@language)', array('@language' => $langname)) . '</span>') : '',
               );
             }
           }
@@ -132,7 +132,7 @@ public function buildForm(array $form, array &$form_state) {
               '#rows' => $rows,
               '#default_value' => $translation_array[0],
               '#attributes' => array('lang' => $langcode),
-              '#prefix' => '<span class="visually-hidden">' . $this->t('Translated string (@language)',  array('@language' => $langname)) . '</span>',
+              '#prefix' => '<span class="visually-hidden">' . $this->t('Translated string (@language)', array('@language' => $langname)) . '</span>',
             );
             $form['strings'][$string->lid]['translations'][1] = array(
               '#type' => 'textarea',
@@ -189,7 +189,8 @@ public function submitForm(array &$form, array &$form_state) {
       $existing_translation = isset($existing_translation_objects[$lid]);
 
       // Plural translations are saved in a delimited string. To be able to
-      // compare the new strings with the existing strings a string in the same format is created.
+      // compare the new strings with the existing strings a string in the same
+      // format is created.
       $new_translation_string_delimited = implode(LOCALE_PLURAL_DELIMITER, $new_translation['translations']);
 
       // Generate an imploded string without delimiter, to be able to run
diff --git a/core/modules/locale/src/Form/TranslateFormBase.php b/core/modules/locale/src/Form/TranslateFormBase.php
index e0e4ac2dcb5b500af467b82bed4ced5b1d357cd5..d86027bcbabbe54f6d4c165fdc840cef75afcf79 100644
--- a/core/modules/locale/src/Form/TranslateFormBase.php
+++ b/core/modules/locale/src/Form/TranslateFormBase.php
@@ -120,7 +120,7 @@ protected function translateFilterLoadStrings() {
    * @param bool $reset
    *   If the list of values should be reset.
    *
-   * @return array $filter_values
+   * @return array
    *   The filter values.
    */
   protected function translateFilterValues($reset = FALSE) {
diff --git a/core/modules/locale/src/Gettext.php b/core/modules/locale/src/Gettext.php
index 4e73c6f73a68d491139c7a918c8b173bfb23d48d..cd993b31436d5ddc8a800668013da7a0033cab97 100644
--- a/core/modules/locale/src/Gettext.php
+++ b/core/modules/locale/src/Gettext.php
@@ -46,7 +46,7 @@ class Gettext {
    *
    * @see \Drupal\locale\PoDatabaseWriter
    */
-  static function fileToDatabase($file, $options) {
+  public static function fileToDatabase($file, $options) {
     // Add the default values to the options array.
     $options += array(
       'overwrite_options' => array(),
diff --git a/core/modules/locale/src/LocaleConfigManager.php b/core/modules/locale/src/LocaleConfigManager.php
index 07a6f415975be60f5b4f537cb9da010a3cec829b..73d653cc013a515d4f5934544762e5b405582dc5 100644
--- a/core/modules/locale/src/LocaleConfigManager.php
+++ b/core/modules/locale/src/LocaleConfigManager.php
@@ -68,24 +68,24 @@ class LocaleConfigManager {
   /**
    * Creates a new typed configuration manager.
    *
-   * @param \Drupal\Core\Config\StorageInterface $configStorage
+   * @param \Drupal\Core\Config\StorageInterface $config_storage
    *   The storage object to use for reading configuration data.
-   * @param \Drupal\Core\Config\StorageInterface $installStorage
+   * @param \Drupal\Core\Config\StorageInterface $install_storage
    *   The storage object to use for reading default configuration
    *   data.
-   * @param \Drupal\locale\StringStorageInterface $localeStorage
+   * @param \Drupal\locale\StringStorageInterface $locale_storage
    *   The locale storage to use for reading string translations.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   The configuration factory
    * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config
    *   The typed configuration manager.
-   * @param \Drupal\language\ConfigurableLanguageManagerInterface
+   * @param \Drupal\language\ConfigurableLanguageManagerInterface $language_manager
    *   The language manager.
    */
-  public function __construct(StorageInterface $configStorage, StorageInterface $installStorage, StringStorageInterface $localeStorage, ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config, ConfigurableLanguageManagerInterface $language_manager) {
-    $this->configStorage = $configStorage;
-    $this->installStorage = $installStorage;
-    $this->localeStorage = $localeStorage;
+  public function __construct(StorageInterface $config_storage, StorageInterface $install_storage, StringStorageInterface $locale_storage, ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config, ConfigurableLanguageManagerInterface $language_manager) {
+    $this->configStorage = $config_storage;
+    $this->installStorage = $install_storage;
+    $this->localeStorage = $locale_storage;
     $this->configFactory = $config_factory;
     $this->typedConfigManager = $typed_config;
     $this->languageManager = $language_manager;
@@ -273,7 +273,7 @@ public function translateString($name, $langcode, $source, $context) {
       if (!isset($this->translations[$name][$langcode])) {
         // Preload all translations for this configuration name and language.
         $this->translations[$name][$langcode] = array();
-        foreach ($this->localeStorage->getTranslations(array('language' => $langcode, 'type' => 'configuration', 'name' => $name)) as $string){
+        foreach ($this->localeStorage->getTranslations(array('language' => $langcode, 'type' => 'configuration', 'name' => $name)) as $string) {
           $this->translations[$name][$langcode][$string->context][$string->source] = $string;
         }
       }
diff --git a/core/modules/locale/src/LocaleLookup.php b/core/modules/locale/src/LocaleLookup.php
index 277c16104502613d914a10f88f0f2c4ba62e657c..960495ef6f189f21a8e222ea6641638b7bc7ebfa 100644
--- a/core/modules/locale/src/LocaleLookup.php
+++ b/core/modules/locale/src/LocaleLookup.php
@@ -119,7 +119,7 @@ protected function resolveCacheMiss($offset) {
       $this->stringStorage->createString(array(
         'source' => $offset,
         'context' => $this->context,
-        'version' => \Drupal::VERSION
+        'version' => \Drupal::VERSION,
       ))->addLocation('path', $this->requestUri())->save();
       $value = TRUE;
     }
@@ -129,7 +129,7 @@ protected function resolveCacheMiss($offset) {
     if ($value === TRUE) {
       $fallbacks = $this->languageManager->getFallbackCandidates($this->langcode, array('operation' => 'locale_lookup', 'data' => $offset));
       if (!empty($fallbacks)) {
-        foreach($fallbacks as $langcode) {
+        foreach ($fallbacks as $langcode) {
           $translation = $this->stringStorage->findTranslation(array(
             'language' => $langcode,
             'source' => $offset,
diff --git a/core/modules/locale/src/LocaleTranslation.php b/core/modules/locale/src/LocaleTranslation.php
index d9a9800690c6d32c9afd86c6dc89201213c684f0..717f2fac1f565c34844fef4f5cd7d0cfdd8b4abc 100644
--- a/core/modules/locale/src/LocaleTranslation.php
+++ b/core/modules/locale/src/LocaleTranslation.php
@@ -38,7 +38,7 @@ class LocaleTranslation implements TranslatorInterface, DestructableInterface {
   protected $configFactory;
 
   /**
-   * Cached translations
+   * Cached translations.
    *
    * @var array
    *   Array of \Drupal\locale\LocaleLookup objects indexed by language code
diff --git a/core/modules/locale/src/LocaleTypedConfig.php b/core/modules/locale/src/LocaleTypedConfig.php
index eeccaa823b78b9c4145f97cefcc9083d7d81bfe6..61cf26ba87787ccbb89c084f95da0eaae7dd5200 100644
--- a/core/modules/locale/src/LocaleTypedConfig.php
+++ b/core/modules/locale/src/LocaleTypedConfig.php
@@ -55,13 +55,13 @@ class LocaleTypedConfig extends Element {
    *   The configuration object name.
    * @param string $langcode
    *   Language code for the source configuration data.
-   * @param \Drupal\locale\LocaleConfigManager $localeConfig;
+   * @param \Drupal\locale\LocaleConfigManager $locale_config
    *   The locale configuration manager object.
    */
-  public function __construct(DataDefinitionInterface $definition, $name, $langcode, LocaleConfigManager $localeConfig, TypedConfigManagerInterface $typed_config) {
+  public function __construct(DataDefinitionInterface $definition, $name, $langcode, LocaleConfigManager $locale_config, TypedConfigManagerInterface $typed_config) {
     parent::__construct($definition, $name);
     $this->langcode = $langcode;
-    $this->localeConfig = $localeConfig;
+    $this->localeConfig = $locale_config;
     $this->typedConfigManager = $typed_config;
   }
 
@@ -117,7 +117,7 @@ protected function canTranslate($from_langcode, $to_langcode) {
    *   \Drupal\Core\Config\Schema\ArrayElement.
    * @param array $options
    *   Array with translation options that must contain the keys defined in
-   *   \Drupal\locale\LocaleTypedConfig::translateElement()
+   *   \Drupal\locale\LocaleTypedConfig::translateElement().
    *
    * @return array
    *   Configuration data translated to the requested language if available,
@@ -141,7 +141,7 @@ protected function getElementTranslation($element, array $options) {
    *   Typed configuration array element.
    * @param array $options
    *   Array with translation options that must contain the keys defined in
-   *   \Drupal\locale\LocaleTypedConfig::translateElement()
+   *   \Drupal\locale\LocaleTypedConfig::translateElement().
    *
    * @return array
    *   Configuration data translated to the requested language.
diff --git a/core/modules/locale/src/PoDatabaseReader.php b/core/modules/locale/src/PoDatabaseReader.php
index e545fe12605c4b73afb1987ffffc9d4a87576176..6efbfc49d56179cce8627b463896fb4941f912d6 100644
--- a/core/modules/locale/src/PoDatabaseReader.php
+++ b/core/modules/locale/src/PoDatabaseReader.php
@@ -31,26 +31,26 @@ class PoDatabaseReader implements PoReaderInterface {
    *
    * @var array
    */
-  private $_options;
+  private $options;
 
   /**
    * Language code of the language being read from the database.
    *
    * @var string
    */
-  private $_langcode;
+  private $langcode;
 
   /**
    * Store the result of the query so it can be iterated later.
    *
    * @var resource
    */
-  private $_result;
+  private $result;
 
   /**
    * Constructor, initializes with default options.
    */
-  function __construct() {
+  public function __construct() {
     $this->setOptions(array());
   }
 
@@ -58,39 +58,39 @@ function __construct() {
    * Implements Drupal\Component\Gettext\PoMetadataInterface::getLangcode().
    */
   public function getLangcode() {
-    return $this->_langcode;
+    return $this->langcode;
   }
 
   /**
    * Implements Drupal\Component\Gettext\PoMetadataInterface::setLangcode().
    */
   public function setLangcode($langcode) {
-    $this->_langcode = $langcode;
+    $this->langcode = $langcode;
   }
 
   /**
    * Get the options used by the reader.
    */
-  function getOptions() {
-    return $this->_options;
+  public function getOptions() {
+    return $this->options;
   }
 
   /**
    * Set the options for the current reader.
    */
-  function setOptions(array $options) {
+  public function setOptions(array $options) {
     $options += array(
       'customized' => FALSE,
       'not_customized' => FALSE,
       'not_translated' => FALSE,
     );
-    $this->_options = $options;
+    $this->options = $options;
   }
 
   /**
    * Implements Drupal\Component\Gettext\PoMetadataInterface::getHeader().
    */
-  function getHeader() {
+  public function getHeader() {
     return new PoHeader($this->getLangcode());
   }
 
@@ -100,7 +100,7 @@ function getHeader() {
    * @throws Exception
    *   Always, because you cannot set the PO header of a reader.
    */
-  function setHeader(PoHeader $header) {
+  public function setHeader(PoHeader $header) {
     throw new \Exception('You cannot set the PO header in a reader.');
   }
 
@@ -108,8 +108,8 @@ function setHeader(PoHeader $header) {
    * Builds and executes a database query based on options set earlier.
    */
   private function loadStrings() {
-    $langcode = $this->_langcode;
-    $options = $this->_options;
+    $langcode = $this->langcode;
+    $options = $this->options;
     $conditions = array();
 
     if (array_sum($options) == 0) {
@@ -156,21 +156,21 @@ private function loadStrings() {
    * Get the database result resource for the given language and options.
    */
   private function readString() {
-    if (!isset($this->_result)) {
-      $this->_result = $this->loadStrings();
+    if (!isset($this->result)) {
+      $this->result = $this->loadStrings();
     }
-    return array_shift($this->_result);
+    return array_shift($this->result);
   }
 
   /**
    * Implements Drupal\Component\Gettext\PoReaderInterface::readItem().
    */
-  function readItem() {
+  public function readItem() {
     if ($string = $this->readString()) {
-      $values = (array)$string;
-      $poItem = new PoItem();
-      $poItem->setFromArray($values);
-      return $poItem;
+      $values = (array) $string;
+      $po_item = new PoItem();
+      $po_item->setFromArray($values);
+      return $po_item;
     }
   }
 
diff --git a/core/modules/locale/src/PoDatabaseWriter.php b/core/modules/locale/src/PoDatabaseWriter.php
index cdcb0c06aef0e07ab9fe31641f4713b3bbd9fed9..7d2b5fe00ca2ed81d307786be84be252bc40ebda 100644
--- a/core/modules/locale/src/PoDatabaseWriter.php
+++ b/core/modules/locale/src/PoDatabaseWriter.php
@@ -33,21 +33,21 @@ class PoDatabaseWriter implements PoWriterInterface {
    *
    * @var array
    */
-  private $_options;
+  private $options;
 
   /**
    * Language code of the language being written to the database.
    *
    * @var string
    */
-  private $_langcode;
+  private $langcode;
 
   /**
    * Header of the po file written to the database.
    *
    * @var \Drupal\Component\Gettext\PoHeader
    */
-  private $_header;
+  private $header;
 
   /**
    * Associative array summarizing the number of changes done.
@@ -60,12 +60,12 @@ class PoDatabaseWriter implements PoWriterInterface {
    *
    * @var array
    */
-  private $_report;
+  private $report;
 
   /**
    * Constructor, initialize reporting array.
    */
-  function __construct() {
+  public function __construct() {
     $this->setReport();
   }
 
@@ -73,21 +73,21 @@ function __construct() {
    * Implements Drupal\Component\Gettext\PoMetadataInterface::getLangcode().
    */
   public function getLangcode() {
-    return $this->_langcode;
+    return $this->langcode;
   }
 
   /**
    * Implements Drupal\Component\Gettext\PoMetadataInterface::setLangcode().
    */
   public function setLangcode($langcode) {
-    $this->_langcode = $langcode;
+    $this->langcode = $langcode;
   }
 
   /**
    * Get the report of the write operations.
    */
   public function getReport() {
-    return $this->_report;
+    return $this->report;
   }
 
   /**
@@ -96,7 +96,7 @@ public function getReport() {
    * @param array $report
    *   Associative array with result information.
    */
-  function setReport($report = array()) {
+  public function setReport($report = array()) {
     $report += array(
       'additions' => 0,
       'updates' => 0,
@@ -104,20 +104,20 @@ function setReport($report = array()) {
       'skips' => 0,
       'strings' => array(),
     );
-    $this->_report = $report;
+    $this->report = $report;
   }
 
   /**
    * Get the options used by the writer.
    */
-  function getOptions() {
-    return $this->_options;
+  public function getOptions() {
+    return $this->options;
   }
 
   /**
    * Set the options for the current writer.
    */
-  function setOptions(array $options) {
+  public function setOptions(array $options) {
     if (!isset($options['overwrite_options'])) {
       $options['overwrite_options'] = array();
     }
@@ -128,14 +128,14 @@ function setOptions(array $options) {
     $options += array(
       'customized' => LOCALE_NOT_CUSTOMIZED,
     );
-    $this->_options = $options;
+    $this->options = $options;
   }
 
   /**
    * Implements Drupal\Component\Gettext\PoMetadataInterface::getHeader().
    */
-  function getHeader() {
-    return $this->_header;
+  public function getHeader() {
+    return $this->header;
   }
 
   /**
@@ -153,8 +153,8 @@ function getHeader() {
    *
    * @throws Exception
    */
-  function setHeader(PoHeader $header) {
-    $this->_header = $header;
+  public function setHeader(PoHeader $header) {
+    $this->header = $header;
     $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array();
 
     // Check for options.
@@ -165,7 +165,7 @@ function setHeader(PoHeader $header) {
     $overwrite_options = $options['overwrite_options'];
 
     // Check for langcode.
-    $langcode = $this->_langcode;
+    $langcode = $this->langcode;
     if (empty($langcode)) {
       throw new \Exception('Langcode should be set before assigning a PoHeader.');
     }
@@ -187,10 +187,10 @@ function setHeader(PoHeader $header) {
   /**
    * Implements Drupal\Component\Gettext\PoWriterInterface::writeItem().
    */
-  function writeItem(PoItem $item) {
+  public function writeItem(PoItem $item) {
     if ($item->isPlural()) {
-      $item->setSource(join(LOCALE_PLURAL_DELIMITER, $item->getSource()));
-      $item->setTranslation(join(LOCALE_PLURAL_DELIMITER, $item->getTranslation()));
+      $item->setSource(implode(LOCALE_PLURAL_DELIMITER, $item->getSource()));
+      $item->setTranslation(implode(LOCALE_PLURAL_DELIMITER, $item->getTranslation()));
     }
     $this->importString($item);
   }
@@ -216,12 +216,12 @@ public function writeItems(PoReaderInterface $reader, $count = -1) {
    */
   private function importString(PoItem $item) {
     // Initialize overwrite options if not set.
-    $this->_options['overwrite_options'] += array(
+    $this->options['overwrite_options'] += array(
       'not_customized' => FALSE,
       'customized' => FALSE,
     );
-    $overwrite_options = $this->_options['overwrite_options'];
-    $customized = $this->_options['customized'];
+    $overwrite_options = $this->options['overwrite_options'];
+    $customized = $this->options['customized'];
 
     $context = $item->getContext();
     $source = $item->getSource();
@@ -229,9 +229,9 @@ private function importString(PoItem $item) {
 
     // Look up the source string and any existing translation.
     $strings = \Drupal::service('locale.storage')->getTranslations(array(
-      'language' => $this->_langcode,
+      'language' => $this->langcode,
       'source' => $source,
-      'context' => $context
+      'context' => $context,
     ));
     $string = reset($strings);
 
@@ -239,7 +239,7 @@ private function importString(PoItem $item) {
       // Skip this string unless it passes a check for dangerous code.
       if (!locale_string_is_safe($translation)) {
         watchdog('locale', 'Import of string "%string" was skipped because of disallowed or malformed HTML.', array('%string' => $translation), WATCHDOG_ERROR);
-        $this->_report['skips']++;
+        $this->report['skips']++;
         return 0;
       }
       elseif ($string) {
@@ -247,19 +247,19 @@ private function importString(PoItem $item) {
         if ($string->isNew()) {
           // No translation in this language.
           $string->setValues(array(
-            'language' => $this->_langcode,
-            'customized' => $customized
+            'language' => $this->langcode,
+            'customized' => $customized,
           ));
           $string->save();
-          $this->_report['additions']++;
+          $this->report['additions']++;
         }
         elseif ($overwrite_options[$string->customized ? 'customized' : 'not_customized']) {
           // Translation exists, only overwrite if instructed.
           $string->customized = $customized;
           $string->save();
-          $this->_report['updates']++;
+          $this->report['updates']++;
         }
-        $this->_report['strings'][] = $string->getId();
+        $this->report['strings'][] = $string->getId();
         return $string->lid;
       }
       else {
@@ -268,21 +268,21 @@ private function importString(PoItem $item) {
           ->save();
         \Drupal::service('locale.storage')->createTranslation(array(
           'lid' => $string->getId(),
-          'language' => $this->_langcode,
+          'language' => $this->langcode,
           'translation' => $translation,
           'customized' => $customized,
         ))->save();
 
-        $this->_report['additions']++;
-        $this->_report['strings'][] = $string->getId();
+        $this->report['additions']++;
+        $this->report['strings'][] = $string->getId();
         return $string->lid;
       }
     }
     elseif ($string && !$string->isNew() && $overwrite_options[$string->customized ? 'customized' : 'not_customized']) {
       // Empty translation, remove existing if instructed.
       $string->delete();
-      $this->_report['deletes']++;
-      $this->_report['strings'][] = $string->lid;
+      $this->report['deletes']++;
+      $this->report['strings'][] = $string->lid;
       return $string->lid;
     }
   }
diff --git a/core/modules/locale/src/StringBase.php b/core/modules/locale/src/StringBase.php
index 81544f08dbcf3be2f6652e45d721d3b5c57d8151..39fe7f1d33f470298e791d4b54684524797f7543 100644
--- a/core/modules/locale/src/StringBase.php
+++ b/core/modules/locale/src/StringBase.php
@@ -63,7 +63,7 @@ abstract class StringBase implements StringInterface {
    *   Object or array with initial values.
    */
   public function __construct($values = array()) {
-    $this->setValues((array)$values);
+    $this->setValues((array) $values);
   }
 
   /**
@@ -189,7 +189,7 @@ public function save() {
     }
     else {
       throw new StringStorageException(format_string('The string cannot be saved because its not bound to a storage: @string', array(
-        '@string' => $string->getString()
+        '@string' => $string->getString(),
       )));
     }
     return $this;
@@ -205,7 +205,7 @@ public function delete() {
       }
       else {
         throw new StringStorageException(format_string('The string cannot be deleted because its not bound to a storage: @string', array(
-          '@string' => $string->getString()
+          '@string' => $string->getString(),
         )));
       }
     }
diff --git a/core/modules/locale/src/StringDatabaseStorage.php b/core/modules/locale/src/StringDatabaseStorage.php
index 72d753a6f09536accbeb8114e04faac4bf995dfa..ea4f12e1cdf2be4e109e50cf48cccef75c5cace4 100644
--- a/core/modules/locale/src/StringDatabaseStorage.php
+++ b/core/modules/locale/src/StringDatabaseStorage.php
@@ -89,7 +89,7 @@ public function findTranslation(array $conditions) {
   /**
    * {@inheritdoc}
    */
-  function getLocations(array $conditions = array()) {
+  public function getLocations(array $conditions = array()) {
     $query = $this->connection->select('locales_location', 'l', $this->options)
       ->fields('l');
     foreach ($conditions as $field => $value) {
@@ -199,7 +199,7 @@ public function delete($string) {
     }
     else {
       throw new StringStorageException(format_string('The string cannot be deleted because it lacks some key fields: @string', array(
-        '@string' => $string->getString()
+        '@string' => $string->getString(),
       )));
     }
     return $this;
@@ -212,8 +212,8 @@ public function deleteStrings($conditions) {
     $lids = $this->dbStringSelect($conditions, array('fields' => array('lid')))->execute()->fetchCol();
     if ($lids) {
       $this->dbDelete('locales_target', array('lid' => $lids))->execute();
-      $this->dbDelete('locales_source',  array('lid' => $lids))->execute();
-      $this->dbDelete('locales_location',  array('sid' => $lids))->execute();
+      $this->dbDelete('locales_source', array('lid' => $lids))->execute();
+      $this->dbDelete('locales_location', array('sid' => $lids))->execute();
     }
   }
 
@@ -237,7 +237,7 @@ public function createString($values = array()) {
   public function createTranslation($values = array()) {
     return new TranslationString($values + array(
       'storage' => $this,
-      'is_new' => TRUE
+      'is_new' => TRUE,
     ));
   }
 
@@ -351,6 +351,7 @@ protected function dbStringLoad(array $conditions, array $options, $class) {
    *   these additional ones:
    *   - 'translation', Whether to include translation fields too. Defaults to
    *     FALSE.
+   *
    * @return \Drupal\Core\Database\Query\Select
    *   Query object with all the tables, fields and conditions.
    */
@@ -382,7 +383,7 @@ protected function dbStringSelect(array $conditions, array $options = array()) {
       if (isset($conditions['language'])) {
         // If we've got a language condition, we use it for the join.
         $query->$join('locales_target', 't', "t.lid = s.lid AND t.language = :langcode", array(
-          ':langcode' => $conditions['language']
+          ':langcode' => $conditions['language'],
         ));
         unset($conditions['language']);
       }
@@ -481,7 +482,7 @@ protected function dbStringInsert($string) {
     }
     else {
       throw new StringStorageException(format_string('The string cannot be saved: @string', array(
-          '@string' => $string->getString()
+          '@string' => $string->getString(),
       )));
     }
   }
@@ -514,7 +515,7 @@ protected function dbStringUpdate($string) {
     }
     else {
       throw new StringStorageException(format_string('The string cannot be updated: @string', array(
-          '@string' => $string->getString()
+          '@string' => $string->getString(),
       )));
     }
   }
diff --git a/core/modules/locale/src/StringInterface.php b/core/modules/locale/src/StringInterface.php
index 48e8cf86a68c353642ccd9c2f56b6ae41fb407f4..046f414bf69ca1ab2bf088f8311d31520ab61a5c 100644
--- a/core/modules/locale/src/StringInterface.php
+++ b/core/modules/locale/src/StringInterface.php
@@ -132,7 +132,7 @@ public function isTranslation();
    * Sets an array of values as object properties.
    *
    * @param array $values
-   *   Array with values indexed by property name,
+   *   Array with values indexed by property name.
    * @param bool $override
    *   (optional) Whether to override already set fields, defaults to TRUE.
    *
@@ -188,9 +188,9 @@ public function addLocation($type, $name);
   /**
    * Checks whether the string has a given location.
    *
-   * @param string $type.
+   * @param string $type
    *   Location type.
-   * @param string $name.
+   * @param string $name
    *   Location name.
    *
    * @return bool
diff --git a/core/modules/locale/src/StringStorageException.php b/core/modules/locale/src/StringStorageException.php
index 96df9a68a33a611a6636973b66357a25dfc021fe..645fcf4554b325f797f5199ffc128c0b3f54c72b 100644
--- a/core/modules/locale/src/StringStorageException.php
+++ b/core/modules/locale/src/StringStorageException.php
@@ -10,4 +10,4 @@
 /**
  * Defines an exception thrown when storage operations fail.
  */
-class StringStorageException extends \Exception { }
+class StringStorageException extends \Exception {}
diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
index 94ec34d71a543f6ffdfd8ac0528731b93c2c586b..8eaad50c998fe420e8cc977d3409e272743eb6e8 100644
--- a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
@@ -25,6 +25,9 @@ class LocaleConfigTranslationTest extends WebTestBase {
    */
   public static $modules = array('locale', 'contact');
 
+  /**
+   * {@inheritdoc}
+   */
   public function setUp() {
     parent::setUp();
     // Add a default locale storage for all these tests.
@@ -40,7 +43,7 @@ public function setUp() {
   /**
    * Tests basic configuration translation.
    */
-  function testConfigTranslation() {
+  public function testConfigTranslation() {
     // Add custom language.
     $langcode = 'xx';
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'translate interface', 'administer modules', 'access site-wide contact form', 'administer contact forms'));
@@ -54,7 +57,7 @@ function testConfigTranslation() {
     );
     $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
     // Set path prefix.
-    $edit = array( "prefix[$langcode]" => $langcode );
+    $edit = array("prefix[$langcode]" => $langcode);
     $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
 
     // Check site name string exists and create translation for it.
diff --git a/core/modules/locale/src/Tests/LocaleContentTest.php b/core/modules/locale/src/Tests/LocaleContentTest.php
index a72d7a91a1d79604b8d05bbc205456c93202af71..c0ffd60b6b0d089cfac7e64aada219528545baef 100644
--- a/core/modules/locale/src/Tests/LocaleContentTest.php
+++ b/core/modules/locale/src/Tests/LocaleContentTest.php
@@ -28,7 +28,7 @@ class LocaleContentTest extends WebTestBase {
   /**
    * Verifies that machine name fields are always LTR.
    */
-  function testMachineNameLTR() {
+  public function testMachineNameLTR() {
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'administer content types', 'access administration pages', 'administer site configuration'));
 
@@ -57,7 +57,7 @@ function testMachineNameLTR() {
   /**
    * Test if a content type can be set to multilingual and language is present.
    */
-  function testContentTypeLanguageConfiguration() {
+  public function testContentTypeLanguageConfiguration() {
     $type1 = $this->drupalCreateContentType();
     $type2 = $this->drupalCreateContentType();
 
@@ -106,7 +106,7 @@ function testContentTypeLanguageConfiguration() {
 
     // Create a node.
     $node_title = $this->randomName();
-    $node_body =  $this->randomName();
+    $node_body = $this->randomName();
     $edit = array(
       'type' => $type2->type,
       'title' => $node_title,
@@ -131,7 +131,7 @@ function testContentTypeLanguageConfiguration() {
   /**
    * Test if a dir and lang tags exist in node's attributes.
    */
-  function testContentTypeDirLang() {
+  public function testContentTypeDirLang() {
     $type = $this->drupalCreateContentType();
 
     // User to add and remove language.
@@ -175,7 +175,6 @@ function testContentTypeDirLang() {
       ));
     }
 
-
     // Check if English node does not have lang tag.
     $this->drupalGet('node/' . $nodes['en']->id());
     $pattern = '|class="[^"]*node[^"]*"[^<>]*lang="en"|';
@@ -202,9 +201,9 @@ function testContentTypeDirLang() {
 
 
   /**
-   *  Test filtering Node content by language.
+   * Test filtering Node content by language.
    */
-  function testNodeAdminLanguageFilter() {
+  public function testNodeAdminLanguageFilter() {
     \Drupal::moduleHandler()->install(array('views'));
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'access content overview', 'administer nodes', 'bypass node access'));
diff --git a/core/modules/locale/src/Tests/LocaleExportTest.php b/core/modules/locale/src/Tests/LocaleExportTest.php
index be1f94f36c19e355f1db0fb30f53e38e6fd6b324..da63064e05579b2c6898144ba41be483f5128765 100644
--- a/core/modules/locale/src/Tests/LocaleExportTest.php
+++ b/core/modules/locale/src/Tests/LocaleExportTest.php
@@ -26,13 +26,16 @@ class LocaleExportTest extends WebTestBase {
   /**
    * A user able to create languages and export translations.
    */
-  protected $admin_user = NULL;
+  protected $adminUser = NULL;
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
 
-    $this->admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
-    $this->drupalLogin($this->admin_user);
+    $this->adminUser = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
+    $this->drupalLogin($this->adminUser);
 
     // Copy test po files to the translations directory.
     file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', 'translations://', FILE_EXISTS_REPLACE);
@@ -42,7 +45,7 @@ function setUp() {
   /**
    * Test exportation of translations.
    */
-  function testExportTranslation() {
+  public function testExportTranslation() {
     // First import some known translations.
     // This will also automatically add the 'fr' language.
     $name = tempnam('temporary://', "po_") . '.po';
@@ -114,7 +117,7 @@ function testExportTranslation() {
   /**
    * Test exportation of translation template file.
    */
-  function testExportTranslationTemplateFile() {
+  public function testExportTranslationTemplateFile() {
     // Load an admin page with JavaScript so _drupal_add_library() fires at
     // least once and _locale_parse_js_file() gets to run at least once so that
     // the locales_source table gets populated with something.
@@ -128,7 +131,7 @@ function testExportTranslationTemplateFile() {
   /**
    * Helper function that returns a proper .po file.
    */
-  function getPoFile() {
+  public function getPoFile() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -147,7 +150,7 @@ function getPoFile() {
    * Helper function that returns a .po file which strings will be marked
    * as customized.
    */
-  function getCustomPoFile() {
+  public function getCustomPoFile() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -168,7 +171,7 @@ function getCustomPoFile() {
    * @return string
    *   A .po file fragment with an untranslated string.
    */
-  function getUntranslatedString() {
+  public function getUntranslatedString() {
     return <<< EOF
 msgid "February"
 msgstr ""
diff --git a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
index be3c22ad69d7f6357044570521f2dd286044f67e..0c7b9dedc02e9809eda4e38d3e146ff3eec6ca27 100644
--- a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
@@ -27,17 +27,20 @@ class LocaleImportFunctionalTest extends WebTestBase {
   /**
    * A user able to create languages and import translations.
    */
-  protected $admin_user = NULL;
+  protected $adminUser = NULL;
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
 
     // Copy test po files to the translations directory.
     file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', 'translations://', FILE_EXISTS_REPLACE);
     file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.xx.po', 'translations://', FILE_EXISTS_REPLACE);
 
-    $this->admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
-    $this->drupalLogin($this->admin_user);
+    $this->adminUser = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
+    $this->drupalLogin($this->adminUser);
 
     // Enable import of translations. By default this is disabled for automated
     // tests.
@@ -49,7 +52,7 @@ function setUp() {
   /**
    * Test import of standalone .po files.
    */
-  function testStandalonePoFile() {
+  public function testStandalonePoFile() {
     // Try importing a .po file.
     $this->importPoFile($this->getPoFile(), array(
       'langcode' => 'fr',
@@ -68,7 +71,6 @@ function testStandalonePoFile() {
     // Ensure we were redirected correctly.
     $this->assertEqual($this->getUrl(), url('admin/config/regional/translate', array('absolute' => TRUE)), 'Correct page redirection.');
 
-
     // Try importing a .po file with invalid tags.
     $this->importPoFile($this->getBadPoFile(), array(
       'langcode' => 'fr',
@@ -97,7 +99,6 @@ function testStandalonePoFile() {
     $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/import', array('absolute' => TRUE)), 'Correct page redirection.');
     $this->assertText(t('File to import not found.'), 'File to import not found message.');
 
-
     // Try importing a .po file with overriding strings, and ensure existing
     // strings are kept.
     $this->importPoFile($this->getOverwritePoFile(), array(
@@ -197,7 +198,7 @@ function testStandalonePoFile() {
   /**
    * Test msgctxt context support.
    */
-  function testLanguageContext() {
+  public function testLanguageContext() {
     // Try importing a .po file.
     $this->importPoFile($this->getPoFileWithContext(), array(
       'langcode' => 'hr',
@@ -210,7 +211,7 @@ function testLanguageContext() {
   /**
    * Test empty msgstr at end of .po file see #611786.
    */
-  function testEmptyMsgstr() {
+  public function testEmptyMsgstr() {
     $langcode = 'hu';
 
     // Try importing a .po file.
@@ -241,7 +242,7 @@ function testEmptyMsgstr() {
   /**
    * Tests .po file import with configuration translation.
    */
-  function testConfigPoFile() {
+  public function testConfigPoFile() {
     // Values for translations to assert. Config key, original string,
     // translation and config property name.
     $config_strings = array(
@@ -311,7 +312,7 @@ function testConfigPoFile() {
    * @param $options
    *   Additional options to pass to the translation import form.
    */
-  function importPoFile($contents, array $options = array()) {
+  public function importPoFile($contents, array $options = array()) {
     $name = tempnam('temporary://', "po_") . '.po';
     file_put_contents($name, $contents);
     $options['files[file]'] = $name;
@@ -322,7 +323,7 @@ function importPoFile($contents, array $options = array()) {
   /**
    * Helper function that returns a proper .po file.
    */
-  function getPoFile() {
+  public function getPoFile() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -363,14 +364,14 @@ function getPoFile() {
   /**
    * Helper function that returns a empty .po file.
    */
-  function getEmptyPoFile() {
+  public function getEmptyPoFile() {
     return '';
   }
 
   /**
    * Helper function that returns a bad .po file.
    */
-  function getBadPoFile() {
+  public function getBadPoFile() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -395,7 +396,7 @@ function getBadPoFile() {
   /**
    * Helper function that returns a proper .po file for testing.
    */
-  function getOverwritePoFile() {
+  public function getOverwritePoFile() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -417,7 +418,7 @@ function getOverwritePoFile() {
    * Helper function that returns a .po file which strings will be marked
    * as customized.
    */
-  function getCustomPoFile() {
+  public function getCustomPoFile() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -452,7 +453,7 @@ function getCustomPoFile() {
   /**
    * Helper function that returns a .po file for testing customized strings.
    */
-  function getCustomOverwritePoFile() {
+  public function getCustomOverwritePoFile() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -476,7 +477,7 @@ function getCustomOverwritePoFile() {
   /**
    * Helper function that returns a .po file with context.
    */
-  function getPoFileWithContext() {
+  public function getPoFileWithContext() {
     // Croatian (code hr) is one the the languages that have a different
     // form for the full name and the abbreviated name for the month May.
     return <<< EOF
@@ -500,7 +501,7 @@ function getPoFileWithContext() {
   /**
    * Helper function that returns a .po file with an empty last item.
    */
-  function getPoFileWithEmptyMsgstr() {
+  public function getPoFileWithEmptyMsgstr() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -519,7 +520,7 @@ function getPoFileWithEmptyMsgstr() {
   /**
    * Helper function that returns a .po file with an empty last item.
    */
-  function getPoFileWithMsgstr() {
+  public function getPoFileWithMsgstr() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -541,7 +542,7 @@ function getPoFileWithMsgstr() {
   /**
    * Helper function that returns a .po file with configuration translations.
    */
-  function getPoFileWithConfig() {
+  public function getPoFileWithConfig() {
     return <<< EOF
 msgid ""
 msgstr ""
diff --git a/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php b/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php
index f970646bfd98e9082f79ce71b6ddc6b57322859e..6d6917adcd0a94eac17a529ae5ae8c71afa91e94 100644
--- a/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php
+++ b/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php
@@ -24,7 +24,7 @@ class LocaleJavascriptTranslationTest extends WebTestBase {
    */
   public static $modules = array('locale');
 
-  function testFileParsing() {
+  public function testFileParsing() {
     $filename = drupal_get_path('module', 'locale') . '/tests/locale_test.js';
 
     // Parse the file to look for source strings.
diff --git a/core/modules/locale/src/Tests/LocaleLibraryInfoAlterTest.php b/core/modules/locale/src/Tests/LocaleLibraryInfoAlterTest.php
index 5645e9a5d40ec19556d88678c71b5a4abfc6885f..be38d29a74284f5585b46887828afc872b50b541 100644
--- a/core/modules/locale/src/Tests/LocaleLibraryInfoAlterTest.php
+++ b/core/modules/locale/src/Tests/LocaleLibraryInfoAlterTest.php
@@ -25,10 +25,10 @@ class LocaleLibraryInfoAlterTest extends WebTestBase {
   public static $modules = array('locale');
 
   /**
-     * Verifies that the datepicker can be localized.
-     *
-     * @see locale_library_info_alter()
-     */
+   * Verifies that the datepicker can be localized.
+   *
+   * @see locale_library_info_alter()
+   */
   public function testLibraryInfoAlter() {
     $attached['#attached']['library'][] = 'core/jquery.ui.datepicker';
     drupal_render($attached);
diff --git a/core/modules/locale/src/Tests/LocalePathTest.php b/core/modules/locale/src/Tests/LocalePathTest.php
index 54a84c9d9f2abc2880edca0fca4b03fa1fdf5d28..4876043cd0dee7b2388d040535e6ebea7caa0bdb 100644
--- a/core/modules/locale/src/Tests/LocalePathTest.php
+++ b/core/modules/locale/src/Tests/LocalePathTest.php
@@ -24,7 +24,10 @@ class LocalePathTest extends WebTestBase {
    */
   public static $modules = array('node', 'locale', 'path', 'views');
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
 
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
@@ -34,7 +37,7 @@ function setUp() {
   /**
    * Test if a language can be associated with a path alias.
    */
-  function testPathLanguageConfiguration() {
+  public function testPathLanguageConfiguration() {
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'create page content', 'administer url aliases', 'create url aliases', 'access administration pages'));
 
@@ -55,7 +58,7 @@ function testPathLanguageConfiguration() {
     $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
 
     // Set path prefix.
-    $edit = array( "prefix[$langcode]" => $prefix );
+    $edit = array("prefix[$langcode]" => $prefix);
     $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
 
     // Check that the "xx" front page is readily available because path prefix
diff --git a/core/modules/locale/src/Tests/LocalePluralFormatTest.php b/core/modules/locale/src/Tests/LocalePluralFormatTest.php
index 8d992a336a53c0f1f2a496e18b281310b0b541d8..7c93a0202f1230a6963eabdd06966b2c1d75db59 100644
--- a/core/modules/locale/src/Tests/LocalePluralFormatTest.php
+++ b/core/modules/locale/src/Tests/LocalePluralFormatTest.php
@@ -23,7 +23,10 @@ class LocalePluralFormatTest extends WebTestBase {
    */
   public static $modules = array('locale');
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
 
     $admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
@@ -33,7 +36,7 @@ function setUp() {
   /**
    * Tests locale_get_plural() and format_plural() functionality.
    */
-  function testGetPluralFormat() {
+  public function testGetPluralFormat() {
     // Import some .po files with formulas to set up the environment.
     // These will also add the languages to the system.
     $this->importPoFile($this->getPoFileWithSimplePlural(), array(
@@ -134,7 +137,7 @@ function testGetPluralFormat() {
   /**
    * Tests plural editing and export functionality.
    */
-  function testPluralEditExport() {
+  public function testPluralEditExport() {
     // Import some .po files with formulas to set up the environment.
     // These will also add the languages to the system.
     $this->importPoFile($this->getPoFileWithSimplePlural(), array(
@@ -244,7 +247,7 @@ function testPluralEditExport() {
     );
     $this->drupalPostForm($path, $edit, t('Save translations'));
 
-   // Get the French translations.
+    // Get the French translations.
     $this->drupalPostForm('admin/config/regional/translate/export', array(
       'langcode' => 'fr',
     ), t('Export'));
@@ -269,7 +272,7 @@ function testPluralEditExport() {
    * @param $options
    *   Additional options to pass to the translation import form.
    */
-  function importPoFile($contents, array $options = array()) {
+  public function importPoFile($contents, array $options = array()) {
     $name = tempnam('temporary://', "po_") . '.po';
     file_put_contents($name, $contents);
     $options['files[file]'] = $name;
@@ -280,7 +283,7 @@ function importPoFile($contents, array $options = array()) {
   /**
    * Returns a .po file with a simple plural formula.
    */
-  function getPoFileWithSimplePlural() {
+  public function getPoFileWithSimplePlural() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -303,7 +306,7 @@ function getPoFileWithSimplePlural() {
   /**
    * Returns a .po file with a complex plural formula.
    */
-  function getPoFileWithComplexPlural() {
+  public function getPoFileWithComplexPlural() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -327,7 +330,7 @@ function getPoFileWithComplexPlural() {
   /**
    * Returns a .po file with a missing plural formula.
    */
-  function getPoFileWithMissingPlural() {
+  public function getPoFileWithMissingPlural() {
     return <<< EOF
 msgid ""
 msgstr ""
@@ -344,7 +347,7 @@ function getPoFileWithMissingPlural() {
   /**
    * Returns a .po file with a broken plural formula.
    */
-  function getPoFileWithBrokenPlural() {
+  public function getPoFileWithBrokenPlural() {
     return <<< EOF
 msgid ""
 msgstr ""
diff --git a/core/modules/locale/src/Tests/LocaleStringTest.php b/core/modules/locale/src/Tests/LocaleStringTest.php
index 5b76e2ebf64abf3b6bb7b43909c5f194c8e9410b..7148d6a201a8ce66e6d9db05325635b1d515eef7 100644
--- a/core/modules/locale/src/Tests/LocaleStringTest.php
+++ b/core/modules/locale/src/Tests/LocaleStringTest.php
@@ -31,7 +31,10 @@ class LocaleStringTest extends WebTestBase {
    */
   protected $storage;
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
     // Add a default locale storage for all these tests.
     $this->storage = $this->container->get('locale.storage');
@@ -45,7 +48,7 @@ function setUp() {
   /**
    * Test CRUD API.
    */
-  function testStringCRUDAPI() {
+  public function testStringCRUDAPI() {
     // Create source string.
     $source = $this->buildSourceString();
     $source->save();
@@ -80,10 +83,11 @@ function testStringCRUDAPI() {
 
     // Delete translation.
     $translation->delete();
-    $deleted =  $this->storage->findTranslation(array('language' => $langcode, 'lid' => $source->lid));
+    $deleted = $this->storage->findTranslation(array('language' => $langcode, 'lid' => $source->lid));
     $this->assertFalse(isset($deleted->translation), 'Successfully deleted translation string.');
 
-    // Create some translations and then delete string and all of its translations.
+    // Create some translations and then delete string and all of its
+    // translations.
     $lid = $source->lid;
     $this->createAllTranslations($source);
     $search = $this->storage->getTranslations(array('lid' => $source->lid));
@@ -112,7 +116,7 @@ function testStringCRUDAPI() {
   /**
    * Test Search API loading multiple objects.
    */
-  function testStringSearchAPI() {
+  public function testStringSearchAPI() {
     $language_count = 3;
     // Strings 1 and 2 will have some common prefix.
     // Source 1 will have all translations, not customized.
@@ -125,7 +129,7 @@ function testStringSearchAPI() {
     // Load all source strings.
     $strings = $this->storage->getStrings(array());
     $this->assertEqual(count($strings), 3, 'Found 3 source strings in the database.');
-    // Load all source strings matching a given string
+    // Load all source strings matching a given string.
     $filter_options['filters'] = array('source' => $prefix);
     $strings = $this->storage->getStrings(array(), $filter_options);
     $this->assertEqual(count($strings), 2, 'Found 2 strings using some string filter.');
@@ -140,7 +144,7 @@ function testStringSearchAPI() {
     $this->assertTrue($found && isset($found->language) && isset($found->translation) && !$found->isNew(), 'Translation found searching by source and context.');
     $this->assertEqual($found->translation, $translate1[$langcode]->translation, 'Found the right translation.');
     // Now try a translation not found.
-    $found = $this->storage->findTranslation(array('language' => $langcode,  'source' => $source3->source, 'context' => $source3->context));
+    $found = $this->storage->findTranslation(array('language' => $langcode, 'source' => $source3->source, 'context' => $source3->context));
     $this->assertTrue($found && $found->lid == $source3->lid && !isset($found->translation) && $found->isNew(), 'Translation not found but source string found.');
 
     // Load all translations. For next queries we'll be loading only translated
@@ -152,7 +156,7 @@ function testStringSearchAPI() {
     $translations = $this->storage->getTranslations(array('customized' => LOCALE_CUSTOMIZED, 'translated' => TRUE));
     $this->assertEqual(count($translations), $language_count, 'Retrieved all customized translations for source strings.');
 
-    // Load all Spanish customized translations
+    // Load all Spanish customized translations.
     $translations = $this->storage->getTranslations(array('language' => 'es', 'customized' => LOCALE_CUSTOMIZED, 'translated' => TRUE));
     $this->assertEqual(count($translations), 1, 'Found only Spanish and customized translations.');
 
@@ -173,7 +177,7 @@ function testStringSearchAPI() {
    * @return \Drupal\locale\StringInterface
    *   A locale string.
    */
-  function buildSourceString($values = array()) {
+  public function buildSourceString($values = array()) {
     return $this->storage->createString($values += array(
       'source' => $this->randomName(100),
       'context' => $this->randomName(20),
@@ -183,7 +187,7 @@ function buildSourceString($values = array()) {
   /**
    * Creates translations for source string and all languages.
    */
-  function createAllTranslations($source, $values = array()) {
+  public function createAllTranslations($source, $values = array()) {
     $list = array();
     foreach ($this->container->get('language_manager')->getLanguages() as $language) {
       $list[$language->id] = $this->createTranslation($source, $language->id, $values);
@@ -194,7 +198,7 @@ function createAllTranslations($source, $values = array()) {
   /**
    * Creates single translation for source string.
    */
-  function createTranslation($source, $langcode, $values = array()) {
+  public function createTranslation($source, $langcode, $values = array()) {
     return $this->storage->createTranslation($values + array(
       'lid' => $source->lid,
       'language' => $langcode,
diff --git a/core/modules/locale/src/Tests/LocaleTranslateStringTourTest.php b/core/modules/locale/src/Tests/LocaleTranslateStringTourTest.php
index 8c2f5f32076b729e73ec693078897c0e17527aae..016d90becd5c15a3a48d2c0253978e33cca75027 100644
--- a/core/modules/locale/src/Tests/LocaleTranslateStringTourTest.php
+++ b/core/modules/locale/src/Tests/LocaleTranslateStringTourTest.php
@@ -30,6 +30,9 @@ class LocaleTranslateStringTourTest extends TourTestBase {
    */
   public static $modules = array('locale', 'tour');
 
+  /**
+   * {@inheritdoc}
+   */
   protected function setUp() {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser(array('translate interface', 'access tour', 'administer languages'));
@@ -40,7 +43,7 @@ protected function setUp() {
    * Tests locale tour tip availability.
    */
   public function testTranslateStringTourTips() {
-    // Add Another Language so there is no missing form items
+    // Add another language so there are no missing form items.
     $edit = array();
     $edit['predefined_langcode'] = 'es';
     $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
diff --git a/core/modules/locale/src/Tests/LocaleTranslationUiTest.php b/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
index 9e654405bf47bfd3964f7aac04ebe4cd5ab7771f..9991eafdf935a586744df6b6ae1bbb45e61f27f2 100644
--- a/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
+++ b/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
@@ -28,9 +28,9 @@ class LocaleTranslationUiTest extends WebTestBase {
   public static $modules = array('locale');
 
   /**
-   *  Enable interface translation to English
+   * Enable interface translation to English.
    */
-  function testEnglishTranslation() {
+  public function testEnglishTranslation() {
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages'));
     $this->drupalLogin($admin_user);
 
@@ -41,7 +41,7 @@ function testEnglishTranslation() {
   /**
    * Adds a language and tests string translation by users with the appropriate permissions.
    */
-  function testStringTranslation() {
+  public function testStringTranslation() {
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages'));
     // User to translate and delete string.
@@ -67,7 +67,7 @@ function testStringTranslation() {
     t($name, array(), array('langcode' => $langcode));
     // Reset locale cache.
     $this->container->get('string_translation')->reset();
-    $this->assertRaw('"edit-languages-' . $langcode .'-weight"', 'Language code found.');
+    $this->assertRaw('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
     $this->assertText(t($name), 'Test language added.');
     $this->drupalLogout();
 
@@ -115,7 +115,6 @@ function testStringTranslation() {
     $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
     $this->assertRaw($translation, 'Non-English translation properly saved.');
 
-
     $search = array(
       'string' => $name,
       'langcode' => 'en',
@@ -203,7 +202,7 @@ function testStringTranslation() {
    * Adds a language and checks that the JavaScript translation files are
    * properly created and rebuilt on deletion.
    */
-  function testJavaScriptTranslation() {
+  public function testJavaScriptTranslation() {
     $user = $this->drupalCreateUser(array('translate interface', 'administer languages', 'access administration pages'));
     $this->drupalLogin($user);
     $config = \Drupal::config('locale.settings');
@@ -264,7 +263,7 @@ function testJavaScriptTranslation() {
   /**
    * Tests the validation of the translation input.
    */
-  function testStringValidation() {
+  public function testStringValidation() {
     // User to add language and strings.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'translate interface'));
     $this->drupalLogin($admin_user);
@@ -280,7 +279,7 @@ function testStringValidation() {
     $key = $this->randomName(16);
     $bad_translations[$key] = '<<SCRIPT>alert("xss");//<</SCRIPT>' . $key;
     $key = $this->randomName(16);
-    $bad_translations[$key] ="<BODY ONLOAD=alert('xss')>" . $key;
+    $bad_translations[$key] = "<BODY ONLOAD=alert('xss')>" . $key;
 
     // Add custom language.
     $edit = array(
@@ -318,7 +317,7 @@ function testStringValidation() {
   /**
    * Tests translation search form.
    */
-  function testStringSearch() {
+  public function testStringSearch() {
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages'));
     // User to translate and delete string.
@@ -460,13 +459,13 @@ function testStringSearch() {
   /**
    * Tests that only changed strings are saved customized when edited.
    */
-  function testUICustomizedStrings(){
+  public function testUICustomizedStrings() {
     $user = $this->drupalCreateUser(array('translate interface', 'administer languages', 'access administration pages'));
     $this->drupalLogin($user);
     $language = new Language(array('id' => 'de'));
     language_save($language);
 
-    // Create test source string
+    // Create test source string.
     $string = $this->container->get('locale.storage')->createString(array(
       'source' => $this->randomName(100),
       'context' => $this->randomName(20),
@@ -483,7 +482,8 @@ function testUICustomizedStrings(){
     // Reset locale cache.
     $this->container->get('string_translation')->reset();
 
-    // Ensure non-customized translation string does appear if searching Non-customized translation.
+    // Ensure non-customized translation string does appear if searching
+    // non-customized translation.
     $search = array(
       'string' => $string->getString(),
       'langcode' => 'de',
@@ -502,7 +502,8 @@ function testUICustomizedStrings(){
     );
     $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
 
-    // Ensure unchanged translation string does appear if searching non-customized translation.
+    // Ensure unchanged translation string does appear if searching
+    // non-customized translation.
     $search = array(
       'string' => $string->getString(),
       'langcode' => 'de',
@@ -520,7 +521,8 @@ function testUICustomizedStrings(){
     );
     $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
 
-    // Ensure changed translation string does appear if searching customized translation.
+    // Ensure changed translation string does appear if searching customized
+    // translation.
     $search = array(
       'string' => $string->getString(),
       'langcode' => 'de',
diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/src/Tests/LocaleUpdateBase.php
index a7895b9c724cc93fdd41ca23c08642531d240707..8913e0adf8caa89f646d5546f53e14df46433140 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateBase.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php
@@ -21,21 +21,21 @@ abstract class LocaleUpdateBase extends WebTestBase {
    *
    * @var integer
    */
-  protected $timestamp_old;
+  protected $timestampOld;
 
   /**
    * Timestamp for a medium aged translation.
    *
    * @var integer
    */
-  protected $timestamp_medium;
+  protected $timestampMedium;
 
   /**
    * Timestamp for a new translation.
    *
    * @var integer
    */
-  protected $timestamp_new;
+  protected $timestampNew;
 
   /**
    * Modules to enable.
@@ -44,12 +44,15 @@ abstract class LocaleUpdateBase extends WebTestBase {
    */
   public static $modules = array('update', 'locale', 'locale_test');
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
     // Setup timestamps to identify old and new translation sources.
-    $this->timestamp_old = REQUEST_TIME - 300;
-    $this->timestamp_medium = REQUEST_TIME - 200;
-    $this->timestamp_new = REQUEST_TIME - 100;
+    $this->timestampOld = REQUEST_TIME - 300;
+    $this->timestampMedium = REQUEST_TIME - 200;
+    $this->timestampNew = REQUEST_TIME - 100;
     $this->timestamp_now = REQUEST_TIME;
 
     // Enable import of translations. By default this is disabled for automated
@@ -91,7 +94,7 @@ protected function addLanguage($langcode) {
    *   Path of the file relative to the public file path.
    * @param string $filename
    *   Name of the file to create.
-   * @param integer $timestamp
+   * @param int $timestamp
    *   Timestamp to set the file to. Defaults to current time.
    * @param array $translations
    *   Array of source/target value translation strings. Only singular strings
@@ -116,8 +119,8 @@ protected function makePoFile($path, $filename, $timestamp = NULL, $translations
     // Convert array of translations to Gettext source and translation strings.
     if ($translations) {
       foreach ($translations as $source => $target) {
-        $text .= 'msgid "'. $source . '"' . "\n";
-        $text .= 'msgstr "'. $target . '"' . "\n";
+        $text .= 'msgid "' . $source . '"' . "\n";
+        $text .= 'msgstr "' . $target . '"' . "\n";
       }
     }
 
@@ -177,23 +180,23 @@ protected function setTranslationFiles() {
 
     // Setting up sets of translations for the translation files.
     $translations_one = array('January' => 'Januar_1', 'February' => 'Februar_1', 'March' => 'Marz_1');
-    $translations_two = array( 'February' => 'Februar_2', 'March' => 'Marz_2', 'April' => 'April_2');
+    $translations_two = array('February' => 'Februar_2', 'March' => 'Marz_2', 'April' => 'April_2');
     $translations_three = array('April' => 'April_3', 'May' => 'Mai_3', 'June' => 'Juni_3');
 
     // Add a number of files to the local file system to serve as remote
     // translation server and match the project definitions set in
     // locale_test_locale_translation_projects_alter().
-    $this->makePoFile('remote/8.x/contrib_module_one', 'contrib_module_one-8.x-1.1.de._po', $this->timestamp_new, $translations_one);
-    $this->makePoFile('remote/8.x/contrib_module_two', 'contrib_module_two-8.x-2.0-beta4.de._po', $this->timestamp_old, $translations_two);
-    $this->makePoFile('remote/8.x/contrib_module_three', 'contrib_module_three-8.x-1.0.de._po', $this->timestamp_old, $translations_three);
+    $this->makePoFile('remote/8.x/contrib_module_one', 'contrib_module_one-8.x-1.1.de._po', $this->timestampNew, $translations_one);
+    $this->makePoFile('remote/8.x/contrib_module_two', 'contrib_module_two-8.x-2.0-beta4.de._po', $this->timestampOld, $translations_two);
+    $this->makePoFile('remote/8.x/contrib_module_three', 'contrib_module_three-8.x-1.0.de._po', $this->timestampOld, $translations_three);
 
     // Add a number of files to the local file system to serve as local
     // translation files and match the project definitions set in
     // locale_test_locale_translation_projects_alter().
-    $this->makePoFile('local', 'contrib_module_one-8.x-1.1.de._po', $this->timestamp_old, $translations_one);
-    $this->makePoFile('local', 'contrib_module_two-8.x-2.0-beta4.de._po', $this->timestamp_new, $translations_two);
-    $this->makePoFile('local', 'contrib_module_three-8.x-1.0.de._po', $this->timestamp_old, $translations_three);
-    $this->makePoFile('local', 'custom_module_one.de.po', $this->timestamp_new);
+    $this->makePoFile('local', 'contrib_module_one-8.x-1.1.de._po', $this->timestampOld, $translations_one);
+    $this->makePoFile('local', 'contrib_module_two-8.x-2.0-beta4.de._po', $this->timestampNew, $translations_two);
+    $this->makePoFile('local', 'contrib_module_three-8.x-1.0.de._po', $this->timestampOld, $translations_three);
+    $this->makePoFile('local', 'custom_module_one.de.po', $this->timestampNew);
   }
 
   /**
@@ -246,8 +249,8 @@ protected function setCurrentTranslations() {
     $default = array(
       'langcode' => $langcode,
       'uri' => '',
-      'timestamp' => $this->timestamp_medium,
-      'last_checked' => $this->timestamp_medium,
+      'timestamp' => $this->timestampMedium,
+      'last_checked' => $this->timestampMedium,
     );
     $data[] = array(
       'project' => 'contrib_module_one',
@@ -279,7 +282,7 @@ protected function setCurrentTranslations() {
    * Checks the translation of a string.
    *
    * @param string $source
-   *   Translation source string
+   *   Translation source string.
    * @param string $translation
    *   Translation to check. Use empty string to check for a not existing
    *   translation.
diff --git a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
index 64d3739fca57a9980efda8a6262a0f11546f995c..588b3d691065e6e4d770258cc23fc498d98bdeba 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
@@ -14,7 +14,7 @@
  */
 class LocaleUpdateCronTest extends LocaleUpdateBase {
 
-  protected $batch_output = array();
+  protected $batchOutput = array();
 
   /**
    * Modules to enable.
@@ -23,7 +23,10 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
    */
   public static $modules = array('update', 'locale', 'locale_test');
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
     $admin_user = $this->drupalCreateUser(array('administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface'));
     $this->drupalLogin($admin_user);
@@ -33,7 +36,7 @@ function setUp() {
   /**
    * Tests interface translation update using cron.
    */
-  function testUpdateCron() {
+  public function testUpdateCron() {
     // Set a flag to let the locale_test module replace the project data with a
     // set of test projects.
     \Drupal::state()->set('locale.test_projects_alter', TRUE);
diff --git a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php
index 2304aa54d58754a5b448263cf72198c35dbb4495..f5631018cbbdb031a27303a47430c75f423432f8 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php
@@ -23,7 +23,10 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase {
    */
   public static $modules = array('update', 'locale', 'locale_test_translate');
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
     $admin_user = $this->drupalCreateUser(array('administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface'));
     $this->drupalLogin($admin_user);
@@ -35,7 +38,7 @@ function setUp() {
    * Testing the Available updates summary on the side wide status page and the
    * Avaiable translation updates page.
    */
-  function testInterface() {
+  public function testInterface() {
     // No language added.
     // Check status page and Available translation updates page.
     $this->drupalGet('admin/reports/status');
diff --git a/core/modules/locale/src/Tests/LocaleUpdateTest.php b/core/modules/locale/src/Tests/LocaleUpdateTest.php
index 9a5dffc010c76bc6626f654750787ba1173fc68c..b656601d6d0f54b764dc3110f0cc03b561cfb43f 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateTest.php
@@ -24,7 +24,10 @@ class LocaleUpdateTest extends LocaleUpdateBase {
    */
   public static $modules = array('update', 'locale', 'locale_test');
 
-  function setUp() {
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
     module_load_include('compare.inc', 'locale');
     module_load_include('fetch.inc', 'locale');
@@ -39,7 +42,7 @@ function setUp() {
   /**
    * Checks if a list of translatable projects gets build.
    */
-  function testUpdateProjects() {
+  public function testUpdateProjects() {
     module_load_include('compare.inc', 'locale');
 
     // Make the test modules look like a normal custom module. i.e. make the
@@ -52,7 +55,7 @@ function testUpdateProjects() {
     $projects = locale_translation_project_list();
     $this->assertFalse(isset($projects['locale_test_translate']), 'Hidden module not found');
     $this->assertEqual($projects['locale_test']['info']['interface translation server pattern'], 'core/modules/locale/test/test.%language.po', 'Interface translation parameter found in project info.');
-    $this->assertEqual($projects['locale_test']['name'] , 'locale_test', format_string('%key found in project info.', array('%key' => 'interface translation project')));
+    $this->assertEqual($projects['locale_test']['name'], 'locale_test', format_string('%key found in project info.', array('%key' => 'interface translation project')));
   }
 
   /**
@@ -69,7 +72,7 @@ function testUpdateProjects() {
    * the most recent files are selected in the different check scenarios: check
    * for local files only, check for both local and remote files.
    */
-  function testUpdateCheckStatus() {
+  public function testUpdateCheckStatus() {
     // Case when contributed modules are absent.
     $this->drupalGet('admin/reports/translations');
     $this->assertText(t('Missing translations for one project'));
@@ -93,9 +96,9 @@ function testUpdateCheckStatus() {
     $this->drupalGet('admin/reports/translations/check');
     $result = locale_translation_get_status();
     $this->assertEqual($result['contrib_module_one']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of contrib_module_one found');
-    $this->assertEqual($result['contrib_module_one']['de']->timestamp, $this->timestamp_old, 'Translation timestamp found');
+    $this->assertEqual($result['contrib_module_one']['de']->timestamp, $this->timestampOld, 'Translation timestamp found');
     $this->assertEqual($result['contrib_module_two']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of contrib_module_two found');
-    $this->assertEqual($result['contrib_module_two']['de']->timestamp, $this->timestamp_new, 'Translation timestamp found');
+    $this->assertEqual($result['contrib_module_two']['de']->timestamp, $this->timestampNew, 'Translation timestamp found');
     $this->assertEqual($result['locale_test']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of locale_test found');
     $this->assertEqual($result['custom_module_one']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of custom_module_one found');
 
@@ -109,11 +112,11 @@ function testUpdateCheckStatus() {
     $this->drupalGet('admin/reports/translations/check');
     $result = locale_translation_get_status();
     $this->assertEqual($result['contrib_module_one']['de']->type, LOCALE_TRANSLATION_REMOTE, 'Translation of contrib_module_one found');
-    $this->assertEqual($result['contrib_module_one']['de']->timestamp, $this->timestamp_new, 'Translation timestamp found');
+    $this->assertEqual($result['contrib_module_one']['de']->timestamp, $this->timestampNew, 'Translation timestamp found');
     $this->assertEqual($result['contrib_module_two']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of contrib_module_two found');
-    $this->assertEqual($result['contrib_module_two']['de']->timestamp, $this->timestamp_new, 'Translation timestamp found');
+    $this->assertEqual($result['contrib_module_two']['de']->timestamp, $this->timestampNew, 'Translation timestamp found');
     $this->assertEqual($result['contrib_module_three']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of contrib_module_three found');
-    $this->assertEqual($result['contrib_module_three']['de']->timestamp, $this->timestamp_old, 'Translation timestamp found');
+    $this->assertEqual($result['contrib_module_three']['de']->timestamp, $this->timestampOld, 'Translation timestamp found');
     $this->assertEqual($result['locale_test']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of locale_test found');
     $this->assertEqual($result['custom_module_one']['de']->type, LOCALE_TRANSLATION_LOCAL, 'Translation of custom_module_one found');
   }
@@ -125,12 +128,12 @@ function testUpdateCheckStatus() {
    *  - Source: remote and local files
    *  - Import overwrite: all existing translations
    */
-  function testUpdateImportSourceRemote() {
+  public function testUpdateImportSourceRemote() {
     $config = \Drupal::config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
-    $this-> setCurrentTranslations();
+    $this->setCurrentTranslations();
     $config->set('translation.default_filename', '%project-%version.%language._po');
 
     // Set the update conditions for this test.
@@ -147,7 +150,7 @@ function testUpdateImportSourceRemote() {
     $this->assertRaw('<label class="visually-hidden" for="edit-langcodes-de">Update German</label>', 'German language found');
     $this->assertText('Updates for: Contributed module one, Contributed module two, Custom module one, Locale test', 'Updates found');
     $this->assertText('Contributed module one (' . format_date($this->timestamp_now, 'html_date') . ')', 'Updates for Contrib module one');
-    $this->assertText('Contributed module two (' . format_date($this->timestamp_new, 'html_date') . ')', 'Updates for Contrib module two');
+    $this->assertText('Contributed module two (' . format_date($this->timestampNew, 'html_date') . ')', 'Updates for Contrib module two');
 
     // Execute the translation update.
     $this->drupalPostForm('admin/reports/translations', array(), t('Update translations'));
@@ -165,10 +168,10 @@ function testUpdateImportSourceRemote() {
     $history = locale_translation_get_file_history();
     $this->assertTrue($history['contrib_module_one']['de']->timestamp >= $this->timestamp_now, 'Translation of contrib_module_one is imported');
     $this->assertTrue($history['contrib_module_one']['de']->last_checked >= $this->timestamp_now, 'Translation of contrib_module_one is updated');
-    $this->assertEqual($history['contrib_module_two']['de']->timestamp, $this->timestamp_new, 'Translation of contrib_module_two is imported');
+    $this->assertEqual($history['contrib_module_two']['de']->timestamp, $this->timestampNew, 'Translation of contrib_module_two is imported');
     $this->assertTrue($history['contrib_module_two']['de']->last_checked >= $this->timestamp_now, 'Translation of contrib_module_two is updated');
-    $this->assertEqual($history['contrib_module_three']['de']->timestamp, $this->timestamp_medium, 'Translation of contrib_module_three is not imported');
-    $this->assertEqual($history['contrib_module_three']['de']->last_checked, $this->timestamp_medium, 'Translation of contrib_module_three is not updated');
+    $this->assertEqual($history['contrib_module_three']['de']->timestamp, $this->timestampMedium, 'Translation of contrib_module_three is not imported');
+    $this->assertEqual($history['contrib_module_three']['de']->last_checked, $this->timestampMedium, 'Translation of contrib_module_three is not updated');
 
     // Check whether existing translations have (not) been overwritten.
     $this->assertEqual(t('January', array(), array('langcode' => 'de')), 'Januar_1', 'Translation of January');
@@ -187,12 +190,12 @@ function testUpdateImportSourceRemote() {
    *  - Source: local files only
    *  - Import overwrite: all existing translations
    */
-  function testUpdateImportSourceLocal() {
+  public function testUpdateImportSourceLocal() {
     $config = \Drupal::config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
-    $this-> setCurrentTranslations();
+    $this->setCurrentTranslations();
     $config->set('translation.default_filename', '%project-%version.%language._po');
 
     // Set the update conditions for this test.
@@ -217,12 +220,12 @@ function testUpdateImportSourceLocal() {
     // from the database. The function was called earlier during this test.
     drupal_static_reset('locale_translation_get_file_history');
     $history = locale_translation_get_file_history();
-    $this->assertTrue($history['contrib_module_one']['de']->timestamp >= $this->timestamp_medium, 'Translation of contrib_module_one is imported');
-    $this->assertEqual($history['contrib_module_one']['de']->last_checked, $this->timestamp_medium, 'Translation of contrib_module_one is updated');
-    $this->assertEqual($history['contrib_module_two']['de']->timestamp, $this->timestamp_new, 'Translation of contrib_module_two is imported');
+    $this->assertTrue($history['contrib_module_one']['de']->timestamp >= $this->timestampMedium, 'Translation of contrib_module_one is imported');
+    $this->assertEqual($history['contrib_module_one']['de']->last_checked, $this->timestampMedium, 'Translation of contrib_module_one is updated');
+    $this->assertEqual($history['contrib_module_two']['de']->timestamp, $this->timestampNew, 'Translation of contrib_module_two is imported');
     $this->assertTrue($history['contrib_module_two']['de']->last_checked >= $this->timestamp_now, 'Translation of contrib_module_two is updated');
-    $this->assertEqual($history['contrib_module_three']['de']->timestamp, $this->timestamp_medium, 'Translation of contrib_module_three is not imported');
-    $this->assertEqual($history['contrib_module_three']['de']->last_checked, $this->timestamp_medium, 'Translation of contrib_module_three is not updated');
+    $this->assertEqual($history['contrib_module_three']['de']->timestamp, $this->timestampMedium, 'Translation of contrib_module_three is not imported');
+    $this->assertEqual($history['contrib_module_three']['de']->last_checked, $this->timestampMedium, 'Translation of contrib_module_three is not updated');
 
     // Check whether existing translations have (not) been overwritten.
     $this->assertEqual(t('January', array(), array('langcode' => 'de')), 'Januar_customized', 'Translation of January');
@@ -241,12 +244,12 @@ function testUpdateImportSourceLocal() {
    *  - Source: remote and local files
    *  - Import overwrite: only overwrite non-customized translations
    */
-  function testUpdateImportModeNonCustomized() {
+  public function testUpdateImportModeNonCustomized() {
     $config = \Drupal::config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
-    $this-> setCurrentTranslations();
+    $this->setCurrentTranslations();
     $config->set('translation.default_filename', '%project-%version.%language._po');
 
     // Set the test conditions.
@@ -277,12 +280,12 @@ function testUpdateImportModeNonCustomized() {
    *  - Source: remote and local files
    *  - Import overwrite: don't overwrite any existing translation
    */
-  function testUpdateImportModeNone() {
+  public function testUpdateImportModeNone() {
     $config = \Drupal::config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
-    $this-> setCurrentTranslations();
+    $this->setCurrentTranslations();
     $config->set('translation.default_filename', '%project-%version.%language._po');
 
     // Set the test conditions.
@@ -309,7 +312,7 @@ function testUpdateImportModeNone() {
   /**
    * Tests automatic translation import when a module is enabled.
    */
-  function testEnableUninstallModule() {
+  public function testEnableUninstallModule() {
     // Make the hidden test modules look like a normal custom module.
     \Drupal::state()->set('locale.test_system_info_alter', TRUE);
 
@@ -347,7 +350,7 @@ function testEnableUninstallModule() {
    * enabled modules and will import them. When a language is removed the system
    * will remove all translations of that langugue from the database.
    */
-  function testEnableLanguage() {
+  public function testEnableLanguage() {
     // Make the hidden test modules look like a normal custom module.
     \Drupal::state()->set('locale.test_system_info_alter', TRUE);
 
@@ -391,7 +394,7 @@ function testEnableLanguage() {
   /**
    * Tests automatic translation import when a custom langauge is added.
    */
-  function testEnableCustomLanguage() {
+  public function testEnableCustomLanguage() {
     // Make the hidden test modules look like a normal custom module.
     \Drupal::state()->set('locale.test_system_info_alter', TRUE);
 
diff --git a/core/modules/locale/src/TranslationString.php b/core/modules/locale/src/TranslationString.php
index 6d0ac0543c8970979a26744a309abcb630fa6856..d04ed4f5a26d0e2d15458ecc84bc80852b8b6fbd 100644
--- a/core/modules/locale/src/TranslationString.php
+++ b/core/modules/locale/src/TranslationString.php
@@ -42,18 +42,18 @@ class TranslationString extends StringBase {
    *
    * @var bool
    */
-  protected $is_new;
+  protected $isNew;
 
   /**
    * Overrides Drupal\locale\StringBase::__construct().
    */
   public function __construct($values = array()) {
     parent::__construct($values);
-    if (!isset($this->is_new)) {
+    if (!isset($this->isNew)) {
       // We mark the string as not new if it is a complete translation.
       // This will work when loading from database, otherwise the storage
       // controller that creates the string object must handle it.
-      $this->is_new = !$this->isTranslation();
+      $this->isNew = !$this->isTranslation();
     }
   }
 
@@ -104,7 +104,7 @@ public function setString($string) {
    * Implements Drupal\locale\StringInterface::isNew().
    */
   public function isNew() {
-    return $this->is_new;
+    return $this->isNew;
   }
 
   /**
@@ -112,7 +112,7 @@ public function isNew() {
    */
   public function save() {
     parent::save();
-    $this->is_new = FALSE;
+    $this->isNew = FALSE;
     return $this;
   }
 
@@ -121,7 +121,7 @@ public function save() {
    */
   public function delete() {
     parent::delete();
-    $this->is_new = TRUE;
+    $this->isNew = TRUE;
     return $this;
   }
 
diff --git a/core/modules/locale/src/TranslationsStream.php b/core/modules/locale/src/TranslationsStream.php
index 5245bd4c49af49cbad6782e4217417cc0c5b2842..b00b58b0ed671de296f31ee5a0e471eb04a0687a 100644
--- a/core/modules/locale/src/TranslationsStream.php
+++ b/core/modules/locale/src/TranslationsStream.php
@@ -17,17 +17,18 @@
 class TranslationsStream extends LocalStream {
 
   /**
-   * Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath()
+   * {@inheritdoc}
    */
-  function getDirectoryPath() {
+  public function getDirectoryPath() {
     return \Drupal::config('locale.settings')->get('translation.path');
   }
 
   /**
-   * Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl().
+   * {@inheritdoc}
+   *
    * @throws \LogicException PO files URL should not be public.
    */
-  function getExternalUrl() {
+  public function getExternalUrl() {
     throw new \LogicException('PO files URL should not be public.');
   }
 }
diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.module b/core/modules/locale/tests/modules/locale_test/locale_test.module
index 4db96b83efd3870f146981766b8bf49f9bd6c380..13561681104adf404205eafd980250853adeee4f 100644
--- a/core/modules/locale/tests/modules/locale_test/locale_test.module
+++ b/core/modules/locale/tests/modules/locale_test/locale_test.module
@@ -48,10 +48,10 @@ function locale_test_locale_translation_projects_alter(&$projects) {
     $remote_url = $url . PublicStream::basePath() . '/remote/';
 
     // Completely replace the project data with a set of test projects.
-    $projects = array (
-      'contrib_module_one' => array (
+    $projects = array(
+      'contrib_module_one' => array(
         'name' => 'contrib_module_one',
-        'info' => array (
+        'info' => array(
           'name' => 'Contributed module one',
           'interface translation server pattern' => $remote_url . '%core/%project/%project-%version.%language._po',
           'package' => 'Other',
@@ -64,9 +64,9 @@ function locale_test_locale_translation_projects_alter(&$projects) {
         'project_type' => 'module',
         'project_status' => TRUE,
       ),
-      'contrib_module_two' => array (
+      'contrib_module_two' => array(
         'name' => 'contrib_module_two',
-        'info' => array (
+        'info' => array(
           'name' => 'Contributed module two',
           'interface translation server pattern' => $remote_url . '%core/%project/%project-%version.%language._po',
           'package' => 'Other',
@@ -79,9 +79,9 @@ function locale_test_locale_translation_projects_alter(&$projects) {
         'project_type' => 'module',
         'project_status' => TRUE,
       ),
-      'contrib_module_three' => array (
+      'contrib_module_three' => array(
         'name' => 'contrib_module_three',
-        'info' => array (
+        'info' => array(
           'name' => 'Contributed module three',
           'interface translation server pattern' => $remote_url . '%core/%project/%project-%version.%language._po',
           'package' => 'Other',
@@ -94,9 +94,9 @@ function locale_test_locale_translation_projects_alter(&$projects) {
         'project_type' => 'module',
         'project_status' => TRUE,
       ),
-      'locale_test' => array (
+      'locale_test' => array(
         'name' => 'locale_test',
-        'info' => array (
+        'info' => array(
           'name' => 'Locale test',
           'interface translation project' => 'locale_test',
           'interface translation server pattern' => 'core/modules/locale/tests/test.%language.po',
@@ -110,9 +110,9 @@ function locale_test_locale_translation_projects_alter(&$projects) {
         'project_type' => 'module',
         'project_status' => TRUE,
       ),
-      'custom_module_one' => array (
+      'custom_module_one' => array(
         'name' => 'custom_module_one',
-        'info' => array (
+        'info' => array(
           'name' => 'Custom module one',
           'interface translation project' => 'custom_module_one',
           'interface translation server pattern' => 'translations://custom_module_one.%language.po',
diff --git a/core/modules/locale/tests/src/LocaleLookupTest.php b/core/modules/locale/tests/src/LocaleLookupTest.php
index fb5d9afb883d0db518523f26aade35024ffd5b2d..1295d7b709b1777e436617570c55bce935e7f2f2 100644
--- a/core/modules/locale/tests/src/LocaleLookupTest.php
+++ b/core/modules/locale/tests/src/LocaleLookupTest.php
@@ -162,8 +162,10 @@ public function testResolveCacheMissWithFallback($langcode, $string, $context, $
         switch ($langcode) {
           case 'pl':
             return array('cs', 'en');
+
           case 'cs':
             return array('en');
+
           default:
             return array();
         }
diff --git a/core/modules/locale/tests/src/LocaleTranslationTest.php b/core/modules/locale/tests/src/LocaleTranslationTest.php
index befc3b732ca70761af91dc0a6e7f9f99bdc3ce5a..e3f3f2521dc67752f5d8f5ef10026d361a3f7ba2 100644
--- a/core/modules/locale/tests/src/LocaleTranslationTest.php
+++ b/core/modules/locale/tests/src/LocaleTranslationTest.php
@@ -41,7 +41,7 @@ protected function setUp() {
   }
 
   /**
-   * Tests for \Drupal\locale\LocaleTranslation::destruct()
+   * Tests for \Drupal\locale\LocaleTranslation::destruct().
    */
   public function testDestruct() {
     $translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub(), $this->languageManager);
diff --git a/core/modules/locale/tests/src/Menu/LocaleLocalTasksTest.php b/core/modules/locale/tests/src/Menu/LocaleLocalTasksTest.php
index c190b85051ea2a03d4a6df49a2baf763401393d9..ff8a96cea4bcf5cb89d85d8a01e63cef0e282965 100644
--- a/core/modules/locale/tests/src/Menu/LocaleLocalTasksTest.php
+++ b/core/modules/locale/tests/src/Menu/LocaleLocalTasksTest.php
@@ -16,6 +16,9 @@
  */
 class LocaleLocalTasksTest extends LocalTaskIntegrationTest {
 
+  /**
+   * {@inheritdoc}
+   */
   public function setUp() {
     $this->directoryList = array(
       'locale' => 'core/modules/locale',