3014 Commits

Author SHA1 Message Date
Andrew Nicols
9cdc5850c5
Merge branch 'MDL-75952' of https://github.com/stronk7/moodle 2024-03-12 10:45:02 +08:00
Jun Pataleta
70d4a925ac
Merge branch 'MDL-80677-main' of https://github.com/andrewnicols/moodle 2024-03-12 10:21:38 +08:00
Andrew Nicols
ad9322aba2
MDL-80677 core: Deprecation attribute can apply to interfaces and traits 2024-03-12 09:49:02 +08:00
Andrew Nicols
f09d886f11
MDL-80677 core: deprecation::from should always return 2024-03-11 21:48:32 +08:00
Andrew Nicols
57ec38d136
MDL-80677 core: Move deprecated attributes to \core\attribute NS
Note: Removing the manual require for the attribute from moodlelib
because the class does not have to exist at time of definition, only
when the Reflection API instantiates an instance in \core\deprecation,
by which point the autoloader is available.
2024-03-11 21:48:32 +08:00
Andrew Nicols
807da4963b
MDL-80677 core: Any feature of a deprecated class should emit 2024-03-11 21:28:50 +08:00
Andrew Nicols
d6112c0bfb
MDL-80677 core: Get deprecated item description automatically 2024-03-11 21:28:48 +08:00
Paul Holden
f4843f268c
MDL-81047 hook: fix typo in constructor docblock. 2024-03-11 12:31:45 +00:00
Andrew Nicols
bbc98c82c0
MDL-81180 core: Add support for array notation in hook callback 2024-03-11 16:49:54 +08: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
Andrew Nicols
017e52f213
MDL-81047 core: Standardise init of before_standard_head_html_generation 2024-03-08 23:56:40 +08:00
Andrew Nicols
0a30867cdf
MDL-81047 core: Rename standard_head_html_prepend hook
This commit updates the name of the standard_head_html_prepend hook to
meet coding style agreed in MDL-79077.
2024-03-08 23:56:39 +08:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Sara Arjona
6f81ace5a8
Merge branch 'MDL-81011-main' of https://github.com/andrewnicols/moodle 2024-03-07 12:20:01 +01:00
Andrew Nicols
2b7754ccc2
MDL-81011 core: Add attribute alternative to hooks interfaces
This change replaces the requirement for:
- \core\hook\deprecated_callback_replacement
- \core\hook\described_hook

These are replaced by appropriate Attributes.
2024-03-07 18:56:05 +08:00
Jun Pataleta
f364dd5e40
Merge branch 'MDL-81044-main' of https://github.com/andrewnicols/moodle 2024-03-07 11:02:05 +08:00
Huong Nguyen
c068b01a1a
MDL-80749 adhoc_task: Update failed ad-hoc tasks cleanup
Update the task to use firststartingtime instead of timestarted
2024-03-04 10:17:14 +07:00
Huong Nguyen
17c01d9d74
MDL-80749 adhoc_task: Log the first starting time of the task 2024-03-04 10:17:09 +07:00
Huong Nguyen
3020fac005
Merge branch 'MDL-80736_main' of https://github.com/marxjohnson/moodle 2024-02-29 09:54:06 +07:00
Ilya Tregubov
2909651aff Merge branch 'MDL-80080-unset-logintoken' of https://github.com/brendanheywood/moodle 2024-02-29 10:40:00 +08:00
Eloy Lafuente (stronk7)
29a541724f
MDL-65292 style: Fix all the function declaration ordering
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration

It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.

