Skip to content

Commit

Permalink
some more codestyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
irinahpe committed May 24, 2024
1 parent 8f484ac commit aeb8e5f
Show file tree
Hide file tree
Showing 24 changed files with 101 additions and 32 deletions.
6 changes: 6 additions & 0 deletions backup/moodle2/backup_restore_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/

/**
* Get fields for tableclass
*
* @param $class
* @return array
* @throws ReflectionException
Expand All @@ -41,6 +43,8 @@ function get_fields_for_tableclass($class) {
}

/**
* Get tablename for tableclass.
*
* @param $class
* @return mixed
* @throws ReflectionException
Expand All @@ -52,6 +56,8 @@ function get_tablename_for_tableclass($class) {
}

/**
* Get id for tableclass.
*
* @param $class
* @return array
* @throws ReflectionException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
require_once($CFG->dirroot . '/mod/ratingallocate/backup/moodle2/restore_ratingallocate_activity_stepslib.php');

/**
* @class restore_ratingallocate_activity_task
* Restore ratingallocate activity class
*
* @package mod_ratingallocate
* @copyright 214 C. Usener
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
4 changes: 3 additions & 1 deletion classes/allocations_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
require_once($CFG->dirroot . '/user/lib.php');

/**
* @class allocations_table
* Allocations table.
*
* @package mod_ratingallocate
*/
class allocations_table extends \table_sql {

Expand Down
8 changes: 7 additions & 1 deletion classes/choice_importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Choice importer.
*
* @package mod_ratingallocate
* @copyright 2021 Catalyst IT
* @author David Thompson <[email protected]>
Expand All @@ -28,7 +30,9 @@
require_once($CFG->libdir . '/csvlib.class.php');

/**
* @class choice_importer
* Choice importer.
*
* @package mod_ratingallocate
*/
class choice_importer {
/**
Expand Down Expand Up @@ -76,6 +80,8 @@ public static function print_fields($fields=self::REQUIRED_FIELDS) {
}

/**
* Construct.
*
* @param $ratingallocateid
* @param $ratingallocate
*/
Expand Down
4 changes: 3 additions & 1 deletion classes/ratingallocate_observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
use dml_exception;

/**
* @class ratingallocate_observer
* Ratingallocate observer.
*
* @package mod_ratingallocate
*/
class ratingallocate_observer {

Expand Down
8 changes: 7 additions & 1 deletion classes/ratings_and_allocations_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
require_once($CFG->libdir . '/tablelib.php');

/**
* @class ratings_and_allocations_table
* Ratings and allocations table
*
* @package mod_ratingallocate
*/
class ratings_and_allocations_table extends \table_sql {

Expand Down Expand Up @@ -89,6 +91,8 @@ class ratings_and_allocations_table extends \table_sql {
private $renderer;

/**
* Construct.
*
* @param \mod_ratingallocate_renderer $renderer
* @param $titles
* @param $ratingallocate
Expand Down Expand Up @@ -651,6 +655,8 @@ function($u) {
}

/**
* Filter choiceids.
*
* @param $choiceids
* @return array
* @throws \dml_exception
Expand Down
4 changes: 3 additions & 1 deletion classes/task/send_distribution_notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
use ratingallocate\db as this_db;

/**
* @class send_distibution_notification
* Send distribution notification
*
* @package mod_ratingallocate
*/
class send_distribution_notification extends \core\task\adhoc_task {
// Gets executed by the task runner. Will lookup the ratingallocation object and
Expand Down
28 changes: 21 additions & 7 deletions db/db_structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
defined('MOODLE_INTERNAL') || die();

/**
* @class ratingallocate
* Ratingallocate.
*
* @package mod_ratingallocate
*/
class ratingallocate {
/**
Expand Down Expand Up @@ -106,7 +108,9 @@ class ratingallocate {
}

/**
* @class Ratingallocate choices
* Ratingallocate choices.
*
* @package mod_ratingallocate
*/
class ratingallocate_choices {
/**
Expand Down Expand Up @@ -144,7 +148,9 @@ class ratingallocate_choices {
}

/**
* @class ratingallocate_group_choices
* Ratingallocate group choices.
*
* @package mod_ratingallocate
*/
class ratingallocate_group_choices {
/**
Expand All @@ -166,7 +172,9 @@ class ratingallocate_group_choices {
}

/**
* @class ratingallocate_ch_gengroups
* Ratingallocate generated groups of choices
*
* @package mod_ratingallocate
*/
class ratingallocate_ch_gengroups {
/**
Expand All @@ -188,7 +196,9 @@ class ratingallocate_ch_gengroups {
}

/**
* @class ratingallocate_groupings Generated grouping by instance
* Ratingallocate groupings
*
* @package mod_ratingallocate
*/
class ratingallocate_groupings {
/**
Expand All @@ -210,7 +220,9 @@ class ratingallocate_groupings {
}

/**
* @class ratings (map user to choice)
* Ratingallocate ratings
*
* @package mod_ratingallocate
*/
class ratingallocate_ratings {
/**
Expand All @@ -236,7 +248,9 @@ class ratingallocate_ratings {
}

/**
* @class allocations
* Ratingallocate allocations.
*
* @package mod_ratingallocate
*/
class ratingallocate_allocations {
/**
Expand Down
6 changes: 5 additions & 1 deletion db/uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Db uninstall.
*
* @see uninstall_plugin()
*
* @package mod_ratingallocate
Expand All @@ -23,7 +25,9 @@
*/

/**
* @function uninstall Custom uninstallation procedure
* Uninstall.
*
* @package mod_ratingallocate
*/
function xmldb_ratingallocate_uninstall() {
return true;
Expand Down
8 changes: 7 additions & 1 deletion solver/edmonds-karp.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,24 @@
require_once(dirname(__FILE__) . '/solver-template.php');

/**
* @class solver_edmonds_karp
* Solver edmonds-karp.
*
* @package mod_ratingallocate
*/
class solver_edmonds_karp extends distributor {

/**
* Return name.
*
* @return string
*/
public function get_name() {
return 'edmonds_karp';
}

/**
* Compute distribution.
*
* @param $choicerecords
* @param $ratings
* @param $usercount
Expand Down
6 changes: 5 additions & 1 deletion solver/ford-fulkerson-koegel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
require_once(dirname(__FILE__) . '/solver-template.php');

/**
* @class solver_ford_fulkerson
* Solver Ford-fulkerson.
*
* @package mod_ratingallocate
*/
class solver_ford_fulkerson extends distributor {

Expand Down Expand Up @@ -156,6 +158,8 @@ public function find_shortest_path_bellmanf_koegel($from, $to) {
}

/**
* Return name.
*
* @return string
*/
public function get_name() {
Expand Down
6 changes: 5 additions & 1 deletion solver/solver-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
defined('MOODLE_INTERNAL') || die();

/**
* @class edge
* Edge.
*
* @package mod_ratingallocate
*/
class edge {
/** @var from int */
Expand All @@ -46,6 +48,8 @@ class edge {
public $space;

/**
* Construct.
*
* @param $from
* @param $to
* @param $weight
Expand Down
4 changes: 2 additions & 2 deletions strategy/strategy01_yes_no.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/**
* Strategy
*
* @class strategy
* @package mod_ratingallocate
*/
class strategy extends \strategytemplate_options {

Expand Down Expand Up @@ -106,7 +106,7 @@ protected function getvalidationinfo() {
/**
* View form
*
* @class mod_ratingallocate_view_form
* @package mod_ratingallocate
*/
class mod_ratingallocate_view_form extends \ratingallocate_options_strategyform {
// Already specified by parent class.
Expand Down
8 changes: 6 additions & 2 deletions strategy/strategy02_yes_maybe_no.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
require_once(dirname(__FILE__) . '/strategy_template_options.php');

/**
* @class strategy
* Strategy.
*
* @package mod_ratingallocate
*/
class strategy extends \strategytemplate_options {

Expand Down Expand Up @@ -126,7 +128,9 @@ protected function getvalidationinfo() {
\strategymanager::add_strategy(strategy::STRATEGYID);

/**
* @class mod_ratingallocate_view_form
* View form.
*
* @package mod_ratingallocate
*/
class mod_ratingallocate_view_form extends \ratingallocate_options_strategyform {
// Already specified by parent class.
Expand Down
5 changes: 3 additions & 2 deletions strategy/strategy03_lickert.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

/**
* Strategy
* @class strategy
*
* @package mod_ratingallocate
*/
class strategy extends \strategytemplate_options {

Expand Down Expand Up @@ -153,7 +154,7 @@ protected function getvalidationinfo() {
/**
* View form.
*
* @class mod_ratinallocate_view_form
* @package mod_ratingallocate
*/
class mod_ratingallocate_view_form extends \ratingallocate_options_strategyform {
// Already specified by parent class.
Expand Down
4 changes: 2 additions & 2 deletions strategy/strategy04_points.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* Strategy
*
* @class strategy
* @package mod_ratingallocate
*/
class strategy extends \strategytemplate {

Expand Down Expand Up @@ -112,7 +112,7 @@ protected function getvalidationinfo() {
/**
* View form.
*
* @class mod_ratingallocate_view_form
* @package mod_ratingallocate
*/
class mod_ratingallocate_view_form extends \ratingallocate_strategyform {

Expand Down
4 changes: 3 additions & 1 deletion strategy/strategy05_order.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
require_once(dirname(__FILE__) . '/strategy_template.php');

/**
* @class strategy
* Strategy.
*
* @package mod_ratingallocate
*/
class strategy extends \strategytemplate {

Expand Down
2 changes: 1 addition & 1 deletion strategy/strategy06_tickyes.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* Strategy.
*
* @class strategy
* @package mod_ratingallocate
*/
class strategy extends \strategytemplate {

Expand Down
2 changes: 1 addition & 1 deletion strategy/strategy_template_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* Strategytemplate options.
*
* @class strategytemplate_options
* @package mod_ratingallocate
*/
abstract class strategytemplate_options extends \strategytemplate {

Expand Down
Loading

0 comments on commit aeb8e5f

Please sign in to comment.