diff --git a/environment.admin.inc b/environment.admin.inc
index ec81062..fe6920c 100644
--- a/environment.admin.inc
+++ b/environment.admin.inc
@@ -1,10 +1,15 @@
 <?php
-
 /**
  * @file
- * Settings for Environment module
+ * Settings for Environment module.
  */
 
+/**
+ * Environment admin form.
+ *
+ * @return array
+ *   admin form.
+ */
 function environment_admin_settings() {
   $form = array();
 
@@ -68,10 +73,11 @@ function environment_switch_environment_submit($form, &$form_state) {
           $workflow = environment_load_workflow($element);
           drupal_set_message(t("Successfully switched @workflow workflow from the '@original' to the '@new' environment.",
                                array(
-                                '@workflow' => $workflow['label'],
-                                '@original' => $original['label'],
-                                '@new' => $new['label'],
-                               ))
+                                 '@workflow' => $workflow['label'],
+                                 '@original' => $original['label'],
+                                 '@new' => $new['label'],
+                               )
+                              )
                             );
         }
       }
@@ -82,8 +88,8 @@ function environment_switch_environment_submit($form, &$form_state) {
 /**
  * Environment switch form callback.
  *
- * @param $environment
- *  The environment being switched to.
+ * @param string $environment
+ *   The environment being switched to.
  */
 function environment_switch_confirm(&$form_state, $environment) {
   if (empty($environment)) {
diff --git a/environment.api.php b/environment.api.php
index 72defbc..7737091 100644
--- a/environment.api.php
+++ b/environment.api.php
@@ -1,8 +1,7 @@
 <?php
-
 /**
  * @file
- *  Hooks provided by Environment.
+ * Hooks provided by Environment.
  */
 
 /**
@@ -24,19 +23,19 @@
  * careful that you do not *disable* any modules in one environment that
  * implement a necessary instance of hook_environment_switch().
  *
- * @param $target_env
- *  The name of the environment being activated.
- * @param $current_env
- *  The name of the environment being deactivated.
- * @param $workflow
- *  The name of the environment workflow whose current state is being switched.
- *  A "NULL" workflow is the default/generic/unspecified workflow for the site.
+ * @param string $target_env
+ *   The name of the environment being activated.
+ * @param string $current_env
+ *   The name of the environment being deactivated.
+ * @param string $workflow
+ *   The name of the environment workflow whose current state is being switched.
+ *   A "NULL" workflow is the default/generic/unspecified workflow for the site.
  *
- * @return
- *  String summarizing changes made for drush user.
+ * @return string
+ *   String summarizing changes made for drush user.
  */
 function hook_environment_switch($target_env, $current_env, $workflow = NULL) {
-  // Declare each optional development-related module
+  // Declare each optional development-related module.
   $devel_modules = array(
     'devel',
     'devel_generate',
@@ -48,6 +47,7 @@ function hook_environment_switch($target_env, $current_env, $workflow = NULL) {
       module_disable($devel_modules);
       drupal_set_message('Disabled development modules');
       return;
+
     case 'development':
       module_enable($devel_modules);
       drupal_set_message('Enabled development modules');
@@ -61,15 +61,16 @@ function hook_environment_switch($target_env, $current_env, $workflow = NULL) {
  * This hook is to facilitate UI building and restricting environment switch to
  * known environments.
  *
- * @return
- *  Array of environment names in the format:
- *  - label: Human-readable name for the environment.
- *  - description: Description of the environment and it's purpose.
- *  - workflow: Tag the state with the machine name of the environment workflow.
- *  - allowed: Central definition of permitted operations for the
- *    environment_allowed() function. Default FALSE indicates that something
- *    should not happen, such as show the user a debugging message. Different
- *    categories can be specified for different rulesets.
+ * @return array
+ *   Array of environment names in the format:
+ *   - label: Human-readable name for the environment.
+ *   - description: Description of the environment and it's purpose.
+ *   - workflow: Tag the state with the machine name of the environment
+ *     workflow.
+ *   - allowed: Central definition of permitted operations for the
+ *     environment_allowed() function. Default FALSE indicates that something
+ *     should not happen, such as show the user a debugging message. Different
+ *     categories can be specified for different rulesets.
  *
  * @see environment_allowed
  */
@@ -82,7 +83,7 @@ function hook_environment() {
     'allowed' => array(
       'default' => FALSE,
       'email' => FALSE,
-    ),       
+    ),
   );
   $environment['internal'] = array(
     'label' => t('Internal-only site'),
@@ -103,8 +104,8 @@ function hook_environment() {
  *
  * This is especially useful to modify the defined allowed operations.
  *
- * @param $environments
- *  Defined environment states.
+ * @param array $environments
+ *   Defined environment states.
  */
 function hook_environment_alter(&$environments) {
   $environments['production'] = t('Production site');
@@ -126,14 +127,14 @@ function hook_environment_alter(&$environments) {
  * functional development vs. front-end design, or administrative review stages
  * of the site as a software project.
  *
- * @return Array
- *  Array of workflows indexed on machine name. Supported elements include:
- *  - label: The human-readable name for the workflow.
- *  - description: Extended description of the workflow.
+ * @return array
+ *   Array of workflows indexed on machine name. Supported elements include:
+ *   - label: The human-readable name for the workflow.
+ *   - description: Extended description of the workflow.
  */
 function hook_environment_workflow() {
   $workflows = array();
-  
+
   $workflows['public'] = array(
     'label' => t('Publicly accessible'),
   );
@@ -144,15 +145,15 @@ function hook_environment_workflow() {
   $workflows['review'] = array(
     'label' => t('Administrative review'),
   );
-  
+
   return $workflows;
 }
 
 /**
  * Alter the workflows as defined.
  *
- * @param $workflows
- *  Array of defined workflows.
+ * @param array $workflows
+ *   Array of defined workflows.
  */
 function hook_environment_workflow_alter(&$workflows) {
   $workflows['public']['label'] = t('Publicly visible status');
diff --git a/environment.drush.inc b/environment.drush.inc
index c80a572..430049f 100644
--- a/environment.drush.inc
+++ b/environment.drush.inc
@@ -1,11 +1,11 @@
 <?php
-
 /**
- * @file Executes the environment_switch capabilities
+ * @file
+ * Executes the environment_switch capabilities.
  */
 
 /**
- * Implementation of hook_drush_command().
+ * Implements hook_drush_command().
  */
 function environment_drush_command() {
   $items = array();
@@ -41,23 +41,26 @@ function environment_drush_command() {
 }
 
 /**
- * Implementation of hook_drush_help().
+ * Implements hook_drush_help().
  */
 function environment_drush_help($section) {
   switch ($section) {
     case 'meta:environment:title':
       return dt('Environment commands');
+
     case 'meta:environment:summary':
       return dt('Review and control the site environment.');
+
     case 'drush:environment':
       return dt("Shows the current environment.");
+
     case 'drush:environment-switch':
       return dt("Switches the environment to the target environment.");
   }
 }
 
 /**
- * Implementation of drush_hook_COMMAND for environment.
+ * Implements drush_hook_COMMAND for environment.
  */
 function drush_environment_show($workflow = NULL) {
   $func = drush_get_context('DRUSH_PIPE') ? 'drush_print_pipe' : 'drush_print_table';
@@ -65,7 +68,7 @@ function drush_environment_show($workflow = NULL) {
 }
 
 /**
- * Implementation of drush_hook_COMMAND_validate() for environment_switch.
+ * Implements drush_hook_COMMAND_validate() for environment_switch.
  */
 function drush_environment_switch_validate($target_env = NULL) {
   $environments = environment_load();
@@ -75,7 +78,7 @@ function drush_environment_switch_validate($target_env = NULL) {
 }
 
 /**
- * Implementation of drush_hook_COMMAND for environment_switch.
+ * Implements drush_hook_COMMAND for environment_switch.
  */
 function drush_environment_switch($target_env = NULL) {
   if ($target_env && !array_key_exists($target_env, environment_load())) {
@@ -116,12 +119,12 @@ function drush_environment_switch($target_env = NULL) {
 /**
  * Render all current environment states with full description.
  *
- * @param $workflow
- *  Optional; specify a single workflow whose environment to check. Otherwise
- *  show all states.
+ * @param string $workflow
+ *   Optional; specify a single workflow whose environment to check. Otherwise
+ *   show all states.
  *
- * @return
- *  Array of strings describing the environment(s).
+ * @return array
+ *   Array of strings describing the environment(s).
  */
 function environment_drush_render_current($workflow = NULL) {
   $environments = (array) variable_get('environment', array());
@@ -137,7 +140,9 @@ function environment_drush_render_current($workflow = NULL) {
     foreach ($states as $state) {
       if (is_null($workflow) || $state['workflow'] == $workflow) {
         if (!drush_get_context('DRUSH_PIPE')) {
-          $items[] = array(environment_drush_render_environment($state, is_null($workflow), TRUE));
+          $items[] = array(
+            environment_drush_render_environment($state, is_null($workflow), TRUE),
+          );
         }
         else {
           $items[] = $state['name'];
@@ -146,26 +151,25 @@ function environment_drush_render_current($workflow = NULL) {
     }
   }
 
-
   return $items;
 }
 
 /**
  * Render the specified environment definition as a descriptive one-liner.
  *
- * @param $state
- *  Array defining an environment state.
- * @param $show_workflow
- *  Optional; default to TRUE. If there are more than one workflows defined in
- *  the system, will prefix the return with the workflow's label. If set to FALSE
- *  this is skipped. This is separate from $verbose because you could want a
- *  verbose description in a workflow-specific context.
- * @param $verbose
- *  Optional; defaults to FALSE. If TRUE, will include the environment
- *  description.
+ * @param array $state
+ *   Array defining an environment state.
+ * @param bool $show_workflow
+ *   Optional; default to TRUE. If there are more than one workflows defined in
+ *   the system, will prefix the return with the workflow's label. If set to
+ *   FALSE this is skipped. This is separate from $verbose because you could
+ *   want a verbose description in a workflow-specific context.
+ * @param bool $verbose
+ *   Optional; defaults to FALSE. If TRUE, will include the environment
+ *   description.
  *
- * @return
- *  String describing the specified environment.
+ * @return string
+ *   String describing the specified environment.
  */
 function environment_drush_render_environment($state, $show_workflow = TRUE, $verbose = FALSE) {
   $description = $verbose && isset($state['description']) ? ': ' . $state['description'] : '';
diff --git a/environment.install b/environment.install
index 2bac1be..f053617 100644
--- a/environment.install
+++ b/environment.install
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_install().
+ * Implements hook_install().
  */
 function environment_install() {
   // New module weights in core: put environment as the very last in the chain.
@@ -14,7 +14,7 @@ function environment_install() {
 }
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function environment_uninstall() {
   variable_del('environment');
@@ -22,7 +22,7 @@ function environment_uninstall() {
 }
 
 /**
- * Implementation of hook_requirements().
+ * Implements hook_requirements().
  */
 function environment_requirements($phase) {
   $requirements = array();
diff --git a/environment.module b/environment.module
index cd3164e..99e5ca0 100644
--- a/environment.module
+++ b/environment.module
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function environment_menu() {
   $items = array();
@@ -35,7 +35,7 @@ function environment_menu() {
 }
 
 /**
- * Implementation of hook_environment().
+ * Implements hook_environment().
  */
 function environment_environment() {
   return array(
@@ -55,13 +55,13 @@ function environment_environment() {
 }
 
 /**
- * Implementation of hook_environment_workflow().
+ * Implements hook_environment_workflow().
  */
 function environment_environment_workflow() {
   return array(
     'default' => array(
       'label' => t('Default'),
-      'description' => t(''),
+      'description' => '',
     ),
   );
 }
@@ -69,16 +69,18 @@ function environment_environment_workflow() {
 /**
  * Check if something is allowed in the current environment.
  *
- * @param $name
+ * @param string $name
  *   Name of the thing to check if allowed, eg. function.
- * @param $category
- *   Optional; category of the thing to check for, eg. name of module. Defaults to 'other'.
- * @param $default
- *   Optional; what the default should be if no environment value is found. Defaults to FALSE.
- * @param $workflow
+ * @param string $category
+ *   Optional; category of the thing to check for, eg. name of module.
+ *   Defaults to 'other'.
+ * @param bool $default
+ *   Optional; what the default should be if no environment value is found.
+ *   Defaults to FALSE.
+ * @param string $workflow
  *   Optional; specify the workflow state to check for allowance.
  *
- * @return
+ * @return bool
  *   TRUE or FALSE for whether the thing is allowed.
  */
 function environment_allowed($name, $category = 'other', $default = FALSE, $workflow = 'default') {
@@ -106,13 +108,14 @@ function environment_allowed($name, $category = 'other', $default = FALSE, $work
 /**
  * Switches between two environments.
  *
- * @param String $target_env
+ * @param string $target_env
  *   Name of the environment to change to.
- * @param Boolean $force
- *   (optional) Whether to trigger a change even if the environment is the currently set one. Defaults to FALSE.
+ * @param bool $force
+ *   (optional) Whether to trigger a change even if the environment is the
+ *   currently set one. Defaults to FALSE.
  *
- * @return
- *   Return messages telling what has happened.
+ * @return bool
+ *   Return TRUE if successful.
  */
 function environment_switch($target_env, $force = FALSE, $clear_cache = TRUE) {
   $result = FALSE;
@@ -127,8 +130,8 @@ function environment_switch($target_env, $force = FALSE, $clear_cache = TRUE) {
     drupal_set_message(t("The current environment is already set to '!environment'.",
                          array('!environment' => $target_env)), 'notice');
 
-   $result = TRUE;
-    // Since this option is only available in drush, only display it to drush users.
+    $result = TRUE;
+    // This option is only available in drush.
     if (function_exists('drush_print')) {
       drush_print("To force the environment switch to run anyway, use the '--force' flag.");
     }
@@ -136,7 +139,7 @@ function environment_switch($target_env, $force = FALSE, $clear_cache = TRUE) {
   if (!$force && !empty($override)) {
     drupal_set_message(t("The current environment is overriden with '!override'.",
                          array('!override' => $override)), 'error');
-    // Since this option is only available in drush, only display it to drush users.
+    // This option is only available in drush.
     if (function_exists('drush_print')) {
       drush_print("To force the environment switch to run anyway, use the '--force' flag.");
     }
@@ -164,16 +167,16 @@ function environment_switch($target_env, $force = FALSE, $clear_cache = TRUE) {
 /**
  * Gets the current environment.
  *
- * @param $workflow
- *  (default: default) Specify an environment workflow to check. If NULL, will
- *  return the current environment state for each workflow. Default workflow
- *  will check environment states not assigned an explicit workflow, this
- *  maintains backwards compatibility.
- * @param $default
- *  Optional; defaults to NULL. Specify the default value if the current
- *  environment cannot be identified.
- * @param $load
- *  (default: FALSE) If TRUE, loads the full environment definition.
+ * @param string $workflow
+ *   (default: default) Specify an environment workflow to check. If NULL, will
+ *   return the current environment state for each workflow. Default workflow
+ *   will check environment states not assigned an explicit workflow, this
+ *   maintains backwards compatibility.
+ * @param string $default
+ *   Optional; defaults to NULL. Specify the default value if the current
+ *   environment cannot be identified.
+ * @param bool $load
+ *   (default: FALSE) If TRUE, loads the full environment definition.
  */
 function environment_current($workflow = 'default', $default = NULL, $load = FALSE) {
   $current = variable_get('environment', array());
@@ -185,7 +188,7 @@ function environment_current($workflow = 'default', $default = NULL, $load = FAL
     $current = empty($current) ? $default : $current;
     return $load ? environment_load($current) : $current;
   }
-  elseif(isset($current[$workflow])) {
+  elseif (isset($current[$workflow])) {
     $current[$workflow] = empty($current[$workflow]) ? $default : $current[$workflow];
     return $load ? environment_load($current[$workflow]) : $current[$workflow];
   }
@@ -196,8 +199,8 @@ function environment_current($workflow = 'default', $default = NULL, $load = FAL
 /**
  * Save the new environment to it's assigned workflow.
  *
- * @param $new_env
- *  Machine name of the new system environment. If environment has a workflow
+ * @param string $new_env
+ *   Machine name of the new system environment. If environment has a workflow.
  */
 function environment_set($new_env) {
   $environment = variable_get('environment', array());
@@ -215,13 +218,13 @@ function environment_set($new_env) {
 /**
  * Fetches all available environments.
  *
- * @param $env
+ * @param string $env
  *   (optional) Name of the environment. If NULL, will return all environments.
  *   If an array, will return all environments specified in the array.
- * @param $reset
+ * @param bool $reset
  *   (default: FALSE) Reset the static cache and collect new data.
  *
- * @return
+ * @return array
  *   Return all environments or the specified environment.
  */
 function environment_load($env = NULL, $reset = FALSE) {
@@ -253,13 +256,14 @@ function environment_load($env = NULL, $reset = FALSE) {
 /**
  * Get the current assortment of Workflows.
  *
- * @param $name
- *  Name of the workflow to retrieve information on.
- *  Use 'default' to specify default or NULL workflow.
- * @param $reset
- *  Optional; reset the static cache.
+ * @param string $name
+ *   Name of the workflow to retrieve information on.
+ *   Use 'default' to specify default or NULL workflow.
+ * @param bool $reset
+ *   Optional; reset the static cache.
  *
- * @return Array
+ * @return array
+ *   Workflows.
  */
 function environment_load_workflow($name = NULL, $reset = FALSE) {
   static $workflows;
@@ -272,22 +276,20 @@ function environment_load_workflow($name = NULL, $reset = FALSE) {
   return isset($name) ? $workflows[$name] : $workflows;
 }
 
-
-
 /**
  * Provides environment form options.
  *
- * @param $workflow
- *  Optional; specify the workflow for specific options. Defaults to states
- *  that are not part of an explicit workflow.
- * @param $prefix
- *  Optional; prefix the environment label with the specified string. Defaults
- *  to no prefix.
- * @param $reset
- *  Optional; reset the static cache.
+ * @param string $workflow
+ *   Optional; specify the workflow for specific options. Defaults to states
+ *   that are not part of an explicit workflow.
+ * @param string $prefix
+ *   Optional; prefix the environment label with the specified string. Defaults
+ *   to no prefix.
+ * @param bool $reset
+ *   Optional; reset the static cache.
  *
- * @return
- *  Array of form options in the style of environment => label
+ * @return array
+ *   Array of form options in the style of environment => label
  */
 function _environment_state_options($workflow = 'default', $prefix = '', $reset = FALSE) {
   static $options;
@@ -309,8 +311,11 @@ function _environment_state_options($workflow = 'default', $prefix = '', $reset
  * If the same environment needs to come up in multiple places, that should be
  * handled by duplicating the definition and changing the machine name.
  *
- * @param $reset
- *  Optional; reset the static cache.
+ * @param bool $reset
+ *   Optional; reset the static cache.
+ *
+ * @return array
+ *   Options widget.
  *
  * @see hook_environment
  */
@@ -328,7 +333,7 @@ function _environment_state_options_all($reset = FALSE) {
 }
 
 /**
- * Implementation of hook_token_list().
+ * Implements hook_token_list().
  */
 function environment_token_list($type = 'all') {
   $tokens = array();
@@ -342,7 +347,7 @@ function environment_token_list($type = 'all') {
 }
 
 /**
- * Implementation of hook_token_values().
+ * Implements hook_token_values().
  */
 function environment_token_values($type, $object = NULL, $options = array()) {
   $values = array();
diff --git a/modules/environment_context/environment_context.info b/modules/environment_context/environment_context.info
index dbfedaa..33e4a04 100644
--- a/modules/environment_context/environment_context.info
+++ b/modules/environment_context/environment_context.info
@@ -3,4 +3,3 @@ description = "Use environment setting within context"
 core = "7.x"
 dependencies[] = "environment"
 dependencies[] = "context"
-
diff --git a/modules/environment_context/environment_context.module b/modules/environment_context/environment_context.module
index 3aa618e..791c458 100644
--- a/modules/environment_context/environment_context.module
+++ b/modules/environment_context/environment_context.module
@@ -1,22 +1,22 @@
 <?php
 /**
  * @file
- *  Describe context plugins for Environment Context module.
+ * Describe context plugins for Environment Context module.
  */
 
 /**
- * Implementation of hook_init().
+ * Implements hook_init().
  */
 function environment_context_init() {
   // Trigger environment context condition.
   if (module_exists('context') && function_exists('context_get_plugin')
       && $plugin = context_get_plugin('condition', 'environment')) {
-    $plugin->execute((array)variable_get('environment', array()));
+    $plugin->execute((array) variable_get('environment', array()));
   }
 }
 
 /**
- * Implementation of hook_ctools_plugin_api().
+ * Implements hook_ctools_plugin_api().
  */
 function environment_context_ctools_plugin_api($module, $api) {
   if ($module == 'context' && $api == 'plugins') {
@@ -25,7 +25,7 @@ function environment_context_ctools_plugin_api($module, $api) {
 }
 
 /**
- * Implementation of hook_context_registry().
+ * Implements hook_context_registry().
  */
 function environment_context_context_registry() {
   $registry = array();
@@ -40,13 +40,13 @@ function environment_context_context_registry() {
 }
 
 /**
- * Implementation of hook_context_plugins().
+ * Implements hook_context_plugins().
  */
 function environment_context_context_plugins() {
- $plugins = array();
+  $plugins = array();
   $plugins['environment_context_condition'] = array(
     'handler' => array(
-      'path' => drupal_get_path('module', 'environment_context') .'/plugins',
+      'path' => drupal_get_path('module', 'environment_context') . '/plugins',
       'file' => 'environment_context_condition.inc',
       'class' => 'environment_context_condition',
       'parent' => 'context_condition',
diff --git a/modules/environment_context/plugins/environment_context_condition.inc b/modules/environment_context/plugins/environment_context_condition.inc
index bfc936e..218c1b0 100644
--- a/modules/environment_context/plugins/environment_context_condition.inc
+++ b/modules/environment_context/plugins/environment_context_condition.inc
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * Defines a context condition for the current environment state.
+ */
 
 /**
  * Defines a context condition for the current environment state.
@@ -18,10 +22,10 @@ class environment_context_condition extends context_condition {
     if ($this->condition_used()) {
       // Workflow should be a unique key, $env is unique but not it's title.
       foreach ($environment as $workflow => $env) {
-        foreach($this->get_contexts($env) as $context) {
+        foreach ($this->get_contexts($env) as $context) {
           $this->condition_met($context, $env);
         }
-        foreach($this->get_contexts($workflow) as $context) {
+        foreach ($this->get_contexts($workflow) as $context) {
           $this->condition_met($context, $workflow);
         }
       }
diff --git a/modules/environment_force/environment_force.module b/modules/environment_force/environment_force.module
index c2df2b7..4bd12cd 100644
--- a/modules/environment_force/environment_force.module
+++ b/modules/environment_force/environment_force.module
@@ -1,12 +1,12 @@
 <?php
-
 /**
  * @file
- *  The Environment Force module resets the site environment to the one set in settings.php.
+ * The Environment Force module resets the site environment to the one
+ * set in settings.php.
  */
 
 /**
- * Implementation of hook_init().
+ * Implements hook_init().
  */
 function environment_force_init() {
   $env_override = variable_get('environment_override', NULL);
diff --git a/modules/environment_readonly/environment_readonly.admin.inc b/modules/environment_readonly/environment_readonly.admin.inc
index da8cb62..8e47aa8 100644
--- a/modules/environment_readonly/environment_readonly.admin.inc
+++ b/modules/environment_readonly/environment_readonly.admin.inc
@@ -1,13 +1,20 @@
 <?php
 
 /**
- * @file Settings for Environment Read Only module
+ * @file
+ * Settings for Environment Read Only module
  */
 
+/**
+ * Admin settings form.
+ *
+ * @return array
+ *   Form.
+ */
 function environment_readonly_admin_settings() {
   $form = array();
 
-  // Build the role selection section
+  // Build the role selection section.
   $roles = user_roles();
   $role_default_value = _environment_readonly_get_configured_roles();
   $form['roles'] = array(
@@ -24,7 +31,7 @@ function environment_readonly_admin_settings() {
     '#default_value' => $role_default_value,
   );
 
-  // Build the permission selection section
+  // Build the permission selection section.
   $perms = _environment_readonly_get_perms();
   $perms_default_value = _environment_readonly_get_action_perms();
   $form['perms'] = array(
diff --git a/modules/environment_readonly/environment_readonly.context.inc b/modules/environment_readonly/environment_readonly.context.inc
index 7322827..c9cc704 100644
--- a/modules/environment_readonly/environment_readonly.context.inc
+++ b/modules/environment_readonly/environment_readonly.context.inc
@@ -1,15 +1,16 @@
 <?php
 /**
- * @file Context for environment readonly
+ * @file
+ * Context for environment readonly
  */
 
 /**
- * Implementation of hook_context_default_contexts().
+ * Implements hook_context_default_contexts().
  */
 function environment_readonly_context_default_contexts() {
   $export = array();
 
-  $context = new stdClass;
+  $context = new stdClass();
   $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
   $context->api_version = 3;
   $context->name = 'environment_readonly_alert';
@@ -47,6 +48,5 @@ function environment_readonly_context_default_contexts() {
   t('Environment');
   $export['environment_readonly_alert'] = $context;
 
-
   return $export;
 }
diff --git a/modules/environment_readonly/environment_readonly.css b/modules/environment_readonly/environment_readonly.css
index 0ba8ffa..68328ac 100644
--- a/modules/environment_readonly/environment_readonly.css
+++ b/modules/environment_readonly/environment_readonly.css
@@ -1,6 +1,6 @@
-
 /**
- * @file Basic styles for the environment module
+ * @file
+ * Basic styles for the environment module
  */
 
 #block-environment-readonly-environment-readonly-alert {
diff --git a/modules/environment_readonly/environment_readonly.module b/modules/environment_readonly/environment_readonly.module
index c812f95..95dc5f5 100644
--- a/modules/environment_readonly/environment_readonly.module
+++ b/modules/environment_readonly/environment_readonly.module
@@ -1,11 +1,12 @@
 <?php
 
 /**
- * @file Code for the Environment Readonly module.
+ * @file
+ * Code for the Environment Readonly module.
  */
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function environment_readonly_menu() {
   $items = array();
@@ -22,10 +23,10 @@ function environment_readonly_menu() {
 }
 
 /**
- * Implementation of hook_block_info().
+ * Implements hook_block_info().
  */
 function environment_readonly_block_info() {
-  // Block that informs the site is in read only mode
+  // Block that informs the site is in read only mode.
   $blocks['environment_readonly_alert'] = array(
     'info' => t('Read Only Environment Alert'),
     'cache' => DRUPAL_CACHE_GLOBAL,
@@ -34,11 +35,11 @@ function environment_readonly_block_info() {
 }
 
 /**
- * Implementation of hook_block_view().
+ * Implements hook_block_view().
  */
 function environment_readonly_block_view($delta = '') {
   switch ($delta) {
-    // Block that informs the site is in read only mode
+    // Block that informs the site is in read only mode.
     case 'environment_readonly_alert':
       $block['subject'] = 'The site is currently in Read Only mode';
       $block['content'] = 'The site is undergoing maintenance and is in Read
@@ -50,7 +51,7 @@ function environment_readonly_block_view($delta = '') {
 }
 
 /**
- * Implementation of hook_ctools_plugin_api().
+ * Implements hook_ctools_plugin_api().
  */
 function environment_readonly_ctools_plugin_api() {
   list($module, $api) = func_get_args();
@@ -60,16 +61,16 @@ function environment_readonly_ctools_plugin_api() {
 }
 
 /**
- * Implementation of hook_environment_switch().
+ * Implements hook_environment_switch().
  */
 function environment_readonly_environment_switch($target_env, $current_env, $workflow = NULL) {
-  // Update permissions
+  // Update permissions.
   _environment_readonly_update_permissions();
   drupal_set_message('Updated permissions.');
 }
 
 /**
- * Implementation of hook_environment().
+ * Implements hook_environment().
  */
 function environment_readonly_environment() {
   $environments = array();
@@ -86,16 +87,16 @@ function environment_readonly_environment() {
 }
 
 /**
- * Implementation of hook_user_default_permissions_alter().
+ * Implements hook_user_default_permissions_alter().
  */
 function environment_readonly_user_default_permissions_alter(&$permissions) {
   $env = environment_current();
   if ($env == 'readonly') {
-    // Remove all configured roles from action permissions
+    // Remove all configured roles from action permissions.
     $role_config = _environment_readonly_get_configured_roles(TRUE);
     $action_perms = _environment_readonly_get_action_perms();
     foreach ($permissions as $perm => $data) {
-      // Remove action perms when in readonly mode
+      // Remove action perms when in readonly mode.
       if (in_array($perm, $action_perms)) {
         foreach ($data['roles'] as $key => $role_name) {
           if (in_array($role_name, $role_config)) {
@@ -107,6 +108,15 @@ function environment_readonly_user_default_permissions_alter(&$permissions) {
   }
 }
 
+/**
+ * Get configured roles.
+ *
+ * @param bool $names
+ *   Return configured names.
+ *
+ * @return array
+ *   Return readonly roles.
+ */
 function _environment_readonly_get_configured_roles($names = FALSE) {
   $role_config = variable_get('environment_readonly_roles', NULL);
   $user_roles = user_roles();
@@ -135,6 +145,12 @@ function _environment_readonly_get_configured_roles($names = FALSE) {
   }
 }
 
+/**
+ * Get permissions.
+ *
+ * @return array
+ *   Permissions.
+ */
 function _environment_readonly_get_perms() {
   $modules = array();
   foreach (module_implements('permission') as $module) {
@@ -151,10 +167,16 @@ function _environment_readonly_get_perms() {
   return $permissions;
 }
 
+/**
+ * Get action permissions.
+ *
+ * @return array
+ *   Return permissions.
+ */
 function _environment_readonly_get_action_perms() {
   $settings = variable_get('environment_readonly_permissions', NULL);
 
-  // If there are no settings set, then we'll have to figure out the defaults
+  // If there are no settings set, then we'll have to figure out the defaults.
   if ($settings == NULL) {
     $edit_text = array(
       'administer',
@@ -175,15 +197,15 @@ function _environment_readonly_get_action_perms() {
       $settings[$perm] = 0;
       $selected = FALSE;
       foreach ($edit_text as $text) {
-        // Checking with spaces before and after to minimize within-words checks
-        if (strpos($perm, ' '. $text) !== FALSE || strpos($perm, $text .' ') !== FALSE) {
+        // Checking spaces before and after to minimize within-words checks.
+        if (strpos($perm, ' ' . $text) !== FALSE || strpos($perm, $text . ' ') !== FALSE) {
           $settings[$perm] = $perm;
         }
       }
     }
   }
 
-  // Remove all the unset permissions
+  // Remove all the unset permissions.
   foreach ($settings as $perm => $value) {
     if (empty($value)) {
       unset($settings[$perm]);
@@ -194,14 +216,14 @@ function _environment_readonly_get_action_perms() {
 }
 
 /**
- * Update all permission configuration
+ * Update all permission configuration.
  */
 function _environment_readonly_update_permissions() {
   $revert = array();
   features_include();
   features_include_defaults('user_permission');
   module_load_include('inc', 'features', 'features.export');
-  // Clear cache just in case
+  // Clear cache just in case.
   features_get_default('user_permission', NULL, TRUE, TRUE);
   $modules = module_implements('user_default_permissions');
   foreach ($modules as $module) {
