Skip to content

Commit 8b11806

Browse files
committed
Remove unused code
Fix some minor code inspection issues Fix PHP 8 issue Fix
1 parent 816c946 commit 8b11806

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
],
2121
"require": {
2222
"php": ">=5.6",
23-
"composer/installers": "~1.0"
23+
"composer/installers": "~1.0",
24+
"ext-zip": "*"
2425
},
2526
"require-dev": {
2627
"phing/phing": "~2.4"

helper/packager.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use phpbb\config\config;
1717
use phpbb\di\service_collection;
1818
use phpbb\filesystem\filesystem;
19+
use phpbb\path_helper;
1920
use phpbb\skeleton\ext;
2021
use phpbb\skeleton\template\twig\extension\skeleton_version_compare;
2122
use 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

Comments
 (0)