Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues related to Moodle coding standards #25

Merged
merged 2 commits into from
May 6, 2024

Conversation

golenkovm
Copy link
Contributor

@golenkovm golenkovm commented May 6, 2024

This is to resolve the following coding style issues:

webservice/restful/classes/privacy/provider.php
[(#27) Unexpected MOODLE_INTERNAL check. No side effects or multiple artifacts detected.](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/classes/privacy/provider.php#L27)
[(#46) Method name "_get_reason" should not be prefixed with an underscore to indicate visibility](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/classes/privacy/provider.php#L46)
webservice/restful/db/access.php
[(#29) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/db/access.php#L29)
[(#31) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/db/access.php#L31)
[(#34) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/db/access.php#L34)
webservice/restful/lang/en/webservice_restful.php
[(#30) The string key "noauthheader" is not in the correct order, it should be before "restful:use"](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/lang/en/webservice_restful.php#L30)
[(#32) The string key "noacceptheader" is not in the correct order, it should be before "nowsfunction"](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/lang/en/webservice_restful.php#L32)
webservice/restful/locallib.php
[(#66) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L66)
[(#72) There should be a comma after the last array item in a multi-line array.](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L72)
[(#75) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L75)
[(#95) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L95)
[(#268) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L268)
[(#295) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L295)
[(#310) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L310)
[(#311) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L311)
[(#312) There should be a comma after the last array item in a multi-line array.](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L312)
[(#313) There should be a comma after the last array item in a multi-line array.](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L313)
[(#418) Logical operator "and" is prohibited; use "&&" instead](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L418)
[(#428) Logical operator "and" is prohibited; use "&&" instead](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/locallib.php#L428)
webservice/restful/server.php
[(#32) Expected login check (require_login, require_course_login, require_admin, admin_externalpage_setup) following config inclusion. None found.](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/server.php#L32)
webservice/restful/tests/server_test.php
[(#37) Testcase webservice_restful_server_testcase should be declared as abstract.](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L37)
[(#37) PHPUnit testcase name "webservice_restful_server_testcase" does not match file name "server_test"](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L37)
[(#37) PHPUnit class "webservice_restful_server_testcase" does not have any namespace. It is recommended to add it to the "webservice_restful" namespace, using more levels if needed, in order to match the code being tested](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L37)
[(#42) Test method test_get_headers() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L42)
[(#42) Test method test_get_headers() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L42)
[(#43) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L43)
[(#57) There should be a comma after the last array item in a multi-line array.](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L57)
[(#59) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L59)
[(#83) Test method test_get_wstoken() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L83)
[(#83) Test method test_get_wstoken() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L83)
[(#84) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L84)
[(#108) Test method test_get_wstoken_error() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L108)
[(#108) Test method test_get_wstoken_error() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L108)
[(#109) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L109)
[(#123) Test method test_get_wsfunction() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L123)
[(#123) Test method test_get_wsfunction() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L123)
[(#124) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L124)
[(#142) Test method test_get_wsfunction_error() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L142)
[(#142) Test method test_get_wsfunction_error() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L142)
[(#143) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L143)
[(#157) Test method test_get_responseformat() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L157)
[(#157) Test method test_get_responseformat() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L157)
[(#158) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L158)
[(#181) Test method test_get_responseformat_error() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L181)
[(#181) Test method test_get_responseformat_error() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L181)
[(#182) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L182)
[(#196) Test method test_get_requestformat() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L196)
[(#196) Test method test_get_requestformat() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L196)
[(#197) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L197)
[(#220) Test method test_get_requestformat_error() is missing any coverage information, own or at class level](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L220)
[(#220) Test method test_get_requestformat_error() is missing a return type](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L220)
[(#221) Short array syntax must be used to define arrays](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/747ccf27ad8a2ed7f45f99c55b54d5886ca7a092/webservice/restful/tests/server_test.php#L221)

@golenkovm golenkovm merged commit d8fe76d into MOODLE_402_STABLE May 6, 2024
19 checks passed
@golenkovm golenkovm deleted the mdl402-polish-ci branch May 14, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant