Skip to content

Commit

Permalink
untouch static method call to prevent codacy fail
Browse files Browse the repository at this point in the history
- refactoring of static method use should be in a separate pull request
  • Loading branch information
david-fuehr committed Mar 20, 2019
1 parent e266d9a commit 83b34b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/internal/Magento/Framework/Validator/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Magento\Framework\Module\Dir\Reader;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Phrase;
use Magento\Framework\Validator;

/**
Expand Down Expand Up @@ -75,12 +76,12 @@ protected function _initializeDefaultTranslator()
// Pass translations to \Magento\Framework\TranslateInterface from validators
$translatorCallback = function () {
$argc = func_get_args();
return (string)new \Magento\Framework\Phrase(array_shift($argc), $argc);
return (string)new Phrase(array_shift($argc), $argc);
};
/** @var \Magento\Framework\Translate\Adapter $translator */
$translator = $this->_objectManager->create(\Magento\Framework\Translate\Adapter::class);
$translator->setOptions(['translator' => $translatorCallback]);
AbstractValidator::setDefaultTranslator($translator);
\Magento\Framework\Validator\AbstractValidator::setDefaultTranslator($translator);
$this->isDefaultTranslatorInitialized = true;
}
}
Expand Down

0 comments on commit 83b34b8

Please sign in to comment.