1
0
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:
Tomáš Votruba
2017-09-08 21:51:06 +02:00
committed by GitHub

View File

@@ -615,15 +615,6 @@ function config()
**Good:**
Create PHP configuration file or something else
```php
// config.php
return [
'foo' => 'bar',
];
```
```php
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
$configuration = new Configuration($configuration);
$configuration = new Configuration([
'foo' => 'bar',
]);
```
And now you must use instance of `Configuration` in your application.