Skip to content

Commit

Permalink
Fixed some coding style issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Dec 27, 2019
1 parent 4ab0767 commit b175754
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ script:
- moodle-plugin-ci phplint
- moodle-plugin-ci phpcpd || true
- moodle-plugin-ci phpmd
- moodle-plugin-ci codechecker || true
- moodle-plugin-ci codechecker
- moodle-plugin-ci validate
- moodle-plugin-ci savepoints
- moodle-plugin-ci mustache
- moodle-plugin-ci grunt || true
- moodle-plugin-ci phpdoc || true
- moodle-plugin-ci phpdoc
- moodle-plugin-ci phpunit
- moodle-plugin-ci behat --dump
2 changes: 1 addition & 1 deletion classes/external/handlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static function get_handlers_returns() {
* @throws \invalid_parameter_exception
*/
public static function get_handlers($userid, $learninggoalid) {
$params = self::validate_parameters(self::get_handlers_parameters(),
self::validate_parameters(self::get_handlers_parameters(),
array(
'userid' => $userid,
'learninggoalid' => $learninggoalid
Expand Down
34 changes: 17 additions & 17 deletions classes/external/learninggoal.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ public static function get_learninggoal($userid, $learninggoalid) {
* @param int $userid
* @param int $learninggoalid
* @param string $name
* @param string $pre_thinking_skill
* @param string $thinking_skill
* @param string $prethinkingskill
* @param string $thinkingskill
* @param string $content
* @param string $subject
* @param string $pre_resource
* @param string $preresource
* @param string $resource
* @param string $pre_product
* @param string $preproduct
* @param string $product
* @param string $pre_group
* @param string $pregroup
* @param string $group
*
* @return stdClass
Expand All @@ -255,23 +255,23 @@ public static function get_learninggoal($userid, $learninggoalid) {
* @throws moodle_exception
* @throws restricted_context_exception
*/
public static function save_learninggoal($userid, $learninggoalid, $name, $pre_thinking_skill, $thinking_skill, $content,
$subject, $pre_resource, $resource, $pre_product, $product, $pre_group, $group) {
public static function save_learninggoal($userid, $learninggoalid, $name, $prethinkingskill, $thinkingskill, $content,
$subject, $preresource, $resource, $preproduct, $product, $pregroup, $group) {
global $USER;

$params = [
'userid' => $userid,
'learninggoalid' => $learninggoalid,
'name' => $name,
'pre_thinking_skill' => $pre_thinking_skill,
'thinking_skill' => $thinking_skill,
'pre_thinking_skill' => $prethinkingskill,
'thinking_skill' => $thinkingskill,
'content' => $content,
'subject' => $subject,
'pre_resource' => $pre_resource,
'pre_resource' => $preresource,
'resource' => $resource,
'pre_product' => $pre_product,
'pre_product' => $preproduct,
'product' => $product,
'pre_group' => $pre_group,
'pre_group' => $pregroup,
'group' => $group
];
self::validate_parameters(self::save_learninggoal_parameters(), $params);
Expand All @@ -288,15 +288,15 @@ public static function save_learninggoal($userid, $learninggoalid, $name, $pre_t
$learninggoal->id = $learninggoalid;
$learninggoal->userid = $USER->id;
$learninggoal->title = $name;
$learninggoal->pre_thinking_skill = $pre_thinking_skill;
$learninggoal->thinking_skill = $thinking_skill;
$learninggoal->pre_thinking_skill = $prethinkingskill;
$learninggoal->thinking_skill = $thinkingskill;
$learninggoal->lgcontent = $content;
$learninggoal->subject = $subject;
$learninggoal->pre_resource = $pre_resource;
$learninggoal->pre_resource = $preresource;
$learninggoal->resource = $resource;
$learninggoal->pre_product = $pre_product;
$learninggoal->pre_product = $preproduct;
$learninggoal->product = $product;
$learninggoal->pre_group = $pre_group;
$learninggoal->pre_group = $pregroup;
$learninggoal->lggroup = $group;

if ($learninggoal->id != 0) {
Expand Down
3 changes: 1 addition & 2 deletions classes/form/form_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ abstract protected function check_capability();
* @return form_controller
* @throws \moodle_exception
*/
static public function get_controller(string $formname, differentiator $differentiator, array $formdata, \stdClass $moreargs)
: form_controller {
static public function get_controller(string $formname, differentiator $differentiator, array $formdata, \stdClass $moreargs) {

switch ($formname) {
case 'learninggoal_edit':
Expand Down
23 changes: 0 additions & 23 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,6 @@ function differentiator_update_instance($differentiator) {
return $ret;
}

// **
// * Removes a differentiator instance from the database.
// *
// * Given an ID of an instance of this module,
// * this function will permanently delete the instance
// * and any data that depends on it.
// *
// * @param int $id ID of the module instance.
// * @return boolean Success/Failure
// */
// function differentiator_delete_instance($id) {
// global $DB;
//
// // Check if an instance with this id exists.
// if (!$differentiatorinstance = $DB->get_record('differentiator', array('id' => $id))) {
// return false;
// }
//
// $DB->delete_records('differentiator', ['id' => $id]);
// $DB->delete_records('local_differentiator_lg', ['differentiatorid' => $id]);
// return true;
// }

/**
* List of features supported in differentiator.
*
Expand Down

0 comments on commit b175754

Please sign in to comment.