mirror of
https://github.com/jupeter/clean-code-php.git
synced 2025-09-27 22:49:01 +02:00
Merge pull request #97 from peter-gribanov/global_functions
Not use config.php file
This commit is contained in:
15
README.md
15
README.md
@@ -615,15 +615,6 @@ function config()
|
|||||||
|
|
||||||
**Good:**
|
**Good:**
|
||||||
|
|
||||||
Create PHP configuration file or something else
|
|
||||||
|
|
||||||
```php
|
|
||||||
// config.php
|
|
||||||
return [
|
|
||||||
'foo' => 'bar',
|
|
||||||
];
|
|
||||||
```
|
|
||||||
|
|
||||||
```php
|
```php
|
||||||
class Configuration
|
class Configuration
|
||||||
{
|
{
|
||||||
@@ -641,10 +632,12 @@ class Configuration
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Load configuration from file and create instance of `Configuration` class
|
Load configuration and create instance of `Configuration` class
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$configuration = new Configuration($configuration);
|
$configuration = new Configuration([
|
||||||
|
'foo' => 'bar',
|
||||||
|
]);
|
||||||
```
|
```
|
||||||
|
|
||||||
And now you must use instance of `Configuration` in your application.
|
And now you must use instance of `Configuration` in your application.
|
||||||
|
Reference in New Issue
Block a user