Skip to content

Commit

Permalink
Rename parameters to application-params. (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 1, 2023
1 parent cf9ad06 commit f590c7b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
4 changes: 1 addition & 3 deletions composer.json
Expand Up @@ -50,11 +50,9 @@
"source-directory": "config"
},
"config-plugin": {
"application-params": "?application-params.php",
"common": [
"common/*.php"
],
"parameters": [
"?parameters.php"
]
}
},
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions config/common/parameter-services.php
Expand Up @@ -9,8 +9,6 @@
return [
ParameterService::class => [
'class' => ParameterService::class,
'__construct()' => [
$config->get('parameters'),
],
'__construct()' => [$config->get('application-params')],
],
];
6 changes: 3 additions & 3 deletions docs/index.md
Expand Up @@ -53,12 +53,12 @@ final class ContactController

## Parameter service

The parameter service will help you to get parameters from the configuration file `config/parameters.php`.
The parameter service will help you to get parameters from the configuration file `config/application-params.php`.

Define parameters in the configuration file `config/parameters.php`:
Define parameters in the configuration file `config/application-params.php`:

```php
file: `config/parameters.php`
file: `config/application-params.php`

<?php

Expand Down
24 changes: 11 additions & 13 deletions tests/Support/TestTrait.php
Expand Up @@ -125,9 +125,7 @@ private function config(): array

ParameterService::class => [
'class' => ParameterService::class,
'__construct()' => [
$this->parameters(),
],
'__construct()' => [$this->applicationParams()],
],

TranslatorInterface::class => [
Expand Down Expand Up @@ -164,6 +162,16 @@ private function config(): array
];
}

private function applicationParams(): array
{
return [
'app' => [
'name' => 'Yii Demo',
'adminEmail' => 'test@example.com',
],
];
}

private function params(): array
{
return [
Expand All @@ -188,14 +196,4 @@ private function params(): array
],
];
}

private function parameters(): array
{
return [
'app' => [
'name' => 'Yii Demo',
'adminEmail' => 'test@example.com',
],
];
}
}

0 comments on commit f590c7b

Please sign in to comment.