Skip to content
Snippets Groups Projects
Commit cd0d4fd6 authored by Niels de Feyter's avatar Niels de Feyter
Browse files

Improved PHP Doc comments.

parent 7e670726
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,13 @@ function unused_modules_menu() {
/**
* Page callback.
*
* Returns a table with projects with their (submodule) status.
* Returns a table with orphaned projects.
*
* @param string $op
* Either 'all' or 'disabled'.
*
* @return string
* themed table.
*/
function unused_modules_show_projects($op = 'all') {
$modules = _unused_modules_get_modules_by_project();
......@@ -110,9 +116,15 @@ function unused_modules_show_projects($op = 'all') {
/**
* Page callback.
*
* Returns a table with modules with their (submodule & project) status.
* Returns a table with orphaned modules.
*
* @param string $op
* Either 'all' or 'disabled'.
*
* @return string
* themed table.
*/
function unused_modules_show_modules($op) {
function unused_modules_show_modules($op = 'all') {
$modules = _unused_modules_get_modules_by_project();
$header = array(
......@@ -157,7 +169,7 @@ function unused_modules_show_modules($op) {
/**
* Returns an array with all available modules.
*
* object module
* Object module
* ->uri
* ->filename
* ->name
......@@ -301,7 +313,7 @@ function _unused_modules_add_project_path(&$modules) {
// Get length of each module path in a project.
$lengths = array_map('strlen', $project_paths);
// Sort by value (lowest number first)
// Sort by value (lowest number first).
asort($lengths);
// Get lowest key.
reset($lengths);
......@@ -359,8 +371,8 @@ function _unused_modules_add_info_file_information(&$modules) {
$module->info_file = substr_replace($module->uri, ".info", -7);
if (!file_exists($module->info_file)) {
$errorMessage = "No .info file found for module '" . $module->name . "'";
throw new Exception($errorMessage);
$error_message = "No .info file found for module '" . $module->name . "'";
throw new Exception($error_message);
}
$info_file = explode(PHP_EOL, file_get_contents($module->info_file));
......@@ -378,8 +390,8 @@ function _unused_modules_add_info_file_information(&$modules) {
// Throw error if no project information is found.
// This should only be the case for sandbox modules.
if (!isset($module->project)) {
$errorMessage = "No project information found for module '" . $module->name . "'";
throw new Exception($errorMessage);
$error_message = "No project information found for module '" . $module->name . "'";
throw new Exception($error_message);
}
}
catch (Exception $e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment