Skip to content

Commit 6788494

Browse files
committed
Minor - format code
1 parent adde7f5 commit 6788494

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

main/cron/archive_table_records.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
$sql = "INSERT INTO $tableArchive SELECT * FROM $table WHERE $pk >= $min AND $pk < $max";
6464
file_put_contents(
6565
$logFile,
66-
"Moving rows $min to ".($max-1)." to $tableArchive. Starting at ".date('Y-m-d H:i:s')."\n",
66+
"Moving rows $min to ".($max - 1)." to $tableArchive. Starting at ".date('Y-m-d H:i:s')."\n",
6767
FILE_APPEND
6868
);
6969
$res = Database::query($sql);
@@ -112,13 +112,14 @@
112112
);
113113

114114
/**
115-
* Returns the name of the primary key column for the given table
115+
* Returns the name of the primary key column for the given table.
116116
*
117117
* @param string $table The name of the table
118118
*
119119
* @return string The column name of the primary key
120120
*/
121-
function getPKFromTable($table) {
121+
function getPKFromTable($table)
122+
{
122123
$sql = "SELECT k.column_name
123124
FROM information_schema.table_constraints t
124125
JOIN information_schema.key_column_usage k
@@ -129,20 +130,23 @@ function getPKFromTable($table) {
129130
$res = Database::query($sql);
130131
if (Database::num_rows($res) > 0) {
131132
$row = Database::fetch_assoc($res);
133+
132134
return $row['column_name'];
133135
}
136+
134137
return '';
135138
}
136139

137140
/**
138-
* Check a table exists and create it if it doesn't
141+
* Check a table exists and create it if it doesn't.
139142
*
140-
* @param string $table The table to check/create
143+
* @param string $table The table to check/create
141144
* @param string $templateTable The model from which this table should be created
142145
*
143146
* @return bool True if it exists *or* it could be created, false if there was an error at create time
144147
*/
145-
function checkAndCreateTable($table, $templateTable) {
148+
function checkAndCreateTable($table, $templateTable)
149+
{
146150
$sqlCheck = "SHOW TABLES LIKE '$table'";
147151
$res = Database::query($sqlCheck);
148152
if (Database::num_rows($res) > 0) {
@@ -151,6 +155,7 @@ function checkAndCreateTable($table, $templateTable) {
151155
} else {
152156
$sqlCreate = "CREATE TABLE $table like $templateTable";
153157
$res = Database::query($sqlCreate);
158+
154159
return $res;
155160
}
156161
}

main/exercise/hotspot.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,11 @@ public function processAnswersCreation($form, $exercise)
105105
}
106106

107107
/**
108-
* @inheritDoc
108+
* {@inheritdoc}
109109
*/
110110
public function return_header(Exercise $exercise, $counter = null, $score = [])
111111
{
112112
return parent::return_header($exercise, $counter, $score)
113113
.'<table><tr><td><table class="table">';
114114
}
115-
116115
}

main/exercise/hotspot_actionscript.as.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
$course_id,
129129
api_get_user_id(),
130130
'incomplete',
131-
]
131+
],
132132
],
133133
'order' => 'exe_id DESC',
134134
'limit' => 1,

main/install/install.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,7 @@ function display_configuration_parameter(
16981698
[
16991699
'class' => 'form-control',
17001700
'size' => FORM_FIELD_DISPLAY_LENGTH,
1701-
'maxlength' => MAX_FORM_FIELD_LENGTH
1701+
'maxlength' => MAX_FORM_FIELD_LENGTH,
17021702
]
17031703
)
17041704
.$eyeForPassword."</div>";

plugin/mindmap/uninstall.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
2+
23
/* For license terms, see /license.txt */
4+
35
require_once 'mindmap_plugin.class.php';
4-
if(!api_is_platform_admin()){
6+
if (!api_is_platform_admin()) {
57
die('You must have admin permissions to install plugins');
68
}
79
MindmapPlugin::create()->uninstall();

0 commit comments

Comments
 (0)