1616use phpbb \config \config ;
1717use phpbb \di \service_collection ;
1818use phpbb \filesystem \filesystem ;
19+ use phpbb \path_helper ;
1920use phpbb \skeleton \ext ;
2021use phpbb \skeleton \template \twig \extension \skeleton_version_compare ;
2122use phpbb \template \context ;
@@ -115,7 +116,7 @@ public function create_extension($data)
115116 $ filesystem ->remove ($ this ->root_path . 'store/tmp-ext ' );
116117 $ filesystem ->mkdir ($ ext_path );
117118
118- $ phpbb31 = (bool ) preg_match ('/^[\D] *3\.1.*$/ ' , $ data ['requirements ' ]['phpbb_version_min ' ]);
119+ $ phpbb_31 = (bool ) preg_match ('/^\D *3\.1.*$/ ' , $ data ['requirements ' ]['phpbb_version_min ' ]);
119120
120121 $ template = $ this ->get_template_engine ();
121122 $ template ->set_custom_style ('skeletonextension ' , $ this ->root_path . 'ext/phpbb/skeleton/skeleton ' );
@@ -124,8 +125,7 @@ public function create_extension($data)
124125 'EXTENSION ' => $ data ['extension ' ],
125126 'REQUIREMENTS ' => $ data ['requirements ' ],
126127 'AUTHORS ' => $ data ['authors ' ],
127- 'LANGUAGE ' => $ this ->get_language_version_data ($ phpbb31 ),
128- 'S_PHPBB_31 ' => $ phpbb31 ,
128+ 'LANGUAGE ' => $ this ->get_language_version_data ($ phpbb_31 ),
129129 ]);
130130
131131 $ component_data = $ this ->get_component_dialog_values ();
@@ -201,10 +201,13 @@ protected function get_template_engine()
201201 'assets_version ' => null ,
202202 ]);
203203
204+ /** @var path_helper $path_helper */
204205 $ path_helper = $ this ->phpbb_container ->get ('path_helper ' );
206+ /** @var filesystem $filesystem */
207+ $ filesystem = $ this ->phpbb_container ->get ('filesystem ' );
205208 $ environment = new environment (
206209 $ config ,
207- $ this -> phpbb_container -> get ( ' filesystem ' ) ,
210+ $ filesystem ,
208211 $ path_helper ,
209212 $ this ->phpbb_container ->getParameter ('core.cache_dir ' ),
210213 $ this ->phpbb_container ->get ('ext.manager ' ),
@@ -236,19 +239,19 @@ protected function get_template_engine()
236239 * Get an array of language class and methods depending on 3.1 or 3.2
237240 * compatibility, for use in the skeleton twig templates.
238241 *
239- * @param bool $phpbb31 Is phpBB 3.1 support requested?
242+ * @param bool $phpbb_31 Is phpBB 3.1 support requested?
240243 *
241244 * @return array An array of language data
242245 */
243- protected function get_language_version_data ($ phpbb31 )
246+ protected function get_language_version_data ($ phpbb_31 )
244247 {
245248 return [
246- 'class ' => $ phpbb31 ? '\phpbb\user ' : '\phpbb\language\language ' ,
247- 'object ' => $ phpbb31 ? 'user ' : 'language ' ,
248- 'function ' => $ phpbb31 ? 'add_lang_ext ' : 'add_lang ' ,
249+ 'class ' => $ phpbb_31 ? '\phpbb\user ' : '\phpbb\language\language ' ,
250+ 'object ' => $ phpbb_31 ? 'user ' : 'language ' ,
251+ 'function ' => $ phpbb_31 ? 'add_lang_ext ' : 'add_lang ' ,
249252 'indent ' => [
250- 'class ' => $ phpbb31 ? "\t\t\t" : '' ,
251- 'object ' => $ phpbb31 ? "\t" : '' ,
253+ 'class ' => $ phpbb_31 ? "\t\t\t" : '' ,
254+ 'object ' => $ phpbb_31 ? "\t" : '' ,
252255 ],
253256 ];
254257 }
0 commit comments