Rename PHP notes

This commit is contained in:
Marcello 2021-06-23 17:36:12 +02:00
parent 085535d05e
commit 68723844c3
7 changed files with 3 additions and 5 deletions

View file

@ -1,6 +1,4 @@
# Dependency Injection (PHP-DI), KISS, SOLID # Dependency Injection
## Dependency Injection
Explicit definition of a class dependencies with the injection through the constructor or *getters*/*setters*. Explicit definition of a class dependencies with the injection through the constructor or *getters*/*setters*.
@ -14,7 +12,7 @@ class Foo
} }
``` ```
### Dependency Injection Container ## Dependency Injection Container
The **Dependecy Injection Container** (DIC) allow to archive all the dependencies in a single `Container` class. Some offer automatic resolution of the dependecies. The **Dependecy Injection Container** (DIC) allow to archive all the dependencies in a single `Container` class. Some offer automatic resolution of the dependecies.
Containers aid the developer in the handling of the dependecies: get/has/set. Containers aid the developer in the handling of the dependecies: get/has/set.
@ -43,7 +41,7 @@ $container = new DI\Container(); // DI Container
$foo = $container->get('Foo'); // get instance of Foo (automatic DI of Bar) $foo = $container->get('Foo'); // get instance of Foo (automatic DI of Bar)
``` ```
## DIC Configuration ### DIC Configuration
```php ```php
// Foo.php // Foo.php