1212namespace Symfony \Component \Intl \Data \Generator ;
1313
1414use Symfony \Component \Filesystem \Filesystem ;
15- use Symfony \Component \Intl \Data \Bundle \Compiler \GenrbCompiler ;
16- use Symfony \Component \Intl \Data \Bundle \Reader \BundleReaderInterface ;
15+ use Symfony \Component \Intl \Data \Bundle \Compiler \BundleCompilerInterface ;
16+ use Symfony \Component \Intl \Data \Bundle \Reader \BundleEntryReader ;
17+ use Symfony \Component \Intl \Data \Bundle \Reader \BundleEntryReaderInterface ;
1718use Symfony \Component \Intl \Data \Bundle \Reader \IntlBundleReader ;
1819use Symfony \Component \Intl \Data \Util \LocaleScanner ;
1920
@@ -29,7 +30,7 @@ abstract class AbstractDataGenerator
2930 private $ compiler ;
3031 private $ dirName ;
3132
32- public function __construct (GenrbCompiler $ compiler , $ dirName )
33+ public function __construct (BundleCompilerInterface $ compiler , $ dirName )
3334 {
3435 $ this ->compiler = $ compiler ;
3536 $ this ->dirName = (string ) $ dirName ;
@@ -39,7 +40,7 @@ public function generateData(GeneratorConfig $config)
3940 {
4041 $ filesystem = new Filesystem ();
4142 $ localeScanner = new LocaleScanner ();
42- $ reader = new IntlBundleReader ();
43+ $ reader = new BundleEntryReader ( new IntlBundleReader () );
4344
4445 $ writers = $ config ->getBundleWriters ();
4546 $ tempDir = sys_get_temp_dir ().'/icu-data- ' .$ this ->dirName ;
@@ -98,36 +99,32 @@ public function generateData(GeneratorConfig $config)
9899 abstract protected function scanLocales (LocaleScanner $ scanner , $ sourceDir );
99100
100101 /**
101- * @param GenrbCompiler $compiler
102- * @param string $sourceDir
103- * @param string $tempDir
102+ * @param string $sourceDir
103+ * @param string $tempDir
104104 */
105- abstract protected function compileTemporaryBundles (GenrbCompiler $ compiler , $ sourceDir , $ tempDir );
105+ abstract protected function compileTemporaryBundles (BundleCompilerInterface $ compiler , $ sourceDir , $ tempDir );
106106
107107 abstract protected function preGenerate ();
108108
109109 /**
110- * @param BundleReaderInterface $reader
111- * @param string $tempDir
112- * @param string $displayLocale
110+ * @param string $tempDir
111+ * @param string $displayLocale
113112 *
114113 * @return array|null
115114 */
116- abstract protected function generateDataForLocale (BundleReaderInterface $ reader , $ tempDir , $ displayLocale );
115+ abstract protected function generateDataForLocale (BundleEntryReaderInterface $ reader , $ tempDir , $ displayLocale );
117116
118117 /**
119- * @param BundleReaderInterface $reader
120- * @param string $tempDir
118+ * @param string $tempDir
121119 *
122120 * @return array|null
123121 */
124- abstract protected function generateDataForRoot (BundleReaderInterface $ reader , $ tempDir );
122+ abstract protected function generateDataForRoot (BundleEntryReaderInterface $ reader , $ tempDir );
125123
126124 /**
127- * @param BundleReaderInterface $reader
128- * @param string $tempDir
125+ * @param string $tempDir
129126 *
130127 * @return array|null
131128 */
132- abstract protected function generateDataForMeta (BundleReaderInterface $ reader , $ tempDir );
129+ abstract protected function generateDataForMeta (BundleEntryReaderInterface $ reader , $ tempDir );
133130}
0 commit comments