1
0
mirror of https://github.com/jupeter/clean-code-php.git synced 2025-09-28 06:59:00 +02:00

Merge pull request #97 from peter-gribanov/global_functions

Not use config.php file
This commit is contained in:
Tomáš Votruba
2017-09-08 21:51:06 +02:00
committed by GitHub

View File

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