Skip to content

Commit

Permalink
Update and improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrommen committed Mar 28, 2024
1 parent ef0143d commit 3cc753e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Themes or Libraries.

## Installation

```
$ composer require inpsyde/modularity
```shell
composer require inpsyde/modularity
```

## Minimum Requirements and Dependencies
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

16 changes: 8 additions & 8 deletions docs/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ function plugin(): Modularity\Package {
}

add_action(
'plugins_loaded',
static function(): void {
plugin()->boot();
}
'plugins_loaded',
static function(): void {
plugin()->boot();
}
);
```

Expand Down Expand Up @@ -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());
}
);
```

Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```


Expand All @@ -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.

0 comments on commit 3cc753e

Please sign in to comment.