| Conditions | 6 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 6.0208 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 29 | 4 | protected function initVariablesFromConfig() |
|
| 30 | { |
||
| 31 | 4 | if (!function_exists('config') |
|
| 32 | 4 | || !function_exists('app') |
|
| 33 | 4 | || !app()->has('config')) { |
|
| 34 | return; |
||
| 35 | } |
||
| 36 | |||
| 37 | 4 | $tries = [$this->getName(), $this->generateName()]; |
|
| 38 | 4 | foreach ($tries as $name) { |
|
| 39 | 4 | $configKey = 'media-library.contraints.' . $name; |
|
| 40 | 4 | if (config()->has($configKey)) { |
|
| 41 | 1 | $variables = config()->get($configKey); |
|
| 42 | 1 | $this->applyVariables($variables); |
|
| 43 | 1 | return; |
|
| 44 | } |
||
| 48 |