@@ -33,7 +33,7 @@ class ClassAliasMapGenerator
3333 /**
3434 * @var IOInterface
3535 */
36- protected $ IO ;
36+ protected $ io ;
3737
3838 /**
3939 * @var bool
@@ -42,13 +42,13 @@ class ClassAliasMapGenerator
4242
4343 /**
4444 * @param Composer $composer
45- * @param IOInterface $IO
45+ * @param IOInterface $io
4646 * @param bool $optimizeAutoloadFiles
4747 */
48- public function __construct (Composer $ composer , IOInterface $ IO = null , $ optimizeAutoloadFiles = false )
48+ public function __construct (Composer $ composer , IOInterface $ io = null , $ optimizeAutoloadFiles = false )
4949 {
5050 $ this ->composer = $ composer ;
51- $ this ->IO = $ IO ?: new NullIO ();
51+ $ this ->io = $ io ?: new NullIO ();
5252 $ this ->optimizeAutoloadFiles = $ optimizeAutoloadFiles ;
5353 }
5454
@@ -79,15 +79,15 @@ public function generateAliasMap()
7979 foreach ($ packageMap as $ item ) {
8080 /** @var PackageInterface $package */
8181 list ($ package , $ installPath ) = $ item ;
82- $ aliasLoaderConfig = new \TYPO3 \ClassAliasLoader \Config ($ package , $ this ->IO );
82+ $ aliasLoaderConfig = new \TYPO3 \ClassAliasLoader \Config ($ package , $ this ->io );
8383 if ($ aliasLoaderConfig ->get ('class-alias-maps ' ) !== null ) {
8484 if (!is_array ($ aliasLoaderConfig ->get ('class-alias-maps ' ))) {
8585 throw new \Exception ('Configuration option "class-alias-maps" must be an array ' );
8686 }
8787 foreach ($ aliasLoaderConfig ->get ('class-alias-maps ' ) as $ mapFile ) {
8888 $ mapFilePath = ($ installPath ?: $ basePath ) . '/ ' . $ filesystem ->normalizePath ($ mapFile );
8989 if (!is_file ($ mapFilePath )) {
90- $ this ->IO ->writeError (sprintf ('The class alias map file "%s" configured in package "%s" was not found! ' , $ mapFile , $ package ->getName ()));
90+ $ this ->io ->writeError (sprintf ('The class alias map file "%s" configured in package "%s" was not found! ' , $ mapFile , $ package ->getName ()));
9191 } else {
9292 $ packageAliasMap = require $ mapFilePath ;
9393 if (!is_array ($ packageAliasMap )) {
@@ -117,7 +117,7 @@ public function generateAliasMap()
117117 }
118118
119119 $ caseSensitiveClassLoadingString = $ caseSensitiveClassLoading ? 'true ' : 'false ' ;
120- $ this ->IO ->write ('<info>Generating ' . ($ classAliasMappingFound ? '' : 'empty ' ) . 'class alias map file</info> ' );
120+ $ this ->io ->write ('<info>Generating ' . ($ classAliasMappingFound ? '' : 'empty ' ) . 'class alias map file</info> ' );
121121 $ this ->generateAliasMapFile ($ aliasToClassNameMapping , $ classNameToAliasMapping , $ targetDir );
122122
123123 $ suffix = null ;
@@ -165,14 +165,14 @@ public static function initializeClassAliasLoader(\$composerClassLoader) {
165165 file_put_contents ($ targetDir . '/autoload_alias_loader_real.php ' , $ aliasLoaderInitClassContent );
166166
167167 if (!$ caseSensitiveClassLoading ) {
168- $ this ->IO ->write ('<info>Re-writing class map to support case insensitive class loading</info> ' );
168+ $ this ->io ->write ('<info>Re-writing class map to support case insensitive class loading</info> ' );
169169 if (!$ this ->optimizeAutoloadFiles ) {
170- $ this ->IO ->write ('<warning>Case insensitive class loading only works reliably if you use the optimize class loading feature of composer</warning> ' );
170+ $ this ->io ->write ('<warning>Case insensitive class loading only works reliably if you use the optimize class loading feature of composer</warning> ' );
171171 }
172172 $ this ->rewriteClassMapWithLowerCaseClassNames ($ targetDir );
173173 }
174174
175- $ this ->IO ->write ('<info>Inserting class alias loader into main autoload.php file</info> ' );
175+ $ this ->io ->write ('<info>Inserting class alias loader into main autoload.php file</info> ' );
176176 $ this ->modifyMainAutoloadFile ($ vendorPath . '/autoload.php ' , $ suffix );
177177
178178 return true ;
@@ -200,7 +200,6 @@ protected function modifyMainAutoloadFile($autoloadFile, $suffix)
200200EOF ;
201201
202202 file_put_contents ($ autoloadFile , $ autoloadFileContent );
203-
204203 }
205204
206205 /**
@@ -237,18 +236,17 @@ protected function rewriteClassMapWithLowerCaseClassNames($targetDir)
237236 file_put_contents ($ targetDir . '/autoload_classmap.php ' , $ classMapContents );
238237 }
239238
240-
241239 /**
242- * Extracts the bas path out of composer config
240+ * Extracts the base path out of composer config
243241 *
244242 * @param \Composer\Config $config
245243 * @return mixed
246244 */
247- protected function extractBasePath (\Composer \Config $ config ) {
245+ protected function extractBasePath (\Composer \Config $ config )
246+ {
248247 $ reflectionClass = new \ReflectionClass ($ config );
249248 $ reflectionProperty = $ reflectionClass ->getProperty ('baseDir ' );
250249 $ reflectionProperty ->setAccessible (true );
251250 return $ reflectionProperty ->getValue ($ config );
252251 }
253-
254252}
0 commit comments