diff --git a/.distignore b/.distignore index 2dd89892..b04108e5 100644 --- a/.distignore +++ b/.distignore @@ -25,4 +25,5 @@ phpdoc.xml phpstan.neon phpunit.xml playwright.config.ts -setup.sh \ No newline at end of file +setup.sh +plantuml_gist.puml \ No newline at end of file diff --git a/Diagrams.md b/Diagrams.md new file mode 100644 index 00000000..a9a779e2 --- /dev/null +++ b/Diagrams.md @@ -0,0 +1,5 @@ +# Diagrams + +Infrastructural overview about the plugin's PHP classes: + +![PlantUML class diagram](https://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/lloc/multisite-language-switcher/master/plantuml_gist.puml) \ No newline at end of file diff --git a/README.md b/README.md index fc6395e7..20b016f0 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ If you plan to use the GitHub repository on a server, don't forget to run `compo the_msls(); } ``` -Review the [Multisite Language Switcher Website](http://msls.co/) for more information. +Review the [Multisite Language Switcher Website](http://msls.co/) for more information. Some [diagrams](https://github.com/lloc/Multisite-Language-Switcher/blob/master/Diagrams.md) are also available. ## Acknowledgements diff --git a/composer.json b/composer.json index 5f315ca2..64f41aca 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ "antecedent/patchwork": "^2.1", "squizlabs/php_codesniffer": "^3.9", "phpcompatibility/php-compatibility": "^9.3", - "wp-coding-standards/wpcs": "^3.0" + "wp-coding-standards/wpcs": "^3.0", + "smeghead/php-class-diagram": "^1.3" }, "autoload": { "psr-4": { @@ -41,6 +42,7 @@ "prepare": "wget -O build/translations.json http://api.wordpress.org/translations/core/1.0/", "flags-png": "php bin/flags-png.php > flags/flags.php", "flags-svg": "php bin/flags-svg.php > css/flags.php", + "diagram": "vendor/bin/php-class-diagram --php7 includes > plantuml_gist.puml", "githooks": [ "if [ -e ./githooks/pre-commit ]; then cp ./githooks/pre-commit ./.git/hooks/; fi", "if [ -e ./.git/hooks/pre-commit ]; then chmod 0755 ./.git/hooks/pre-commit; fi"