Skip to content

Commit

Permalink
MDL-53451 competency: Properly wrap those nasty function declarations
Browse files Browse the repository at this point in the history
Pheww, we avoided a disaster.
  • Loading branch information
Frederic Massart committed Apr 19, 2016
1 parent d580b62 commit 69c4786
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 33 deletions.
2 changes: 1 addition & 1 deletion admin/tool/lp/classes/form/persistent.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ abstract class persistent extends moodleform {
* @param bool $editable
*/
public function __construct($action = null, $customdata = null, $method = 'post', $target = '',
$attributes = null, $editable = true) {
$attributes = null, $editable = true) {
if (empty(static::$persistentclass)) {
throw new coding_exception('Static property $persistentclass must be set.');
} else if (!is_subclass_of(static::$persistentclass, 'core_competency\\persistent')) {
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/lp/classes/page_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static function setup_for_course(moodle_url $url, $course, $subtitle = ''
* - Return URL
*/
public static function setup_for_template($pagecontextid, moodle_url $url, $template = null, $subtitle = '',
$returntype = null) {
$returntype = null) {
global $PAGE, $SITE;

$pagecontext = context::instance_by_id($pagecontextid);
Expand Down
39 changes: 10 additions & 29 deletions competency/classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public static function competency_viewed($competencyorid) {
* @return array of competency_framework
*/
public static function list_frameworks($sort, $order, $skip, $limit, $context, $includes = 'children',
$onlyvisible = false, $query = '') {
$onlyvisible = false, $query = '') {
global $DB;
static::require_enabled();

Expand Down Expand Up @@ -4098,13 +4098,8 @@ protected static function remove_archived_user_competencies_in_plan($plan) {
* @return \core_competency\evidence[]
* @return array of \core_competency\evidence
*/
public static function list_evidence($userid = 0,
$competencyid = 0,
$planid = 0,
$sort = 'timecreated',
$order = 'DESC',
$skip = 0,
$limit = 0) {
public static function list_evidence($userid = 0, $competencyid = 0, $planid = 0, $sort = 'timecreated',
$order = 'DESC', $skip = 0, $limit = 0) {
static::require_enabled();

if (!user_competency::can_read_user($userid)) {
Expand Down Expand Up @@ -4151,13 +4146,8 @@ public static function list_evidence($userid = 0,
* @param int $limit Number of records to return.
* @return \core_competency\evidence[]
*/
public static function list_evidence_in_course($userid = 0,
$courseid = 0,
$competencyid = 0,
$sort = 'timecreated',
$order = 'DESC',
$skip = 0,
$limit = 0) {
public static function list_evidence_in_course($userid = 0, $courseid = 0, $competencyid = 0, $sort = 'timecreated',
$order = 'DESC', $skip = 0, $limit = 0) {
static::require_enabled();

if (!user_competency::can_read_user_in_course($userid, $courseid)) {
Expand Down Expand Up @@ -4201,17 +4191,8 @@ public static function list_evidence_in_course($userid = 0,
* @throws invalid_persistent_exception
* @throws moodle_exception
*/
public static function add_evidence($userid,
$competencyorid,
$contextorid,
$action,
$descidentifier,
$desccomponent,
$desca = null,
$recommend = false,
$url = null,
$grade = null,
$actionuserid = null,
public static function add_evidence($userid, $competencyorid, $contextorid, $action, $descidentifier, $desccomponent,
$desca = null, $recommend = false, $url = null, $grade = null, $actionuserid = null,
$note = null) {
global $DB;
static::require_enabled();
Expand Down Expand Up @@ -4490,7 +4471,7 @@ public static function delete_evidence($evidenceorid) {
* @return void
*/
protected static function apply_competency_rules_from_usercompetency(user_competency $usercompetency,
competency $competency = null) {
competency $competency = null) {

// Perform some basic checks.
if (!$usercompetency->get_proficiency()) {
Expand Down Expand Up @@ -5119,8 +5100,8 @@ public static function update_course_competency_settings($courseid, $settings) {
* @return list($sql, $params) Same as $DB->get_in_or_equal().
* @todo MDL-52243 Move this function to lib/accesslib.php
*/
public static function filter_users_with_capability_on_user_context_sql($capability, $userid = 0,
$type=SQL_PARAMS_QM, $prefix='param') {
public static function filter_users_with_capability_on_user_context_sql($capability, $userid = 0, $type = SQL_PARAMS_QM,
$prefix='param') {

global $USER, $DB;
$allresultsfilter = array('> 0', array());
Expand Down
2 changes: 1 addition & 1 deletion competency/classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public static function list_competency_frameworks_parameters() {
* @throws invalid_parameter_exception
*/
public static function list_competency_frameworks($sort, $order, $skip, $limit, $context, $includes, $onlyvisible,
$query = '') {
$query = '') {
global $PAGE;

$params = self::validate_parameters(self::list_competency_frameworks_parameters(), array(
Expand Down
2 changes: 1 addition & 1 deletion competency/tests/api_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,7 @@ protected function assertSuccessWithGradeCompetencyInCourse($courseid, $userid,
* @param int $grade The grade.
*/
protected function assertExceptionWithGradeCompetencyInCourse($exceptiontype, $exceptiontext, $courseid, $userid, $compid,
$grade = 1) {
$grade = 1) {

$raised = false;
try {
Expand Down

0 comments on commit 69c4786

Please sign in to comment.