Skip to content

Commit

Permalink
Merge pull request #7 from kialo/PM-45329-moodle-upgrade
Browse files Browse the repository at this point in the history
PM-45329 Moodle 4.4 upgrade
  • Loading branch information
mk-kialo authored Jun 12, 2024
2 parents 8083b7a + 314dc46 commit 0b83ee7
Show file tree
Hide file tree
Showing 24 changed files with 1,204 additions and 212 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,26 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.0', '8.1' ] # Moodle doesn't support PHP 8.2 yet.
php: # see https://moodledev.io/general/development/policies/php
- '7.4' # minimum support version by Moodle 4.1
- '8.0'
- '8.1'
- '8.3' # max. supported version by Moodle 4.4 (as of writing)
moodle-branch: [ 'MOODLE_401_STABLE', 'MOODLE_404_STABLE' ] # LTS & latest.
database: [ pgsql ] # We don't use any database specific features, and our test sites run mariadb already.
exclude:
# Moodle 4.4+ requires PHP 8.1+
- php: '8.0'
moodle-branch: 'MOODLE_404_STABLE'
- php: '7.4'
moodle-branch: 'MOODLE_404_STABLE'
# Moodle 4.1 does not support PHP 8.3
- php: '8.3'
moodle-branch: 'MOODLE_401_STABLE'

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: plugin

Expand Down Expand Up @@ -96,11 +105,6 @@ jobs:
cd plugin
composer lint
- name: PHP Copy/Paste Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpcpd

- name: PHP Mess Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
Expand Down Expand Up @@ -150,7 +154,7 @@ jobs:

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: plugin

Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## PHP

vendor/*
!vendor/oat-sa/lib-lti1p3-core/readme_moodle.txt
!vendor/readme_moodle.txt
.php-cs-fixer.cache

## IDEA
Expand Down
5 changes: 5 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="MoodleCore">
<rule ref="./phpcs.xml"/>
<rule ref="moodle-extra"/>
</ruleset>
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v1.1.0 (Build - 2024053101)

* Moodle 4.4 compatibility

### v1.0.26 (Build - 2023121501)

* Improved compatibility with future PHP versions.
Expand Down
2 changes: 1 addition & 1 deletion classes/static_nonce_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(string $nonce) {
* @param int|null $ttl TTL is ignored, because it's not supported.
* @return NonceInterface
*/
public function generate(int $ttl = null): NonceInterface {
public function generate(?int $ttl = null): NonceInterface {
return new Nonce($this->nonce);
}
}
4 changes: 2 additions & 2 deletions classes/static_registration_repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function findByClientId(string $clientId): ?RegistrationInterface {
* @param string|null $clientId
* @return RegistrationInterface|null
*/
public function findByPlatformIssuer(string $issuer, string $clientId = null): ?RegistrationInterface {
public function findByPlatformIssuer(string $issuer, ?string $clientId = null): ?RegistrationInterface {
$platform = $this->registration->getPlatform();
if ($platform->getAudience() !== $issuer) {
return null;
Expand All @@ -104,7 +104,7 @@ public function findByPlatformIssuer(string $issuer, string $clientId = null): ?
* @param string|null $clientId
* @return RegistrationInterface|null
*/
public function findByToolIssuer(string $issuer, string $clientId = null): ?RegistrationInterface {
public function findByToolIssuer(string $issuer, ?string $clientId = null): ?RegistrationInterface {
$tool = $this->registration->getTool();
if ($issuer !== $tool->getAudience()) {
return null;
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kialo/moodle-plugin",
"description": "Integrates Kialo Edu into Moodle",
"minimum-stability": "stable",
"minimum-stability": "dev",
"license": "GPL-3.0-or-later",
"authors": [
{
Expand All @@ -19,9 +19,9 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.7",
"moodlehq/moodle-cs": "^3.2",
"moodlehq/moodle-cs": "^3.4",
"phpunit/phpunit": "^9.6",
"friendsofphp/php-cs-fixer": "^3.25",
"friendsofphp/php-cs-fixer": "^3.58",
"phpro/grumphp-shim": "^1.13"
},
"config": {
Expand All @@ -40,7 +40,7 @@
"phpcs --config-set default_standard moodle"
],
"lint": [
"phpcs --standard=moodle --ignore=vendor,development .",
"phpcs --standard=moodle --ignore=vendor,development -s .",
"php-cs-fixer fix --dry-run --diff"
],
"fix": [
Expand Down
Loading

0 comments on commit 0b83ee7

Please sign in to comment.