mirror of
https://github.com/jupeter/clean-code-php.git
synced 2025-09-27 14:38:59 +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:**
|
||||
|
||||
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.
|
||||
|
Reference in New Issue
Block a user