diff --git a/core/modules/simpletest/simpletest.api.php b/core/modules/simpletest/simpletest.api.php
index e5251b7..5749d51 100644
--- a/core/modules/simpletest/simpletest.api.php
+++ b/core/modules/simpletest/simpletest.api.php
@@ -13,7 +13,7 @@
 /**
  * Alter the list of tests.
  *
- * @param $groups
+ * @param array $groups
  *   A two dimensional array, the first key is the test group, the second is the
  *   name of the test class, and the value is in associative array containing
  *   'name', 'description', 'group', and 'requires' keys.
@@ -46,7 +46,7 @@ function hook_test_group_finished() {
  *
  * This hook is called when an individual test has finished.
  *
- * @param
+ * @param array $results
  *   $results The results of the test as gathered by
  *   \Drupal\simpletest\WebTestBase.
  *
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 513d46d..040b470 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * Provides testing functionality.
+ */
 
 use Drupal\Core\Asset\AttachedAssetsInterface;
 use Drupal\Core\Database\Database;
@@ -10,11 +14,6 @@
 use Symfony\Component\Process\PhpExecutableFinder;
 
 /**
- * @file
- * Provides testing functionality.
- */
-
-/**
  * Implements hook_help().
  */
 function simpletest_help($route_name, RouteMatchInterface $route_match) {
@@ -115,7 +114,7 @@ function _simpletest_format_summary_line($summary) {
 /**
  * Runs tests.
  *
- * @param $test_list
+ * @param array $test_list
  *   List of tests to run.
  *
  * @return string
@@ -166,9 +165,9 @@ function simpletest_run_tests($test_list) {
 /**
  * Executes PHPUnit tests and returns the results of the run.
  *
- * @param $test_id
+ * @param int $test_id
  *   The current test ID.
- * @param $unescaped_test_classnames
+ * @param array $unescaped_test_classnames
  *   An array of test class names, including full namespaces, to be passed as
  *   a regular expression to PHPUnit's --filter option.
  *
@@ -205,7 +204,7 @@ function simpletest_process_phpunit_results($phpunit_results) {
 /**
  * Returns the path to use for PHPUnit's --log-junit option.
  *
- * @param $test_id
+ * @param int $test_id
  *   The current test ID.
  *
  * @return string
@@ -235,7 +234,7 @@ function simpletest_phpunit_configuration_filepath() {
  *   A filepath to use for PHPUnit's --log-junit option.
  *
  * @return string
- *  The results as returned by exec().
+ *   The results as returned by exec().
  */
 function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpunit_file) {
   $phpunit_bin = simpletest_phpunit_command();
@@ -363,6 +362,21 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) {
 
 /**
  * Implements callback_batch_finished().
+ *
+ * Tell the user that the tests are finished, and invoke
+ * hook_test_group_finished().
+ *
+ * @param bool $success
+ *   Whether or not the batch was successful.
+ * @param array $results
+ *   Array of results.
+ * @param array $operations
+ *   Operations remaining if $success is FALSE.
+ * @param string $elapsed
+ *   Time elapsed.
+ *
+ * @see callback_batch_finished()
+ * @see hook_test_group_finished()
  */
 function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
   if ($success) {
@@ -387,8 +401,9 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
 /**
  * Get information about the last test that ran given a test ID.
  *
- * @param $test_id
+ * @param int $test_id
  *   The test ID to get the last test from.
+ *
  * @return array
  *   Array containing the last database prefix used and the last test class
  *   that ran.
@@ -413,11 +428,11 @@ function simpletest_last_test_get($test_id) {
  * The errors in the log should only be fatal errors since any other errors
  * will have been recorded by the error handler.
  *
- * @param $test_id
+ * @param int $test_id
  *   The test ID to which the log relates.
- * @param $database_prefix
+ * @param string $database_prefix
  *   The database prefix to which the log relates.
- * @param $test_class
+ * @param string $test_class
  *   The test class to which the log relates.
  *
  * @return bool
@@ -594,7 +609,7 @@ function simpletest_clean_temporary_directories() {
 /**
  * Clears the test result tables.
  *
- * @param $test_id
+ * @param int $test_id
  *   Test ID to remove results for, or NULL to remove all results.
  *
  * @return int
@@ -642,9 +657,9 @@ function simpletest_mail_alter(&$message) {
 /**
  * Converts PHPUnit's JUnit XML output to an array.
  *
- * @param $test_id
+ * @param int $test_id
  *   The current test ID.
- * @param $phpunit_xml_file
+ * @param string $phpunit_xml_file
  *   Path to the PHPUnit XML file.
  *
  * @return array[]
diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php
index f71e323..6d2626c 100644
--- a/core/modules/simpletest/src/TestBase.php
+++ b/core/modules/simpletest/src/TestBase.php
@@ -321,7 +321,7 @@
   /**
    * Constructor for Test.
    *
-   * @param $test_id
+   * @param string $test_id
    *   Tests with the same id are reported together.
    */
   public function __construct($test_id = NULL) {
@@ -336,7 +336,7 @@ public function __construct($test_id = NULL) {
   /**
    * Checks the matching requirements for Test.
    *
-   * @return
+   * @return array
    *   Array of errors containing a list of unmet requirements.
    */
   protected function checkRequirements() {
@@ -346,20 +346,20 @@ protected function checkRequirements() {
   /**
    * Internal helper: stores the assert.
    *
-   * @param $status
+   * @param string $status
    *   Can be 'pass', 'fail', 'exception', 'debug'.
    *   TRUE is a synonym for 'pass', FALSE for 'fail'.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
-   * @param $caller
+   * @param array $caller
    *   By default, the assert comes from a function whose name starts with
    *   'test'. Instead, you can specify where this assert originates from
    *   by passing in an associative array as $caller. Key 'file' is
@@ -421,7 +421,7 @@ protected function assert($status, $message = '', $group = 'Other', array $calle
    * the method behaves just like \Drupal\simpletest\TestBase::assert() in terms
    * of storing the assertion.
    *
-   * @return
+   * @return string
    *   Message ID of the stored assertion.
    *
    * @see \Drupal\simpletest\TestBase::assert()
@@ -459,10 +459,10 @@ public static function insertAssert($test_id, $test_class, $status, $message = '
   /**
    * Delete an assertion record by message ID.
    *
-   * @param $message_id
+   * @param string $message_id
    *   Message ID of the assertion to delete.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion was deleted, FALSE otherwise.
    *
    * @see \Drupal\simpletest\TestBase::insertAssert()
@@ -506,7 +506,7 @@ public static function getDatabaseConnection() {
   /**
    * Cycles through backtrace until the first non-assertion method is found.
    *
-   * @return
+   * @return array
    *   Array representing the true caller.
    */
   protected function getAssertionCall() {
@@ -515,7 +515,7 @@ protected function getAssertionCall() {
     // The first element is the call. The second element is the caller.
     // We skip calls that occurred in one of the methods of our base classes
     // or in an assertion function.
-   while (($caller = $backtrace[1]) &&
+    while (($caller = $backtrace[1]) &&
          ((isset($caller['class']) && isset($this->skipClasses[$caller['class']])) ||
            substr($caller['function'], 0, 6) == 'assert')) {
       // We remove that call.
@@ -530,20 +530,20 @@ protected function getAssertionCall() {
    *
    * False values are: empty string, 0, NULL, and FALSE.
    *
-   * @param $value
+   * @param mixed $value
    *   The value on which the assertion is to be done.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertTrue($value, $message = '', $group = 'Other') {
@@ -555,20 +555,20 @@ protected function assertTrue($value, $message = '', $group = 'Other') {
    *
    * False values are: empty string, 0, NULL, and FALSE.
    *
-   * @param $value
+   * @param mixed $value
    *   The value on which the assertion is to be done.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertFalse($value, $message = '', $group = 'Other') {
@@ -578,20 +578,20 @@ protected function assertFalse($value, $message = '', $group = 'Other') {
   /**
    * Check to see if a value is NULL.
    *
-   * @param $value
+   * @param mixed $value
    *   The value on which the assertion is to be done.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertNull($value, $message = '', $group = 'Other') {
@@ -601,20 +601,20 @@ protected function assertNull($value, $message = '', $group = 'Other') {
   /**
    * Check to see if a value is not NULL.
    *
-   * @param $value
+   * @param mixed $value
    *   The value on which the assertion is to be done.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertNotNull($value, $message = '', $group = 'Other') {
@@ -624,22 +624,22 @@ protected function assertNotNull($value, $message = '', $group = 'Other') {
   /**
    * Check to see if two values are equal.
    *
-   * @param $first
+   * @param mixed $first
    *   The first value to check.
-   * @param $second
+   * @param mixed $second
    *   The second value to check.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertEqual($first, $second, $message = '', $group = 'Other') {
@@ -649,22 +649,22 @@ protected function assertEqual($first, $second, $message = '', $group = 'Other')
   /**
    * Check to see if two values are not equal.
    *
-   * @param $first
+   * @param mixed $first
    *   The first value to check.
-   * @param $second
+   * @param mixed $second
    *   The second value to check.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertNotEqual($first, $second, $message = '', $group = 'Other') {
@@ -674,22 +674,22 @@ protected function assertNotEqual($first, $second, $message = '', $group = 'Othe
   /**
    * Check to see if two values are identical.
    *
-   * @param $first
+   * @param mixed $first
    *   The first value to check.
-   * @param $second
+   * @param mixed $second
    *   The second value to check.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertIdentical($first, $second, $message = '', $group = 'Other') {
@@ -699,22 +699,22 @@ protected function assertIdentical($first, $second, $message = '', $group = 'Oth
   /**
    * Check to see if two values are not identical.
    *
-   * @param $first
+   * @param mixed $first
    *   The first value to check.
-   * @param $second
+   * @param mixed $second
    *   The second value to check.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertNotIdentical($first, $second, $message = '', $group = 'Other') {
@@ -728,18 +728,18 @@ protected function assertNotIdentical($first, $second, $message = '', $group = '
    *   The first object to check.
    * @param object $object2
    *   The second object to check.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertIdenticalObject($object1, $object2, $message = '', $group = 'Other') {
@@ -772,19 +772,19 @@ protected function assertNoErrorsLogged() {
   /**
    * Fire an assertion that is always positive.
    *
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
-   *   TRUE.
+   * @return bool
+   *   Always returns TRUE.
    */
   protected function pass($message = NULL, $group = 'Other') {
     return $this->assert(TRUE, $message, $group);
@@ -793,19 +793,19 @@ protected function pass($message = NULL, $group = 'Other') {
   /**
    * Fire an assertion that is always negative.
    *
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
-   *   FALSE.
+   * @return bool
+   *   Always returns FALSE.
    */
   protected function fail($message = NULL, $group = 'Other') {
     return $this->assert(FALSE, $message, $group);
@@ -814,21 +814,21 @@ protected function fail($message = NULL, $group = 'Other') {
   /**
    * Fire an error assertion.
    *
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use \Drupal\Component\Utility\String::format() to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
-   * @param $caller
+   * @param array $caller
    *   The caller of the error.
    *
-   * @return
-   *   FALSE.
+   * @return bool
+   *   Always returns FALSE.
    */
   protected function error($message = '', $group = 'Other', array $caller = NULL) {
     if ($group == 'User notice') {
@@ -846,7 +846,7 @@ protected function error($message = '', $group = 'Other', array $caller = NULL)
    * The link to the verbose message will be placed in the test results as a
    * passing assertion with the text '[verbose message]'.
    *
-   * @param $message
+   * @param string $message
    *   The verbose message to be stored.
    *
    * @see simpletest_verbose()
@@ -875,7 +875,7 @@ protected function verbose($message) {
    * Regardless of whether $methods are passed or not, only method names
    * starting with "test" are executed.
    *
-   * @param $methods
+   * @param string|array $methods
    *   (optional) A list of method names in the test case class to run; e.g.,
    *   array('testFoo', 'testBar'). By default, all methods of the class are
    *   taken into account, but it can be useful to only run a few selected test
@@ -1390,9 +1390,9 @@ protected function exceptionHandler($exception) {
   /**
    * Changes in memory settings.
    *
-   * @param $name
+   * @param string $name
    *   The name of the setting to return.
-   * @param $value
+   * @param mixed $value
    *   The value of the setting.
    *
    * @see \Drupal\Core\Site\Settings::get()
@@ -1438,13 +1438,13 @@ public function randomString($length = 8) {
   /**
    * Callback for random string validation.
    *
-   * @see \Drupal\Component\Utility\Random::string()
-   *
    * @param string $string
    *   The random string to validate.
    *
    * @return bool
    *   TRUE if the random string is valid, FALSE if not.
+   *
+   * @see \Drupal\Component\Utility\Random::string()
    */
   public function randomStringValidate($string) {
     // Consecutive spaces causes issues for
@@ -1537,11 +1537,11 @@ protected function getRandomGenerator() {
    * )
    * @endcode
    *
-   * @param $parameters
+   * @param array $parameters
    *   An associative array of parameters, keyed by parameter name, and whose
    *   values are arrays of parameter values.
    *
-   * @return
+   * @return array
    *   A list of permutations, which is an array of arrays. Each inner array
    *   contains the full list of parameters that have been passed, but with a
    *   single value only.
@@ -1623,7 +1623,7 @@ public function copyConfig(StorageInterface $source_storage, StorageInterface $t
   /**
    * Configuration accessor for tests. Returns non-overriden configuration.
    *
-   * @param $name
+   * @param string $name
    *   Configuration name.
    *
    * @return \Drupal\Core\Config\Config
diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php
index 4544dc8..28a6f2b 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -49,6 +49,7 @@ class SimpleTestTest extends WebTestBase {
 
   /**
    * Translated pass message.
+   *
    * @var string
    */
   private $passMessage = '';
@@ -270,13 +271,19 @@ function getTestIdFromResults() {
   /**
    * Asserts that an assertion with specified values is displayed in results.
    *
-   * @param string $message Assertion message.
-   * @param string $type Assertion type.
-   * @param string $status Assertion status.
-   * @param string $file File where the assertion originated.
-   * @param string $functuion Function where the assertion originated.
+   * @param string $message
+   *   Assertion message.
+   * @param string $type
+   *   Assertion type.
+   * @param string $status
+   *   Assertion status.
+   * @param string $file
+   *   File where the assertion originated.
+   * @param string $function
+   *   Function where the assertion originated.
    *
-   * @return Assertion result.
+   * @return bool
+   *   TRUE if the assertion matches the specified parameters. FALSE otherwise.
    */
   function assertAssertion($message, $type, $status, $file, $function) {
     $message = trim(strip_tags($message));
@@ -339,10 +346,10 @@ function getResultFieldSet() {
   /**
    * Extract the text contained by the element.
    *
-   * @param $element
+   * @param \SimpleXMLElement $element
    *   Element to extract text from.
    *
-   * @return
+   * @return string
    *   Extracted text.
    */
   function asText(\SimpleXMLElement $element) {
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 926738f..582ba91 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -199,9 +199,9 @@ function __construct($test_id = NULL) {
   /**
    * Get a node from the database based on its title.
    *
-   * @param $title
+   * @param string $title
    *   A node title, usually generated by $this->randomMachineName().
-   * @param $reset
+   * @param bool $reset
    *   (optional) Whether to reset the entity cache.
    *
    * @return \Drupal\node\NodeInterface
@@ -316,7 +316,9 @@ protected function drupalCreateContentType(array $values = array()) {
    *   the current content language.
    * @param bool $reset
    *   (optional) Whether to clear the cache for this entity.
+   *
    * @return array
+   *   A renderable view of $entity.
    *
    * @see drupal_render()
    */
@@ -448,13 +450,13 @@ protected function findBlockInstance(Block $block) {
   /**
    * Gets a list files that can be used in tests.
    *
-   * @param $type
+   * @param string $type
    *   File type, possible values: 'binary', 'html', 'image', 'javascript',
    *   'php', 'sql', 'text'.
-   * @param $size
+   * @param int|NULL $size
    *   File size in bytes to match. Please check the tests/files folder.
    *
-   * @return
+   * @return array
    *   List of files that match filter.
    */
   protected function drupalGetTestFiles($type, $size = NULL) {
@@ -568,11 +570,11 @@ protected function drupalCreateUser(array $permissions = array(), $name = NULL)
    *
    * @param array $permissions
    *   Array of permission names to assign to role.
-   * @param string $rid
+   * @param string|NULL $rid
    *   (optional) The role ID (machine name). Defaults to a random name.
-   * @param string $name
+   * @param string|NULL $name
    *   (optional) The label for the role. Defaults to a random string.
-   * @param integer $weight
+   * @param int|NULL $weight
    *   (optional) The weight for the role. Defaults NULL so that entity_create()
    *   sets the weight to maximum + 1.
    *
@@ -704,7 +706,7 @@ protected function drupalLogin(AccountInterface $account) {
   /**
    * Returns whether a given user account is logged in.
    *
-   * @param \Drupal\user\UserInterface $account
+   * @param \Drupal\user\AccountInterface $account
    *   The user account object to check.
    */
   protected function drupalUserIsLoggedIn($account) {
@@ -1056,9 +1058,9 @@ protected function writeSettings(array $settings) {
   /**
    * Changes parameters in the services.yml file.
    *
-   * @param $name
+   * @param string $name
    *   The name of the parameter.
-   * @param $value
+   * @param mixed $value
    *   The value of the parameter.
    */
   protected function setContainerParameter($name, $value) {
@@ -1280,15 +1282,15 @@ protected function curlInitialize() {
   /**
    * Initializes and executes a cURL request.
    *
-   * @param $curl_options
+   * @param array $curl_options
    *   An associative array of cURL options to set, where the keys are constants
    *   defined by the cURL library. For a list of valid options, see
    *   http://www.php.net/manual/function.curl-setopt.php
-   * @param $redirect
+   * @param bool $redirect
    *   FALSE if this is an initial request, TRUE if this request is the result
-   *   of a redirect.
+   *   of a redirect. Defaults to FALSE.
    *
-   * @return
+   * @return mixed
    *   The content returned from the call to curl_exec().
    *
    * @see curlInitialize()
@@ -1405,12 +1407,19 @@ protected function curlExec($curl_options, $redirect = FALSE) {
   /**
    * Reads headers and registers errors received from the tested site.
    *
-   * @param $curlHandler
+   * This method is registered to curl as a callback in
+   * \Drupal\simpletest\WebTestBase::curlInitialize().
+   *
+   * @param \resource $curlHandler
    *   The cURL handler.
-   * @param $header
-   *   An header.
+   * @param string $header
+   *   Header data.
+   *
+   * @return int
+   *   The number of bytes read.
    *
-   * @see _drupal_log_error().
+   * @see _drupal_log_error()
+   * @see \Drupal\simpletest\WebTestBase::curlInitialize()
    */
   protected function curlHeaderCallback($curlHandler, $header) {
     // Header fields can be extended over multiple lines by preceding each
@@ -1481,15 +1490,15 @@ protected function isInChildSite() {
   /**
    * Retrieves a Drupal path or an absolute path.
    *
-   * @param \Drupal\Core\Url|string $path
+   * @param string $path
    *   Drupal path or URL to load into internal browser
-   * @param $options
+   * @param array $options
    *   Options to be forwarded to the url generator.
-   * @param $headers
+   * @param array $headers
    *   An array containing additional HTTP request headers, each formatted as
    *   "name: value".
    *
-   * @return
+   * @return string
    *   The retrieved HTML string, also available as $this->getRawContent()
    */
   protected function drupalGet($path, array $options = array(), array $headers = array()) {
@@ -1517,7 +1526,7 @@ protected function drupalGet($path, array $options = array(), array $headers = a
   }
 
   /**
-   * Retrieves a Drupal path or an absolute path and JSON decode the result.
+   * Requests a Drupal path in JSON format, and JSON decodes the response.
    *
    * @param string $path
    *   Path to request AJAX from.
@@ -1528,7 +1537,6 @@ protected function drupalGet($path, array $options = array(), array $headers = a
    *
    * @return array
    *   Decoded json.
-   * Requests a Drupal path in JSON format, and JSON decodes the response.
    */
   protected function drupalGetJSON($path, array $options = array(), array $headers = array()) {
     $headers[] = 'Accept: application/json';
@@ -1548,7 +1556,7 @@ protected function drupalGetAJAX($path, array $options = array(), array $headers
    *
    * It will be done as usual POST request with SimpleBrowser.
    *
-   * @param $path
+   * @param string|NULL $path
    *   Location of the post form. Either a Drupal path or an absolute path or
    *   NULL to post to the current page. For multi-stage forms you can set the
    *   path to NULL and have it post to the last received page. Example:
@@ -1562,7 +1570,7 @@ protected function drupalGetAJAX($path, array $options = array(), array $headers
    *   $edit = array(...);
    *   $this->drupalPostForm(NULL, $edit, t('Save'));
    *   @endcode
-   * @param  $edit
+   * @param array $edit
    *   Field data in an associative array. Changes the current input fields
    *   (where possible) to the values indicated.
    *
@@ -1589,7 +1597,7 @@ protected function drupalGetAJAX($path, array $options = array(), array $headers
    *
    *   Note that when a form contains file upload fields, other
    *   fields cannot start with the '@' character.
-   * @param $submit
+   * @param array $submit
    *   Value of the submit button whose click is to be emulated. For example,
    *   t('Save'). The processing of the request depends on this value. For
    *   example, a form may have one button with the value t('Save') and another
@@ -1614,19 +1622,19 @@ protected function drupalGetAJAX($path, array $options = array(), array $headers
    *   submission of a form with a single text field, and pressing ENTER in that
    *   textfield: under these conditions, no button information is added to the
    *   POST data.
-   * @param $options
+   * @param array $options
    *   Options to be forwarded to the url generator.
-   * @param $headers
+   * @param array $headers
    *   An array containing additional HTTP request headers, each formatted as
    *   "name: value".
-   * @param $form_html_id
+   * @param string|NULL $form_html_id
    *   (optional) HTML ID of the form to be submitted. On some pages
    *   there are many identical forms, so just using the value of the submit
    *   button is not enough. For example: 'trigger-node-presave-assign-form'.
    *   Note that this is not the Drupal $form_id, but rather the HTML ID of the
    *   form, which is typically the same thing but with hyphens replacing the
    *   underscores.
-   * @param $extra_post
+   * @param string|NULL $extra_post
    *   (optional) A string of additional data to append to the POST submission.
    *   This can be used to add POST data for which there are no HTML fields, as
    *   is done by drupalPostAjaxForm(). This string is literally appended to the
@@ -1726,36 +1734,36 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
    * update $this->content via drupalProcessAjaxResponse(). It also returns
    * the array of AJAX commands received.
    *
-   * @param $path
+   * @param string|NULL $path
    *   Location of the form containing the Ajax enabled element to test. Can be
    *   either a Drupal path or an absolute path or NULL to use the current page.
-   * @param $edit
+   * @param array $edit
    *   Field data in an associative array. Changes the current input fields
    *   (where possible) to the values indicated.
-   * @param $triggering_element
+   * @param string|array $triggering_element
    *   The name of the form element that is responsible for triggering the Ajax
    *   functionality to test. May be a string or, if the triggering element is
    *   a button, an associative array where the key is the name of the button
    *   and the value is the button label. i.e.) array('op' => t('Refresh')).
-   * @param $ajax_path
+   * @param string|NULL $ajax_path
    *   (optional) Override the path set by the Ajax settings of the triggering
    *   element. In the absence of both the triggering element's Ajax path and
    *   $ajax_path 'system/ajax' will be used.
-   * @param $options
+   * @param array|NULL $options
    *   (optional) Options to be forwarded to the url generator.
-   * @param $headers
+   * @param array|NULL $headers
    *   (optional) An array containing additional HTTP request headers, each
    *   formatted as "name: value". Forwarded to drupalPostForm().
-   * @param $form_html_id
+   * @param string|NULL $form_html_id
    *   (optional) HTML ID of the form to be submitted, use when there is more
    *   than one identical form on the same page and the value of the triggering
    *   element is not enough to identify the form. Note this is not the Drupal
    *   ID of the form but rather the HTML ID of the form.
-   * @param $ajax_settings
+   * @param array|NULL $ajax_settings
    *   (optional) An array of Ajax settings which if specified will be used in
    *   place of the Ajax settings of the triggering element.
    *
-   * @return
+   * @return array
    *   An array of Ajax commands.
    *
    * @see drupalPostForm()
@@ -1972,7 +1980,7 @@ protected function drupalProcessAjaxResponse($content, array $ajax_response, arr
    *   (optional) Options to be forwarded to the url generator. The 'absolute'
    *   option will automatically be enabled.
    *
-   * @return
+   * @return mixed
    *   The content returned from the call to curl_exec().
    *
    * @see WebTestBase::getAjaxPageStatePostData()
@@ -2062,7 +2070,7 @@ protected function cronRun() {
    * This function looks for the http-equiv attribute to be set to "Refresh" and
    * is case-sensitive.
    *
-   * @return
+   * @return string|FALSE
    *   Either the new page content or FALSE.
    */
   protected function checkForMetaRefresh() {
@@ -2082,16 +2090,18 @@ protected function checkForMetaRefresh() {
   /**
    * Retrieves only the headers for a Drupal path or an absolute path.
    *
-   * @param $path
+   * @param string $path
    *   Drupal path or URL to load into internal browser
-   * @param $options
+   * @param array $options
    *   Options to be forwarded to the url generator.
-   * @param $headers
+   * @param array $headers
    *   An array containing additional HTTP request headers, each formatted as
    *   "name: value".
    *
-   * @return
-   *   The retrieved headers, also available as $this->getRawContent()
+   * @return string
+   *   The retrieved headers, also available as $this->getRawContent().
+   *
+   * @todo: https://www.drupal.org/node/2403007
    */
   protected function drupalHead($path, array $options = array(), array $headers = array()) {
     $options['absolute'] = TRUE;
@@ -2115,17 +2125,18 @@ protected function drupalHead($path, array $options = array(), array $headers =
    * Ensure that the specified fields exist and attempt to create POST data in
    * the correct manner for the particular field type.
    *
-   * @param $post
+   * @param array $post
    *   Reference to array of post values.
-   * @param $edit
+   * @param array $edit
    *   Reference to array of edit values to be checked against the form.
-   * @param $submit
+   * @param string $submit
    *   Form submit button value.
-   * @param $form
+   * @param array $form
    *   Array of form elements.
    *
-   * @return
-   *   Submit value matches a valid submit input in the form.
+   * @return bool
+   *   TRUE if submit value matches a valid submit input in the form. FALSE
+   *   otherwise.
    */
   protected function handleForm(&$post, &$edit, &$upload, $submit, $form) {
     // Retrieve the form elements.
@@ -2279,12 +2290,12 @@ protected function handleForm(&$post, &$edit, &$upload, $submit, $form) {
    *
    * If the link is discovered and clicked, the test passes. Fail otherwise.
    *
-   * @param $label
+   * @param string $label
    *   Text between the anchor tags.
-   * @param $index
-   *   Link position counting from zero.
+   * @param int $index
+   *   (Optional) Link position counting from zero. Defaults to zero.
    *
-   * @return
+   * @return string|FALSE
    *   Page contents on success, or FALSE on failure.
    */
   protected function clickLink($label, $index = 0) {
@@ -2302,10 +2313,10 @@ protected function clickLink($label, $index = 0) {
   /**
    * Takes a path and returns an absolute path.
    *
-   * @param $path
+   * @param string $path
    *   A path from the internal browser content.
    *
-   * @return
+   * @return string
    *   The $path with $base_url prepended, if necessary.
    */
   protected function getAbsoluteUrl($path) {
@@ -2338,11 +2349,11 @@ protected function getAbsoluteUrl($path) {
    * multiple requests will be required to retrieve the page. Headers from all
    * requests may be requested by passing TRUE to this function.
    *
-   * @param $all_requests
-   *   Boolean value specifying whether to return headers from all requests
-   *   instead of just the last request. Defaults to FALSE.
+   * @param bool $all_requests
+   *   (optional) Boolean value specifying whether to return headers from all
+   *   requests instead of just the last request. Defaults to FALSE.
    *
-   * @return
+   * @return array
    *   A name/value array if headers from only the last request are requested.
    *   If headers from all requests are requested, an array of name/value
    *   arrays, one for each request.
@@ -2390,14 +2401,14 @@ protected function drupalGetHeaders($all_requests = FALSE) {
    * passed as the second argument, all requests will be processed from last to
    * first until the header is found.
    *
-   * @param $name
+   * @param string $name
    *   The name of the header to retrieve. Names are case-insensitive (see RFC
    *   2616 section 4.2).
-   * @param $all_requests
-   *   Boolean value specifying whether to check all requests if the header is
-   *   not found in the last request. Defaults to FALSE.
+   * @param bool $all_requests
+   *   (optional) Boolean value specifying whether to check all requests if the
+   *   header is not found in the last request. Defaults to FALSE.
    *
-   * @return
+   * @return string|FALSE
    *   The HTTP header value or FALSE if not found.
    */
   protected function drupalGetHeader($name, $all_requests = FALSE) {
@@ -2423,11 +2434,11 @@ protected function drupalGetHeader($name, $all_requests = FALSE) {
   /**
    * Gets an array containing all emails sent during this test case.
    *
-   * @param $filter
+   * @param array $filter
    *   An array containing key/value pairs used to filter the emails that are
    *   returned.
    *
-   * @return
+   * @return array
    *   An array containing email messages captured during the current test.
    */
   protected function drupalGetMails($filter = array()) {
@@ -2449,21 +2460,21 @@ protected function drupalGetMails($filter = array()) {
   /**
    * Passes if the internal browser's URL matches the given path.
    *
-   * @param \Drupal\Core\Url|string $path
+   * @param string $path
    *   The expected system path or URL.
-   * @param $options
+   * @param array $options
    *   (optional) Any additional options to pass for $path to the url generator.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use format_string() to embed variables in the message text, not
    *   t(). If left blank, a default message will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertUrl($path, array $options = array(), $message = '', $group = 'Other') {
@@ -2490,20 +2501,22 @@ protected function assertUrl($path, array $options = array(), $message = '', $gr
   /**
    * Asserts the page responds with the specified response code.
    *
-   * @param $code
-   *   Response code. For example 200 is a successful page request. For a list
-   *   of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
-   * @param $message
+   * @param array|string|int $code
+   *   Response code as string or integer, or an array of expected response
+   *   codes. For example 200 is a successful page request. For a list
+   *   of all codes and their meanings, see
+   *   http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use format_string() to embed variables in the message text, not
    *   t(). If left blank, a default message will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Browser'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   Assertion result.
    */
   protected function assertResponse($code, $message = '', $group = 'Browser') {
@@ -2515,20 +2528,22 @@ protected function assertResponse($code, $message = '', $group = 'Browser') {
   /**
    * Asserts the page did not return the specified response code.
    *
-   * @param $code
-   *   Response code. For example 200 is a successful page request. For a list
-   *   of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
-   * @param $message
+   * @param array|string|int $code
+   *   Response code as string or integer, or an array of expected response
+   *   codes. For example 200 is a successful page request. For a list
+   *   of all codes and their meanings, see
+   *   http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use format_string() to embed variables in the message text, not
    *   t(). If left blank, a default message will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Browser'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   Assertion result.
    */
   protected function assertNoResponse($code, $message = '', $group = 'Browser') {
@@ -2542,22 +2557,22 @@ protected function assertNoResponse($code, $message = '', $group = 'Browser') {
    *
    * The field in $name must have the content described in $value.
    *
-   * @param $name
+   * @param string $name
    *   Name of field or message property to assert. Examples: subject, body,
    *   id, ...
-   * @param $value
+   * @param string $value
    *   Value of the field to assert.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use format_string() to embed variables in the message text, not
    *   t(). If left blank, a default message will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Email'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertMail($name, $value = '', $message = '', $group = 'Email') {
@@ -2569,23 +2584,23 @@ protected function assertMail($name, $value = '', $message = '', $group = 'Email
   /**
    * Asserts that the most recently sent email message has the string in it.
    *
-   * @param $field_name
+   * @param string $field_name
    *   Name of field or message property to assert: subject, body, id, ...
-   * @param $string
+   * @param string $string
    *   String to search for.
-   * @param $email_depth
+   * @param int $email_depth
    *   Number of emails to search for string, starting with most recent.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use format_string() to embed variables in the message text, not
    *   t(). If left blank, a default message will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertMailString($field_name, $string, $email_depth, $message = '', $group = 'Other') {
@@ -2611,21 +2626,21 @@ protected function assertMailString($field_name, $string, $email_depth, $message
   /**
    * Asserts that the most recently sent email message has the pattern in it.
    *
-   * @param $field_name
+   * @param string $field_name
    *   Name of field or message property to assert: subject, body, id, ...
-   * @param $regex
+   * @param string $regex
    *   Pattern to search for.
-   * @param $message
+   * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
    *   messages: use format_string() to embed variables in the message text, not
    *   t(). If left blank, a default message will be displayed.
-   * @param $group
+   * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
    *   translate this string. Defaults to 'Other'; most tests do not override
    *   this default.
    *
-   * @return
+   * @return bool
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertMailPattern($field_name, $regex, $message = '', $group = 'Other') {
@@ -2641,8 +2656,8 @@ protected function assertMailPattern($field_name, $regex, $message = '', $group
   /**
    * Outputs to verbose the most recent $count emails sent.
    *
-   * @param $count
-   *   Optional number of emails to output.
+   * @param int $count
+   *   (optional) Number of emails to output.
    */
   protected function verboseEmail($count = 1) {
     $mails = $this->drupalGetMails();
@@ -2662,11 +2677,12 @@ protected function verboseEmail($count = 1) {
    * request object.
    *
    * @param bool $clean_urls
-   *   Whether to mock the request using clean urls.
-   * @param $override_server_vars
-   *   An array of server variables to override.
+   *   (optional) Whether to mock the request using clean urls. Defaults to
+   *   TRUE.
+   * @param array $override_server_vars
+   *   (optional) An array of server variables to override.
    *
-   * @return $request
+   * @return \Symfony\Component\HttpFoundation\Request $request
    *   The mocked request object.
    */
   protected function prepareRequestForGenerator($clean_urls = TRUE, $override_server_vars = array()) {
diff --git a/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php b/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php
index 0a82609..fe5bc5e 100644
--- a/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php
+++ b/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php
@@ -1,5 +1,10 @@
 <?php
 
+/**
+ * @file
+ * Contains \Drupal\simpletest\Tests\PhpUnitErrorTest
+ */
+
 namespace Drupal\Tests\simpletest\Unit;
 
 use Drupal\Tests\UnitTestCase;
diff --git a/core/modules/simpletest/tests/src/Unit/TestBaseTest.php b/core/modules/simpletest/tests/src/Unit/TestBaseTest.php
index 9bac4fc..334b3af 100644
--- a/core/modules/simpletest/tests/src/Unit/TestBaseTest.php
+++ b/core/modules/simpletest/tests/src/Unit/TestBaseTest.php
@@ -32,7 +32,7 @@ protected function setUp() {
    * @return array
    *   An array of values passed to the test method.
    */
-  public function randomStringValidateProvider () {
+  public function randomStringValidateProvider() {
     return array(
       array(' curry paste', FALSE),
       array('curry paste ', FALSE),
@@ -53,7 +53,7 @@ public function randomStringValidateProvider () {
    * @param bool $expected
    *   The expected result of the validation.
    *
-   * @see \Drupal\simpletest\TestBase::randomStringValidate().
+   * @see \Drupal\simpletest\TestBase::randomStringValidate()
    *
    * @dataProvider randomStringValidateProvider
    * @covers ::randomStringValidate
