diff --git a/public/lib/phpspreadsheet/markbaker/complex/readme_moodle.md b/public/lib/phpspreadsheet/markbaker/complex/readme_moodle.md
new file mode 100644
index 00000000000..f726baf53a3
--- /dev/null
+++ b/public/lib/phpspreadsheet/markbaker/complex/readme_moodle.md
@@ -0,0 +1,23 @@
+# PHPComplex (markbaker/complex)
+
+## Upgrade
+
+1. Run the following commands:
+
+```sh
+installdir=$(mktemp -d)
+cd "$installdir"
+composer require markbaker/complex
+
+cd -
+rm -rf public/lib/phpspreadsheet/markbaker/complex/classes
+cp -rf "$installdir"/vendor/markbaker/complex/classes public/lib/phpspreadsheet/markbaker/complex/classes
+cp -f "$installdir"/vendor/markbaker/complex/composer.json public/lib/phpspreadsheet/markbaker/complex/composer.json
+cp -f "$installdir"/vendor/markbaker/complex/license.md public/lib/phpspreadsheet/markbaker/complex/license.md
+
+git add public/lib/phpspreadsheet/markbaker/complex
+rm -rf "$installdir"
+```
+
+2. Review the changes.
+3. Update the version in `public/lib/thirdpartylibs.xml`.
diff --git a/public/lib/thirdpartylibs.xml b/public/lib/thirdpartylibs.xml
index 6eb3d1f187d..17d5060268f 100644
--- a/public/lib/thirdpartylibs.xml
+++ b/public/lib/thirdpartylibs.xml
@@ -74,7 +74,7 @@
phpspreadsheet/markbaker/complex
PHPComplex
PHP Class Library for working with Complex numbers.
- 3.0.1
+ 3.0.2
MIT
https://github.com/MarkBaker/PHPComplex