Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function onBeforeInit() |
||
21 | { |
||
22 | $tests = Environment::getEnv('UNIT_TESTS_RUNNING'); |
||
23 | $disallowed_controllers = [ |
||
24 | DevelopmentAdmin::class, |
||
25 | DevBuildController::class, |
||
26 | DatabaseAdmin::class |
||
27 | ]; |
||
28 | |||
29 | // Don't run this during dev/build or dev/tasks or when unit tests are running |
||
30 | if (!$tests && !in_array(get_class($this->owner), $disallowed_controllers)) { |
||
31 | // Set global local based on Site Config |
||
32 | $config = SiteConfig::current_site_config(); |
||
33 | i18n::set_locale($config->SiteLocale); |
||
34 | |||
35 | // Now find and set the desired currency symbol |
||
36 | $number_format = new NumberFormatter($config->SiteLocale, NumberFormatter::CURRENCY); |
||
37 | $symbol = $number_format->getSymbol(NumberFormatter::CURRENCY_SYMBOL); |
||
38 | DBCurrency::config()->currency_symbol = $symbol; |
||
39 | } |
||
41 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths