1 | <?php |
||
36 | class frontend extends \core_availability\frontend { |
||
37 | |||
38 | /** |
||
39 | * This plugin was tested with several core plugins and relies on events which has crud = "r". |
||
40 | * |
||
41 | * There are issues with the Wiki, Label and Book modules. |
||
42 | * For details see: https://github.com/danielneis/moodle-availability_maxviews/issues/2 |
||
43 | * |
||
44 | * @param \stdClass $course Course object |
||
45 | * @param \cm_info $cm Course-module currently being edited (null if none) |
||
46 | * @param \section_info $section Section currently being edited (null if none) |
||
47 | */ |
||
48 | protected function allow_add($course, \cm_info $cm = null, \section_info $section = null) { |
||
59 | |||
60 | /** |
||
61 | * Gets a list of string identifiers (in the plugin's language file) that |
||
62 | * are required in JavaScript for this plugin. The default returns nothing. |
||
63 | * |
||
64 | * You do not need to include the 'title' string (which is used by core) as |
||
65 | * this is automatically added. |
||
66 | * |
||
67 | * @return array Array of required string identifiers |
||
68 | */ |
||
69 | protected function get_javascript_strings() { |
||
72 | } |
||
73 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.