-
Improvement
-
Resolution: Fixed
-
Minor
-
3.6.3
-
MOODLE_36_STABLE
-
MOODLE_38_STABLE
-
Easy
-
The methods in the persistent class that return an object of the class, or an array of them, should use "static" instead of "persistent" in the phpdoc return type. This will improve understanding of the code by IDEs and static analysis tools.
In particular, code like this fails the "Incompatible return type" inspection in PhpStorm:
/**
|
* @return mypersistentclass[]
|
*/
|
public static function get_records_for_user($userid) {
|
return self::get_records(['userid' => $userid]);
|
}
|