98 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
1093256560
MDL-81522 phpunit: Add missing void return type to all tests
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
2024-06-11 12:18:04 +02:00
Andrew Nicols
613f933442
Merge branch 'MDL-80820' of https://github.com/marinaglancy/moodle 2024-04-15 10:42:22 +08:00
Marina Glancy
ef1759da74 MDL-80820 various: fix incorrect phpdocs 2024-04-08 10:13:10 +01:00
Vithusha Uthayakumar
af9e66530a MDL-81298 external: fix typo error in failing testcase 2024-03-27 16:38:48 +11:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Jun Pataleta
21458dc8a4
Merge branch 'MDL-80694' of https://github.com/marinaglancy/moodle 2024-02-05 14:27:05 +08:00
Marina Glancy
87470d1d40 MDL-80694 external: fix return param in inplace_editable WS 2024-01-23 14:15:42 +00:00
Jun Pataleta
9dcffb4a93
MDL-76723 core_external: Handle format properties properly
- If a text format property defines the 'optional' attribute as true,
then the $required parameter that
is passed to \core\external\exporter::get_format_structure() should be
VALUE_OPTIONAL.
- If a default value is provided for a format property,
\core\external\exporter::get_format_structure() should pass the default
value to the external_format_value constructor.
- Added validation for external_format_value for the default parameter.
  Debugging will be shown in case an invalid default value is passed.
