Skip to content

Commit fabe248

Browse files
committed
Merge branch 'master' into dev/4.0
2 parents 71cf854 + 7ac0db1 commit fabe248

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

ext.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
class ext extends \phpbb\extension\base
1717
{
18-
const DEFAULT_PHP = '7.1.3';
19-
const DEFAULT_PHPBB_MIN = '3.3.0';
20-
const DEFAULT_PHPBB_MAX = '4.0.0@dev';
18+
public const DEFAULT_SKELETON_PHP = '7.1.3';
19+
public const DEFAULT_SKELETON_PHPBB_MIN = '3.3.0';
20+
public const DEFAULT_SKELETON_PHPBB_MAX = '4.0.0@dev';
2121

22-
const REQUIRE_PHPBB_MIN = '4.0.0-dev';
23-
const REQUIRE_PHP = 80100;
22+
public const MIN_PHPBB_ALLOWED = '4.0.0-dev';
23+
public const MIN_PHP_ALLOWED = 80100;
2424

2525
/**
2626
* @var array An array of installation error messages
@@ -50,7 +50,7 @@ public function is_enableable()
5050
*/
5151
protected function phpbb_requirement($phpBB_version = PHPBB_VERSION)
5252
{
53-
if (phpbb_version_compare($phpBB_version, self::REQUIRE_PHPBB_MIN, '<'))
53+
if (phpbb_version_compare($phpBB_version, self::MIN_PHPBB_ALLOWED, '<'))
5454
{
5555
$this->errors[] = 'PHPBB_VERSION_ERROR';
5656
}
@@ -64,7 +64,7 @@ protected function phpbb_requirement($phpBB_version = PHPBB_VERSION)
6464
*/
6565
protected function php_requirement($php_version = PHP_VERSION_ID)
6666
{
67-
if ($php_version < self::REQUIRE_PHP)
67+
if ($php_version < self::MIN_PHP_ALLOWED)
6868
{
6969
$this->errors[] = 'PHP_VERSION_ERROR';
7070
}

helper/packager.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use phpbb\config\config;
1717
use phpbb\di\service_collection;
1818
use phpbb\filesystem\filesystem;
19-
use phpbb\path_helper;
2019
use phpbb\skeleton\ext;
2120
use phpbb\skeleton\template\twig\extension\skeleton_version_compare;
2221
use phpbb\template\context;
@@ -75,9 +74,9 @@ public function get_composer_dialog_values()
7574
'extension_homepage' => null,
7675
],
7776
'requirements' => [
78-
'php_version' => '>=' . ext::DEFAULT_PHP,
79-
'phpbb_version_min' => '>=' . ext::DEFAULT_PHPBB_MIN,
80-
'phpbb_version_max' => '<' . ext::DEFAULT_PHPBB_MAX,
77+
'php_version' => '>=' . ext::DEFAULT_SKELETON_PHP,
78+
'phpbb_version_min' => '>=' . ext::DEFAULT_SKELETON_PHPBB_MIN,
79+
'phpbb_version_max' => '<' . ext::DEFAULT_SKELETON_PHPBB_MAX,
8180
],
8281
];
8382
}
@@ -224,8 +223,8 @@ protected function get_template_engine()
224223
$config,
225224
new context(),
226225
$environment,
227-
$this->phpbb_container->getParameter('core.cache_dir'),
228-
$this->phpbb_container->get('user'),
226+
$cache_dir,
227+
$container->get('user'),
229228
[
230229
new skeleton_version_compare()
231230
]

language/en/common.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@
7070

7171
'SKELETON_QUESTION_PHP_VERSION' => 'Please enter the PHP requirement of the extension',
7272
'SKELETON_QUESTION_PHP_VERSION_UI' => 'PHP requirement of the extension',
73-
'SKELETON_QUESTION_PHP_VERSION_EXPLAIN' => 'default: &gt;=' . \phpbb\skeleton\ext::DEFAULT_PHP,
73+
'SKELETON_QUESTION_PHP_VERSION_EXPLAIN' => 'default: &gt;=' . \phpbb\skeleton\ext::DEFAULT_SKELETON_PHP,
7474
'SKELETON_QUESTION_PHPBB_VERSION_MIN' => 'Please enter the minimum phpBB requirement of the extension',
7575
'SKELETON_QUESTION_PHPBB_VERSION_MIN_UI' => 'Minimum phpBB requirement of the extension',
76-
'SKELETON_QUESTION_PHPBB_VERSION_MIN_EXPLAIN' => 'default: &gt;=' . \phpbb\skeleton\ext::DEFAULT_PHPBB_MIN,
76+
'SKELETON_QUESTION_PHPBB_VERSION_MIN_EXPLAIN' => 'default: &gt;=' . \phpbb\skeleton\ext::DEFAULT_SKELETON_PHPBB_MIN,
7777
'SKELETON_QUESTION_PHPBB_VERSION_MAX' => 'Please enter the maximum phpBB requirement of the extension',
7878
'SKELETON_QUESTION_PHPBB_VERSION_MAX_UI' => 'Maximum phpBB requirement of the extension',
79-
'SKELETON_QUESTION_PHPBB_VERSION_MAX_EXPLAIN' => 'default: &lt;' . \phpbb\skeleton\ext::DEFAULT_PHPBB_MAX,
79+
'SKELETON_QUESTION_PHPBB_VERSION_MAX_EXPLAIN' => 'default: &lt;' . \phpbb\skeleton\ext::DEFAULT_SKELETON_PHPBB_MAX,
8080

8181
'SKELETON_QUESTION_COMPONENT_PHPLISTENER' => 'Create sample PHP event listeners',
8282
'SKELETON_QUESTION_COMPONENT_PHPLISTENER_UI' => 'PHP event listeners',

tests/controller/main_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function test_handle(int $status_code, string $page_content)
146146
['vendor_name', '', true, request_interface::REQUEST, 'foo'],
147147
['author_name', [''], true, request_interface::REQUEST, ['bar']],
148148
['extension_version', '1.0.0-dev', true, request_interface::REQUEST, '1.0.0-dev'],
149-
['php_version', '>=' . ext::DEFAULT_PHP, false, request_interface::REQUEST, '>=' . ext::DEFAULT_PHP],
149+
['php_version', '>=' . ext::DEFAULT_SKELETON_PHP, false, request_interface::REQUEST, '>=' . ext::DEFAULT_SKELETON_PHP],
150150
['component_phplistener', false, false, request_interface::REQUEST, true],
151151
]);
152152

@@ -231,7 +231,7 @@ public function test_handle(int $status_code, string $page_content)
231231
'NAME' => 'php_version',
232232
'DESC' => 'SKELETON_QUESTION_PHP_VERSION_UI',
233233
'DESC_EXPLAIN' => 'SKELETON_QUESTION_PHP_VERSION_EXPLAIN',
234-
'VALUE' => '>=' . ext::DEFAULT_PHP,
234+
'VALUE' => '>=' . ext::DEFAULT_SKELETON_PHP,
235235
]],
236236
['requirement', [
237237
'NAME' => 'phpbb_version_min',

tests/helper/packager_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function test_get_template_engine_returns_twig_instance()
231231
return $return;
232232
});
233233

234-
$this->container->expects($this->exactly(2))
234+
$this->container->expects($this->once())
235235
->method('getParameter')
236236
->with('core.cache_dir')
237237
->willReturn(false);

0 commit comments

Comments
 (0)