diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-09-03 04:51:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 04:51:18 +0300 |
commit | 3565da78bff718f201247fc2f692c0be29220fde (patch) | |
tree | e8268373b284c293c307935a8bfa20d5cd920b48 /config/environment | |
parent | 21cafb0533d07acbe0a574e23bd972b20d72aa90 (diff) |
Updates php-di to 6.2.1 (#16311)
Diffstat (limited to 'config/environment')
-rw-r--r-- | config/environment/dev.php | 8 | ||||
-rw-r--r-- | config/environment/test.php | 18 | ||||
-rw-r--r-- | config/environment/ui-test.php | 8 |
3 files changed, 17 insertions, 17 deletions
diff --git a/config/environment/dev.php b/config/environment/dev.php index f0d1514d17..0b3109e9d1 100644 --- a/config/environment/dev.php +++ b/config/environment/dev.php @@ -2,11 +2,11 @@ return array( - 'Matomo\Cache\Backend' => DI\object('Matomo\Cache\Backend\ArrayCache'), + 'Matomo\Cache\Backend' => DI\autowire('Matomo\Cache\Backend\ArrayCache'), - 'Piwik\Translation\Loader\LoaderInterface' => DI\object('Piwik\Translation\Loader\LoaderCache') - ->constructor(DI\get('Piwik\Translation\Loader\DevelopmentLoader')), - 'Piwik\Translation\Loader\DevelopmentLoader' => DI\object() + 'Piwik\Translation\Loader\LoaderInterface' => DI\autowire('Piwik\Translation\Loader\LoaderCache') + ->constructorParameter('loader', DI\get('Piwik\Translation\Loader\DevelopmentLoader')), + 'Piwik\Translation\Loader\DevelopmentLoader' => DI\create() ->constructor(DI\get('Piwik\Translation\Loader\JsonFileLoader')), ); diff --git a/config/environment/test.php b/config/environment/test.php index 13c5c390cd..63af43d95b 100644 --- a/config/environment/test.php +++ b/config/environment/test.php @@ -1,6 +1,6 @@ <?php -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use Piwik\Common; use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\Mock\TestConfig; @@ -98,29 +98,29 @@ return array( 'observers.global' => DI\add(array( - array('AssetManager.getStylesheetFiles', function (&$stylesheets) { + array('AssetManager.getStylesheetFiles', DI\value(function (&$stylesheets) { $useOverrideCss = \Piwik\Container\StaticContainer::get('test.vars.useOverrideCss'); if ($useOverrideCss) { $stylesheets[] = 'tests/resources/screenshot-override/override.css'; } - }), + })), - array('AssetManager.getJavaScriptFiles', function (&$jsFiles) { + array('AssetManager.getJavaScriptFiles', DI\value(function (&$jsFiles) { $useOverrideJs = \Piwik\Container\StaticContainer::get('test.vars.useOverrideJs'); if ($useOverrideJs) { $jsFiles[] = 'tests/resources/screenshot-override/override.js'; } - }), + })), - array('Updater.checkForUpdates', function () { + array('Updater.checkForUpdates', \DI\value(function () { try { @\Piwik\Filesystem::deleteAllCacheOnUpdate(); } catch (Exception $ex) { // pass } - }), + })), - array('Test.Mail.send', function (\PHPMailer\PHPMailer\PHPMailer $mail) { + array('Test.Mail.send', \DI\value(function (\PHPMailer\PHPMailer\PHPMailer $mail) { $outputFile = PIWIK_INCLUDE_PATH . '/tmp/' . Common::getRequestVar('module', '') . '.' . Common::getRequestVar('action', '') . '.mail.json'; $outputContent = str_replace("=\n", "", $mail->Body ?: $mail->AltBody); $outputContent = str_replace("=0A", "\n", $outputContent); @@ -132,6 +132,6 @@ return array( 'contents' => $outputContent ); file_put_contents($outputFile, json_encode($outputContents)); - }), + })), )), ); diff --git a/config/environment/ui-test.php b/config/environment/ui-test.php index 8b46ede218..aae19a5bb6 100644 --- a/config/environment/ui-test.php +++ b/config/environment/ui-test.php @@ -21,7 +21,7 @@ return array( // removes port from all URLs to the test Piwik server so UI tests will pass no matter // what port is used - array('Request.dispatch.end', function (&$result) { + array('Request.dispatch.end', DI\value(function (&$result) { $request = $_GET + $_POST; $apiblacklist = StaticContainer::get('tests.ui.url_normalizer_blacklist.api'); @@ -50,11 +50,11 @@ return array( // remove PIWIK_INCLUDE_PATH from result so tests don't change based on the machine used $result = str_replace(realpath(PIWIK_INCLUDE_PATH), '', $result); - }), + })), - array('Controller.RssWidget.rssPiwik.end', function (&$result, $parameters) { + array('Controller.RssWidget.rssPiwik.end', DI\value(function (&$result, $parameters) { $result = ""; - }), + })), \Piwik\Tests\Framework\XssTesting::getJavaScriptAddEvent(), ]), |