Development
Add New Debug Bar Collector
Create class in classes/local/debugbar/ extending DebugBar\DataCollector\DataCollector. Register it in debugbar::init_collectors().
Add New Linter
- Create class in
classes/local/lint/linters/extendinglint\linters\base. - Add
#[linter(name, description)]attribute. - Implement
get_name(),get_description(),get_include_patterns(),can_lint_file(),lint_file().
Add New MCP Tool
- Create class in
classes/local/mcp/tools/. - Add
#[McpTool(name, description)]attribute. - Register in MCP server tool list.
Tests
Run PHPUnit tests:
php admin/tool/phpunit/cli/init.php # if not done
php vendor/bin/phpunit --testsuite local_devkit_testsuiteTest files in tests/.
Build
Create distributable zip:
bash scripts/build.shOutput: dist/local_devkit.zip. Includes: classes/, db/, demo/, lang/, version.php, vendor/, README.md.
CI
GitHub Actions workflow (.github/workflows/moodle-ci.yaml) tests:
- PHP 8.3, 8.4
- Moodle 4.05, 5.00, 5.01, 5.02
- MariaDB
- PHP Lint, PHPMD, PHPCS, PHPDoc, Validate, Savepoints, Mustache, Grunt, PHPUnit, Behat
- Builds + uploads zip on push to
main.
PHPStan
phpstan analyze -c phpstan.neonLevel 8. Config at phpstan.neon.dist (extend in phpstan.neon with rootDirectory set to Moodle root).
Code Style
Moodle coding standards enforced by PHPCS linter.