1616use Symfony \Component \Console \Input \InputInterface ;
1717use Symfony \Component \Console \Output \OutputInterface ;
1818use Symfony \Component \Console \Style \SymfonyStyle ;
19- use Symfony \Component \DependencyInjection \ContainerInterface ;
19+ use Symfony \Component \DependencyInjection \ParameterBag \ ParameterBagInterface ;
2020use Symfony \Component \Translation \Translator ;
2121use Symfony \Contracts \Translation \TranslatorInterface ;
2222
@@ -47,7 +47,7 @@ class MigrateToDatabaseCommand extends Command
4747 protected static $ defaultName = 'creative:db-i18n:migrate ' ;
4848
4949 /**
50- * @var ContainerInterface
50+ * @var ParameterBagInterface
5151 */
5252 private $ container ;
5353
@@ -74,17 +74,17 @@ class MigrateToDatabaseCommand extends Command
7474 /**
7575 * MigrateToDatabaseCommand constructor.
7676 *
77- * @param ContainerInterface $container
78- * @param TranslatorInterface $translator
79- * @param ManagerRegistry $doctrine
80- * @param string|null $name
77+ * @param ParameterBagInterface $container
78+ * @param TranslatorInterface $translator
79+ * @param ManagerRegistry $doctrine
80+ * @param string|null $name
8181 */
82- public function __construct (ContainerInterface $ container , TranslatorInterface $ translator , ManagerRegistry $ doctrine , string $ name = null )
82+ public function __construct (ParameterBagInterface $ container , TranslatorInterface $ translator , ManagerRegistry $ doctrine , string $ name = null )
8383 {
8484 parent ::__construct ($ name );
8585 $ this ->container = $ container ;
8686 $ this ->translator = $ translator ;
87- $ this ->entityClass = $ this ->container ->getParameter ('db_i18n.entity ' );
87+ $ this ->entityClass = $ this ->container ->get ('db_i18n.entity ' );
8888 $ this ->doctrine = $ doctrine ;
8989 }
9090
@@ -113,7 +113,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
113113 throw new RuntimeException ('Translator service of application has no \'getCatalogue \' method ' );
114114 }
115115
116- if (!$ this ->container ->hasParameter ('locales ' ) || !is_array ($ this ->container ->getParameter ('locales ' ))) {
116+ if (!$ this ->container ->has ('locales ' ) || !is_array ($ this ->container ->get ('locales ' ))) {
117117 throw new RuntimeException ('Application container must have a \'locales \' parameter, and this parameter must be an array ' );
118118 }
119119
@@ -125,7 +125,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
125125 $ catalogue = $ this ->translator ->getCatalogue ($ locale );
126126
127127 $ forExport = $ catalogue ->all ($ domain );
128- $ exported = $ this ->exportToDatabase ($ forExport , $ locale , $ this ->container ->getParameter ('db_i18n.domain ' ));
128+ $ exported = $ this ->exportToDatabase ($ forExport , $ locale , $ this ->container ->get ('db_i18n.domain ' ));
129129
130130 $ io ->writeln (sprintf (
131131 'Loaded form %s: %u messages, exported to database: %s ' ,
@@ -210,7 +210,7 @@ protected function checkEntityExists(string $locale, string $key): EntityInterfa
210210 */
211211 protected function getLocale (string $ filename ): ?string
212212 {
213- $ locales = $ this ->container ->getParameter ('locales ' );
213+ $ locales = $ this ->container ->get ('locales ' );
214214 $ locale = null ;
215215 foreach ($ locales as $ localeParam ) {
216216 if (strpos ($ filename , $ localeParam ) !== false ) {
@@ -236,7 +236,7 @@ protected function locateFile(string $path): string
236236 if (strpos ($ path , '/ ' ) === 0 ) {
237237 $ realPath = $ path ;
238238 } else {
239- $ realPath = $ this ->container ->getParameter ('kernel.root_dir ' ) . '/../ ' . $ path ;
239+ $ realPath = $ this ->container ->get ('kernel.root_dir ' ) . '/../ ' . $ path ;
240240 }
241241
242242 if (!is_file ($ realPath ) || !is_readable ($ realPath )) {
0 commit comments