So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
2024-02-28 23:47:47 +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
Sara Arjona
a6b2aa021a
Merge branch 'mdl-80917-main' of https://github.com/Fragonite/moodle 2024-02-28 16:44:13 +01:00
Andrew Nicols
3451175f22
Merge branch 'MDL-80684-master-fail_running_tasks_on_shutdown' of https://github.com/praxisdigital/moodle 2024-02-28 14:16:13 +08:00
Andrew Nicols
b51df700a5
Merge branch 'MDL-78256-master' of https://github.com/meirzamoodle/moodle 2024-02-28 12:05:46 +08:00
Andrew Nicols
5109761162
MDL-81044 backup: Rename excluded events hook to meet style 2024-02-27 11:40:55 +08:00
Sara Arjona
68aba64d35
MDL-79543 output: Add i/chartbar icon 2024-02-23 07:29:55 +01:00
Huong Nguyen
5d4c88e3da
Merge branch 'MDL-79266' of https://github.com/paulholden/moodle 2024-02-22 10:54:18 +07:00
Huong Nguyen
e7e0d2bfac
Merge branch 'MDL-80868' of https://github.com/paulholden/moodle 2024-02-22 10:43:00 +07:00
Huong Nguyen
3f2b136249
Merge branch 'MDL-80862-main' of https://github.com/andrewnicols/moodle 2024-02-22 10:35:59 +07:00
Brendan Heywood
c1fc12b479 MDL-80080 session: Unset logintoken after use 2024-02-22 10:56:02 +11:00
Jun Pataleta
ea4874094b
Merge branch 'MDL-79520-main' of https://github.com/snake/moodle 2024-02-20 22:22:05 +08:00
Paul Holden
6446714305
MDL-80088 mod_imscp: better uploaded package filetype validation. 2024-02-20 14:10:07 +00:00
Jake Dallimore
d20af220f8
MDL-79520 core: update Clever integration to use OpenId Connect
Instead of creating the endpoints manually, and fetching the user info
from several endpoints, which also necessitates the use of a custom
client subclass, use the OpenId configuration endpoint to auto-configure
endpoints, and then use the userinfo endpoint to fetch user info.
2024-02-20 17:07:03 +08:00
Andrew Nicols
8ebd9f08e4
MDL-80862 core: Tidy up state vars in task manager 2024-02-20 12:44:58 +08:00
Andrew Nicols
becd11a84a
MDL-80862 testing: Reset task manager between behat tests 2024-02-20 10:54:12 +08:00
Huong Nguyen
6bddb8626f
MDL-80207 core: Remove Horde library 2024-02-20 09:36:24 +07:00
Frederik Milling Pytlick
ab517483a0 MDL-80684 core: Fail running tasks on shutdown
When you kill a process which is executing a task, it now marks it as failed.
2024-02-19 12:07:56 +01:00
Alexander Van der Bellen
34492bec74 MDL-80917 core_backup: Clear restored course cache 2024-02-15 09:06:57 +08:00
meirzamoodle
d1c27bba15 MDL-78256 lib: Code adjustments to the Zipstream 3.1.0 2024-02-12 16:56:37 +07:00
Andrew Nicols
f0e46b994f
MDL-80072 core: Whitespace fix 2024-02-12 14:28:56 +08:00
Andrew Nicols
85c1dd0077
MDL-80072 core: Deprecate format_text smiley option
This was actually deprecated in Moodle 2.0 but did not emit.
2024-02-12 11:11:18 +08:00
Andrew Nicols
d56303aa54
MDL-80072 core: Promote all formatting options to parameters
Now that PHP has support for named parameters, and we can use them in
Moodle, we should ditch `$options` arrays and use first-class,
documented, parameters.

Whilst this may seem scary, dumb, overwhelming, please note that you do
not need to supply all args, for example, to change the last parameter
of `format_text` you no longer need to do this:

    return \core\container::get(\core\formatting::class)->format_text(
       $text,
       FORMAT_MOODLE,
       $context,
       false,
       null,
       true,
       true,
       true,
       false,
       false,
       true,
    );

Instead you can do:

    return \core\container::get(\core\formatting::class)->format_text(
       $text,
       FORMAT_MOODLE,
       $context,
       allowid: true,
    );

Or better still:

    return \core\container::get(\core\formatting::class)->format_text(
       text: $text,
       format: FORMAT_MOODLE,
       context: $context,
       allowid: true,
    );

This means that we can get defaults in the function signature, improves
our typing, and allows for deprecation and changes to options. It also
sets us up for success in the future.
2024-02-12 11:11:18 +08:00
Andrew Nicols
b353c8e1e2
MDL-80072 core: Improve format_* APIs to improve clarity 2024-02-12 11:11:18 +08:00
Andrew Nicols
fb1d9d65e0
MDL-80072 core: Move format_string cache to class prop
This means that the cache will be automatically reset between tests.
2024-02-12 11:11:18 +08:00
Andrew Nicols
ae80cd739b
MDL-80072 core: Coding Style fixes 2024-02-12 11:11:17 +08:00
Andrew Nicols
e8eb163ff9
MDL-80072 core: Move CFG->filterall to formatter property 2024-02-12 11:11:17 +08:00
Andrew Nicols
35a8e23034
MDL-80072 core: Move CFG->formatstringstriptags to formatter property 2024-02-12 11:11:17 +08:00
Andrew Nicols
f9dc48691d
MDL-80072 core: Move CFG->forceclean to formatter property 2024-02-12 11:11:17 +08:00
Andrew Nicols
6bb0c91a73
MDL-80072 core: Move format_text to core\formatting 2024-02-12 11:11:16 +08:00