Browse Source

phpdoc compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
1422796e64
  1. 4
      classes/event/course_module_viewed.php
  2. 30
      cross/cross_class.php
  3. 3
      cross/crossdb_class.php
  4. 14
      cryptex/cryptexdb_class.php
  5. 2
      db/importsnakes.php
  6. 10
      export/exporthtml_millionaire.php
  7. 90
      hangman/play.php
  8. 14
      hiddenpicture/play.php
  9. 13
      lib.php
  10. 7
      locallib.php
  11. 6
      print.php
  12. 16
      report/default.php
  13. 10
      translate.php

4
classes/event/course_module_viewed.php

@ -58,8 +58,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
/** /**
* Create instance of event. * Create instance of event.
* *
* @param $game * @param stdClass $game
* @param $context * @param context_module $context
* *
* @return event * @return event
*/ */

30
cross/cross_class.php

@ -512,8 +512,8 @@ class Cross
/** /**
* Swaps two variables. * Swaps two variables.
* *
* @param &$a * @param object $a
* @param &$b * @param object $b
*/ */
public function swap( &$a, &$b) { public function swap( &$a, &$b) {
$temp = $a; $temp = $a;
@ -572,11 +572,11 @@ class Cross
* @param int $valblanc * @param int $valblanc
* @param string $puzzle * @param string $puzzle
* @param array $words * @param array $words
* @param $magics * @param object $magics
* @param $poss * @param object $poss
* @param $ccrosspos * @param int $ccrosspos
* @param $crossdir * @param int $crossdir
* @param $crosssword * @param object $crosssword
* @param int $n20 * @param int $n20
* *
* @return true if it is ok. * @return true if it is ok.
@ -709,9 +709,9 @@ class Cross
/** /**
* my_preg_match (backward compatibility). * my_preg_match (backward compatibility).
* *
* @param $w * @param string $w
* @param $words * @param string $words
* @param $word * @param string $word
* *
* @return true if it is ok. * @return true if it is ok.
*/ */
@ -744,9 +744,9 @@ class Cross
/** /**
* Set a char to the specified position. * Set a char to the specified position.
* *
* @param $s * @param string $s
* @param $pos * @param int $pos
* @param $char * @param string $char
*/ */
public function setchar( &$s, $pos, $char) { public function setchar( &$s, $pos, $char) {
$ret = ""; $ret = "";
@ -761,8 +761,8 @@ class Cross
/** /**
* Show html base. * Show html base.
* *
* @param $crossm * @param object $crossm
* @param $crossd * @param object $crossd
* @param boolean $showsolution * @param boolean $showsolution
* @param boolean $showhtmlsolutions * @param boolean $showhtmlsolutions
* @param boolean $showstudentguess * @param boolean $showstudentguess

3
cross/crossdb_class.php

@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die();
* @author bdaloukas * @author bdaloukas
* @package game * @package game
**/ **/
defined('MOODLE_INTERNAL') || die();
class CrossDB extends Cross { class CrossDB extends Cross {
/** /**
* Save cross. * Save cross.

14
cryptex/cryptexdb_class.php

@ -39,7 +39,7 @@ class CryptexDB extends CrossDB {
* @param array $crossm * @param array $crossm
* @param array $crossd * @param array $crossd
* @param int $id * @param int $id
* @param $letters * @param string $letters
* *
* @return the saved record * @return the saved record
*/ */
@ -134,12 +134,12 @@ class CryptexDB extends CrossDB {
/** /**
* Displays the cryptex. * Displays the cryptex.
* *
* @param $cols * @param int $cols
* @param $rows * @param int $rows
* @param $letters * @param string $letters
* @param $mask * @param string $mask
* @param $showsolution * @param boolean $showsolution
* @param $textdir * @param boolean $textdir
*/ */
public function displaycryptex( $cols, $rows, $letters, $mask, $showsolution, $textdir) { public function displaycryptex( $cols, $rows, $letters, $mask, $showsolution, $textdir) {
echo "<table border=1 $textdir>"; echo "<table border=1 $textdir>";

2
db/importsnakes.php

@ -70,6 +70,8 @@ function game_importsnakes() {
/** /**
* Insert one board to database * Insert one board to database
*
* @param $newrec
*/ */
function game_importsnakes_do( $newrec) { function game_importsnakes_do( $newrec) {
global $DB; global $DB;

10
export/exporthtml_millionaire.php

@ -29,11 +29,11 @@ defined('MOODLE_INTERNAL') || die();
* *
* @param stdClass $game * @param stdClass $game
* @param stdClass $context * @param stdClass $context
* @param $maxanswers * @param int $maxanswers
* @param $countofquestions * @param int $countofquestions
* @param $retfeedback * @param string $retfeedback
* @param $destdir * @param string $destdir
* @param $files * @param array $files
*/ */
function game_millionaire_html_getquestions( $game, $context, &$maxanswers, &$countofquestions, &$retfeedback, $destdir, &$files) { function game_millionaire_html_getquestions( $game, $context, &$maxanswers, &$countofquestions, &$retfeedback, $destdir, &$files) {
global $CFG, $DB, $USER; global $CFG, $DB, $USER;

90
hangman/play.php

@ -27,13 +27,13 @@ defined('MOODLE_INTERNAL') || die();
/** /**
* Plays the game hangman * Plays the game hangman
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hangman * @param stdClass $hangman
* @param $newletter * @param string $newletter
* @param $action * @param string $action
* @param $context * @param stdClass $context
*/ */
function game_hangman_continue( $id, $game, $attempt, $hangman, $newletter, $action, $context) { function game_hangman_continue( $id, $game, $attempt, $hangman, $newletter, $action, $context) {
global $DB, $USER; global $DB, $USER;
@ -233,13 +233,13 @@ function game_hangman_onfinishgame( $game, $attempt, $hangman) {
/** /**
* Plays the hangman game. * Plays the hangman game.
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hangman * @param stdClass $hangman
* @param $onlyshow * @param boolean $onlyshow
* @param $showsolution * @param boolean $showsolution
* @param $context * @param stdClass $context
*/ */
function game_hangman_play( $id, $game, $attempt, $hangman, $onlyshow, $showsolution, $context) { function game_hangman_play( $id, $game, $attempt, $hangman, $onlyshow, $showsolution, $context) {
global $CFG, $DB, $OUTPUT; global $CFG, $DB, $OUTPUT;
@ -321,20 +321,20 @@ function game_hangman_play( $id, $game, $attempt, $hangman, $onlyshow, $showsolu
/** /**
* Shows page. * Shows page.
* *
* @param $done * @param boolean $done
* @param $correct * @param boolean $correct
* @param $wrong * @param boolean $wrong
* @param $max * @param int $max
* @param wordline * @param string wordline
* @param $wordline2 * @param string $wordline2
* @param $links * @param array $links
* @param stdClass $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hangman * @param stdClass $hangman
* @param $query * @param stdClass $query
* @param $onlyshow * @param boolean $onlyshow
* @param $showsolution * @param boolean $showsolution
* @param $context * @param stdClass $context
*/ */
function hangman_showpage(&$done, &$correct, &$wrong, $max, &$wordline, &$wordline2, &$links, function hangman_showpage(&$done, &$correct, &$wrong, $max, &$wordline, &$wordline2, &$links,
$game, &$attempt, &$hangman, &$query, $onlyshow, $showsolution, $context) { $game, &$attempt, &$hangman, &$query, $onlyshow, $showsolution, $context) {
@ -484,12 +484,12 @@ function hangman_showpage(&$done, &$correct, &$wrong, $max, &$wordline, &$wordli
/** /**
* This word is correct. If reach the max number of words I have to finish else continue with next word. * This word is correct. If reach the max number of words I have to finish else continue with next word.
* *
* @param $id * @param int $id
* @param $wordline * @param string $wordline
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hangman * @param stdClass $hangman
* @param $query * @param stdClass $query
*/ */
function hangman_oncorrect( $id, $wordline, $game, $attempt, $hangman, $query) { function hangman_oncorrect( $id, $wordline, $game, $attempt, $hangman, $query) {
global $DB; global $DB;
@ -510,14 +510,14 @@ function hangman_oncorrect( $id, $wordline, $game, $attempt, $hangman, $query) {
/** /**
* On incorrect. * On incorrect.
* *
* @param $id * @param int $id
* @param $wordline * @param string $wordline
* @param $word * @param string $word
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hangman * @param stdClass $hangman
* @param $onlyshow * @param boolean $onlyshow
* @param $showsolution * @param boolean $showsolution
*/ */
function hangman_onincorrect( $id, $wordline, $word, $game, $attempt, $hangman, $onlyshow, $showsolution) { function hangman_onincorrect( $id, $wordline, $word, $game, $attempt, $hangman, $onlyshow, $showsolution) {
echo "\r\n<br/><br/><font size=\"5\">\n$wordline</font>\r\n"; echo "\r\n<br/><br/><font size=\"5\">\n$wordline</font>\r\n";
@ -544,10 +544,10 @@ function hangman_onincorrect( $id, $wordline, $word, $game, $attempt, $hangman,
/** /**
* Shows the next word. * Shows the next word.
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hangman * @param stdClass $hangman
*/ */
function game_hangman_show_nextword( $id, $game, $attempt, $hangman) { function game_hangman_show_nextword( $id, $game, $attempt, $hangman) {
global $CFG, $DB; global $CFG, $DB;

14
hiddenpicture/play.php

@ -28,11 +28,11 @@ defined('MOODLE_INTERNAL') || die();
/** /**
* Plays the game "Hidden picture" * Plays the game "Hidden picture"
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hiddenpicture * @param stdClass $hiddenpicture
* @param $context * @param stdClass $context
*/ */
function game_hiddenpicture_continue( $id, $game, $attempt, $hiddenpicture, $context) { function game_hiddenpicture_continue( $id, $game, $attempt, $hiddenpicture, $context) {
global $DB, $USER; global $DB, $USER;
@ -117,8 +117,8 @@ function game_hiddenpicture_continue( $id, $game, $attempt, $hiddenpicture, $con
/** /**
* Create the game_hiddenpicture record. * Create the game_hiddenpicture record.
* *
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
*/ */
function game_hiddenpicture_selectglossaryentry( $game, $attempt) { function game_hiddenpicture_selectglossaryentry( $game, $attempt) {
global $CFG, $DB, $USER; global $CFG, $DB, $USER;

13
lib.php

@ -55,7 +55,8 @@ define('GAME_REVIEW_GENERALFEEDBACK', 32 * 0x1041); // Show general feedback.
/** /**
* Given an object containing all the necessary data, will create a new instance and return the id number of the new instance. * Given an object containing all the necessary data, will create a new instance and return the id number of the new instance.
* *
* @param object $instance An object from the form in mod.html * @param object $game An object from the form in mod.html
*
* @return int The id of the newly inserted game record * @return int The id of the newly inserted game record
**/ **/
function game_add_instance($game) { function game_add_instance($game) {
@ -79,7 +80,7 @@ function game_add_instance($game) {
/** /**
* Given an object containing all the necessary data, this function will update an existing instance with new data. * Given an object containing all the necessary data, this function will update an existing instance with new data.
* *
* @param object $instance An object from the form in mod.html * @param object $game An object from the form in mod.html
* @return boolean Success/Fail * @return boolean Success/Fail
**/ **/
function game_update_instance($game) { function game_update_instance($game) {
@ -237,10 +238,10 @@ function game_delete_instance($gameid) {
/** /**
* Return a small object with summary information about what a user has done * Return a small object with summary information about what a user has done
* *
* @param $course * @param stdClass $course
* @param $user * @param stdClass $user
* @param $mod * @param string $mod
* @param $game * @param stdClass $game
* *
* $return->time = the time they did it * $return->time = the time they did it
* $return->info = a short text description * $return->info = a short text description

7
locallib.php

@ -1992,6 +1992,13 @@ foreach ($anss as $answer) {
<?php <?php
} }
/**
* Print question show answer
*
* @param stdClass $game
* @param stdClass $question
* @param $context
*/
function game_print_question_shortanswer( $game, $question, $context) { function game_print_question_shortanswer( $game, $question, $context) {
$questiontext = $question->questiontext; $questiontext = $question->questiontext;

6
print.php

@ -40,9 +40,9 @@ game_print( $game, $id, $context);
/** /**
* Print * Print
* *
* @param $game * @param stdClass $game
* @param $update * @param boolean $update
* @param $context * @param stdClass $context
*/ */
function game_print( $game, $update, $context) { function game_print( $game, $update, $context) {
if ( $game->gamekind == 'cross') { if ( $game->gamekind == 'cross') {

16
report/default.php

@ -51,9 +51,9 @@ class game_default_report {
/** /**
* Display * Display
* *
* @param $cm * @param stdClass $cm
* @param $course * @param stdClass $course
* @param $game * @param stdClass $game
*/ */
public function display($cm, $course, $game) { public function display($cm, $course, $game) {
// This function just displays the report. // This function just displays the report.
@ -63,11 +63,11 @@ class game_default_report {
/** /**
* print header and tabs * print header and tabs
* *
* @param $cm * @param stdClass $cm
* @param $course * @param stdClass $course
* @param $game * @param stdClass $game
* @param $reportmode * @param string $reportmode
* @param $meta * @param string $meta
*/ */
public function print_header_and_tabs($cm, $course, $game, $reportmode = "overview", $meta = "") { public function print_header_and_tabs($cm, $course, $game, $reportmode = "overview", $meta = "") {
global $CFG; global $CFG;

10
translate.php

@ -255,7 +255,7 @@ if ($ret != '') {
/** /**
* Returns the language file for lang * Returns the language file for lang
* *
* @param $lang * @param string $lang
* @param string module * @param string module
* @return the path of language file * @return the path of language file
*/ */
@ -272,8 +272,8 @@ function getlangfile( $lang) {
/** /**
* Reads the language file * Reads the language file
* *
* @param $lang * @param string $lang
* @param $header * @param string $header
*/ */
function readlangfile( $lang, &$header) { function readlangfile( $lang, &$header) {
@ -341,7 +341,7 @@ function splitlangdefinition($line, &$name, &$trans) {
* Read source code * Read source code
* *
* @param string $file * @param string $file
* @param $strings * @param string $strings
*/ */
function readsourcecode( $file, &$strings) { function readsourcecode( $file, &$strings) {
global $CFG; global $CFG;
@ -357,7 +357,7 @@ function readsourcecode( $file, &$strings) {
/** /**
* Parse line * Parse line
* *
* @param $strings * @param string $strings
* @param string $line * @param string $line
* @param string $filename * @param string $filename
*/ */

Loading…
Cancel
Save