- Amended unit tests for better coverage.
2023-12-19 15:48:07 +08:00
Mihail Geshoski
8958667c9a MDL-78294 core_external: Generate the file url based on the request
The file url for each returned area file in get_area_files() is now
generated based on the request type. If AJAX request, a standard file
plugin url will be created. Otherwise, a webservice plugin file will be
created.
2023-11-24 15:57:18 +08:00
Mihail Geshoski
5f10f82301 MDL-78294 core_external: New return value 'icon' in external_files
New return value 'icon' has been added to the webservice structure
external_files. This return value represents the relative icon path
for a given file. Also, get_area_files() from the core external utility
class now includes this information in its return.
2023-11-24 15:02:20 +08:00
Andrew Nicols
9f676d6cb3
Merge branch 'MDL-78917' of https://github.com/paulholden/moodle 2023-09-08 22:14:28 +08:00
Paul Holden
6e9e73aba0
MDL-79205 webservice: gracefully handle invalid functions in docs. 2023-09-05 08:51:51 +01:00
Paul Holden
17dae8a036
MDL-78917 webservice: extra data in exception for missing classpath.
Include the external function classname & methodname properties in
the thrown exception, to aid diagnostic.
2023-08-31 14:15:17 +01:00
Ilya Tregubov
ab6dc892e4
Merge branch 'MDL-76656-master' of https://github.com/meirzamoodle/moodle 2023-06-28 18:08:21 +08:00
meirzamoodle
f69a420be1 MDL-76656 webservice: generated token can only read once
Generated tokens should only read once.
Therefore removing the token column at the table view of the manage tokens page and the user's page.
The token should not be able to search.
2023-06-28 09:27:31 +07:00
Andrew Nicols
ee9144cadb
MDL-78192 external: Fix typo in constant name 2023-06-24 21:57:04 +08:00
Petr Skoda
16729b7f02 MDL-78192 external: allow nullable non-scalar params and results 2023-06-23 11:12:08 +02:00
Philipp Memmel
31bad4ffcd MDL-78049 core_external: Run test_all_external_info in separate process 2023-04-27 08:27:07 +02:00
Andrew Nicols
f7d7ad7fed MDL-77989 core_external: Isolate testing of deprecated file
The inclusion of this deprecated file leads to tests passing which may
fail when run in a different order, or for just a single testsuite.
2023-04-21 09:33:53 +08:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Petr Skoda
176191dab5 MDL-74936 core: tidy up context API 2023-03-31 23:09:39 +02:00
Andrew Nicols
8aa7812ff8 MDL-75085 external: Whitespace fix 2023-02-02 12:38:46 +08:00
Jun Pataleta
60fe64d786 MDL-75085 core_external: Validate $required param
Make sure that the $required param for external_description and its
subclasses are either VALUE_DEFAULT, VALUE_REQUIRED, or VALUE_OPTIONAL.
2023-02-02 09:13:43 +08:00
Jun Pataleta
7a85d041d7 MDL-75085 core_external: Pass proper $required param value in tests 2023-02-02 09:08:29 +08:00
Andrew Nicols
1dbc7b303e MDL-76583 core_external: Update util_test coding style 2023-01-19 07:34:09 +08:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Andrew Nicols
188dfcbf8c MDL-76583 core_external: External API Test coding style fixes 2023-01-19 07:33:47 +08:00
Andrew Nicols
c435f5d95b MDL-76583 core_external: Update service management functions 2023-01-19 07:33:47 +08:00
Andrew Nicols
47814221e5 MDL-76583 core_external: Update util string formatting functions 2023-01-19 07:33:47 +08:00
Andrew Nicols
d5d4ff8986 MDL-76583 core_external: Update token functions 2023-01-19 07:33:47 +08:00
Andrew Nicols
7a4f57cbfa MDL-76583 core_external: util class coding style fixes 2023-01-19 07:33:47 +08:00
Andrew Nicols
93d0f2f2c1 MDL-76583 core_external: external_files coding style fixes 2023-01-19 07:33:47 +08:00
Andrew Nicols
be1c3877c5 MDL-76583 core_external: external_value coding style fixes 2023-01-19 07:33:47 +08:00
Andrew Nicols
1125fa94f6 MDL-76583 core_external: external_format_value coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
b46a72c1aa MDL-76583 core_external: external_single_structure coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
135fae604c MDL-76583 core_external: external_multiple_structure coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
8e336beac3 MDL-76583 core_external: external_function_params coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
59c9577912 MDL-76583 core_external: external_warnings coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
ca7305f0c6 MDL-76583 core_external: external_description coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
8bc2011d3d MDL-76583 core_external: external settings coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
c978cd8cc3 MDL-76583 core_external: core_external\external_api coding style fixes 2023-01-19 07:33:38 +08:00
Andrew Nicols
fa676b4776 MDL-76583 core_external: Implement Privacy API for core_external
AMOS BEGIN
 MOV [privacy:metadata:serviceusers,core_webservice],[privacy:metadata:serviceusers,core_external]
 MOV [privacy:metadata:serviceusers:iprestriction,core_webservice],[privacy:metadata:serviceusers:iprestriction,core_external]
 MOV [privacy:metadata:serviceusers:timecreated,core_webservice],[privacy:metadata:serviceusers:timecreated,core_external]
 MOV [privacy:metadata:serviceusers:userid,core_webservice],[privacy:metadata:serviceusers:userid,core_external]
 MOV [privacy:metadata:serviceusers:validuntil,core_webservice],[privacy:metadata:serviceusers:validuntil,core_external]
 MOV [privacy:metadata:tokens,core_webservice],[privacy:metadata:tokens,core_external]
 MOV [privacy:metadata:tokens:creatorid,core_webservice],[privacy:metadata:tokens:creatorid,core_external]
 MOV [privacy:metadata:tokens:iprestriction,core_webservice],[privacy:metadata:tokens:iprestriction,core_external]
 MOV [privacy:metadata:tokens:lastaccess,core_webservice],[privacy:metadata:tokens:lastaccess,core_external]
 MOV [privacy:metadata:tokens:privatetoken,core_webservice],[privacy:metadata:tokens:privatetoken,core_external]
 MOV [privacy:metadata:tokens:timecreated,core_webservice],[privacy:metadata:tokens:timecreated,core_external]
 MOV [privacy:metadata:tokens:token,core_webservice],[privacy:metadata:tokens:token,core_external]
 MOV [privacy:metadata:tokens:tokentype,core_webservice],[privacy:metadata:tokens:tokentype,core_external]
 MOV [privacy:metadata:tokens:userid,core_webservice],[privacy:metadata:tokens:userid,core_external]
 MOV [privacy:metadata:tokens:validuntil,core_webservice],[privacy:metadata:tokens:validuntil,core_external]
 MOV [privacy:request:notexportedsecurity,core_webservice],[privacy:request:notexportedsecurity,core_external]
AMOS END
2023-01-19 07:33:35 +08:00
Andrew Nicols
0392551bcb MDL-76583 core_external: Migrate service management to util 2023-01-19 07:33:35 +08:00
Andrew Nicols
caddb452f0 MDL-76583 core_external: Migrate string formatting functions to util 2023-01-19 07:33:35 +08:00
Andrew Nicols
7f5fb6a592 MDL-76583 core_external: Migrate token functions class 2023-01-19 07:33:35 +08:00
Andrew Nicols
7d079e82e1 MDL-76583 core_external: Move util test and update 2023-01-19 07:33:35 +08:00
Andrew Nicols
453738e3fd MDL-76583 core_external: Move files test and update 2023-01-19 07:33:35 +08:00
Andrew Nicols
3f8fdc8e33 MDL-76583 core_external: Move settings test and update 2023-01-19 07:33:35 +08:00
Andrew Nicols
ecbb31b160 MDL-76583 core_external: Migrate external_settings class 2023-01-19 07:33:35 +08:00