From 3cc753eeff3ed1bcf1d66e38bbbcd87a3b66d1af Mon Sep 17 00:00:00 2001 From: tfrommen Date: Thu, 28 Mar 2024 09:21:10 +0100 Subject: [PATCH] Update and improve docs --- README.md | 5 +++-- docs/Modules.md | 4 ++-- docs/Package.md | 16 ++++++++-------- docs/README.md | 6 +++--- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 697882d..d357e1f 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Themes or Libraries. ## Installation -``` -$ composer require inpsyde/modularity +```shell +composer require inpsyde/modularity ``` ## Minimum Requirements and Dependencies @@ -36,6 +36,7 @@ When installed for development via Composer, the package also requires: 2. [PSR-11 Container](docs/PSR-11-Container.md) 3. [Modules](docs/Modules.md) 4. [Properties](docs/Properties.md) +5. [Application Flow](docs/Application-flow.md) ## License diff --git a/docs/Modules.md b/docs/Modules.md index ea0c7ad..c980f36 100644 --- a/docs/Modules.md +++ b/docs/Modules.md @@ -12,7 +12,7 @@ Inpsyde\Modularity\Package::new($properties) ->addModule(new ModuleWhichProvidesFactories()) ->addModule(new ModuleWhichProviedsExtensions()) ->addModule(new ModuleWhichIsExecuted()) - ->boot(); + ->boot(); ``` Each Module implementation will extend the basic `Module`-interface which is required to define a `Module::id(): string`. This identifier will be re-used in Package-class to keep track of the current state of your Module and will allow easier debugging of your Application. To avoid defining this by hand, it is possible to use the following Trait: `Inpsyde\Modularity\Module\ModuleClassNameIdTrait` @@ -161,6 +161,7 @@ class ModuleFour implements ExecutableModule } } ``` + ### Service/Factory overrides When the same Service id is registered more than once by multiple modules, the latter will override the former. @@ -210,4 +211,3 @@ original. *For package maintainers* this is something to watch out for when consuming Modules from multiple sources. However unlikely it may be, there is a risk of _unintentional_ overrides resulting in unexpected behaviour. - diff --git a/docs/Package.md b/docs/Package.md index f20751b..b25fdef 100644 --- a/docs/Package.md +++ b/docs/Package.md @@ -95,10 +95,10 @@ function plugin(): Modularity\Package { } add_action( - 'plugins_loaded', - static function(): void { - plugin()->boot(); - } + 'plugins_loaded', + static function(): void { + plugin()->boot(); + } ); ``` @@ -178,10 +178,10 @@ as in: ```php add_action( - 'plugins_loaded', - static function(): void { - plugin()->boot(new ModuleOne(), new ModuleTwo()); - } + 'plugins_loaded', + static function(): void { + plugin()->boot(new ModuleOne(), new ModuleTwo()); + } ); ``` diff --git a/docs/README.md b/docs/README.md index 13277fc..a5b2bf9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,8 +16,8 @@ inpsyde/modularity is a modular [PSR-11](https://github.com/php-fig/container) i ## Installation -``` -$ composer require inpsyde/modularity +```shell +composer require inpsyde/modularity ``` @@ -38,4 +38,4 @@ When installed for development, via Composer, the package also requires: ## License -This repository is a free software, and is released under the terms of the GNU General Public License version 2 or (at your option) any later version. See [LICENSE]((LICENSE) for complete license. +This repository is a free software, and is released under the terms of the GNU General Public License version 2 or (at your option) any later version. See [LICENSE](https://github.com/inpsyde/modularity/blob/master/LICENSE) for complete license.