Skip to content

Commit

Permalink
Linting: Linting conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderJacob committed Dec 5, 2023
1 parent 487c058 commit feaec8a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 41 deletions.
25 changes: 12 additions & 13 deletions classes/course_completion/conditions/course_completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.


namespace local_adele\course_completion\conditions;

use local_adele\course_completion\course_completion;

/**
* Manually checked Course.
* Base class for a single booking option availability condition.
*
* @package mod_booking
* @copyright 2022 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* All bo condition types must extend this class.
*
* @package local_adele
* @author Jacob Viertel
* @copyright 2023 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace local_adele\course_completion\conditions;

use local_adele\course_completion\course_completion;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/local/adele/lib.php');

/**
* Base class for a single bo availability condition.
*
* All bo condition types must extend this class.
*
* Class for a single learning path course condition.
*
* @package local_adele
* @author Jacob Viertel
Expand All @@ -47,6 +45,7 @@ class course_completed implements course_completion {

/** @var int $id Standard Conditions have hardcoded ids. */
public $id = COURSES_COND_MANUALLY;
/** @var string $type of the redered condition in frontend. */
public $type = 'info_text';
/**
* Obtains a string describing this restriction (whether or not
Expand Down
24 changes: 12 additions & 12 deletions classes/course_completion/conditions/manually.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,28 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Base class for a single booking option availability condition.
*
* All bo condition types must extend this class.
*
* @package local_adele
* @author Jacob Viertel
* @copyright 2023 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace local_adele\course_completion\conditions;

use local_adele\course_completion\course_completion;

/**
* Manually checked Course.
*
* @package mod_booking
* @copyright 2022 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/local/adele/lib.php');

/**
* Base class for a single bo availability condition.
*
* All bo condition types must extend this class.
*
* Class for a single learning path course condition.
*
* @package local_adele
* @author Jacob Viertel
Expand All @@ -47,6 +46,7 @@ class manually implements course_completion {

/** @var int $id Standard Conditions have hardcoded ids. */
public $id = COURSES_COND_MANUALLY;
/** @var string $type of the redered condition in frontend. */
public $type = 'checkbox';
/**
* Obtains a string describing this restriction (whether or not
Expand Down
17 changes: 6 additions & 11 deletions classes/course_completion/conditions/timed.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
*
* All bo condition types must extend this class.
*
* @package mod_booking
* @copyright 2022 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package local_adele
* @author Jacob Viertel
* @copyright 2023 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace local_adele\course_completion\conditions;
Expand All @@ -33,10 +34,7 @@
require_once($CFG->dirroot . '/local/adele/lib.php');

/**
* Class for a single bo availability condition.
*
* This returns true or false based on the standard booking times
* OR a custom time passed on via the availability json
* Class for a single learning path course condition.
*
* @package local_adele
* @author Jacob Viertel
Expand All @@ -47,6 +45,7 @@ class timed implements course_completion {

/** @var int $id Standard Conditions have hardcoded ids. */
public $id = COURSES_COND_TIMED;
/** @var string $type of the redered condition in frontend. */
public $type = 'date';

/**
Expand All @@ -59,10 +58,6 @@ class timed implements course_completion {
* (when displaying all information about the activity) and 'student' cases
* (when displaying only conditions they don't meet).
*
* @param bool $full Set true if this is the 'full information' view
* @param booking_option_settings $settings Item we're checking
* @param int $userid User ID to check availability for
* @param bool $not Set true if we are inverting the condition
* @return array availability and Information string (for admin) about all restrictions on
* this item
*/
Expand Down
17 changes: 16 additions & 1 deletion classes/course_completion/course_completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,25 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Base class for a single booking option availability condition.
*
* All bo condition types must extend this class.
*
* @package local_adele
* @author Jacob Viertel
* @copyright 2023 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace local_adele\course_completion;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/local/adele/lib.php');

/**
* Validate if the string does excist.
* Interface for a learning path course conditions.
*
* @package local_adele
* @author Jacob Viertel
Expand Down
4 changes: 0 additions & 4 deletions classes/course_completion/course_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ public function __construct() {
/**
* Returns conditions depending on the conditions param.
*
* @param int $condparam conditions parameter
* 0 ... all conditions (default)
* 1 ... hardcoded conditions only
* 2 ... customizable conditions only
* @return array
*/
public static function get_conditions(): array {
Expand Down

0 comments on commit feaec8a

Please sign in to comment.