Skip to content

Commit 1df96f6

Browse files
committed
Messages for php min version is essentially dead code anyway
1 parent 5c31f6a commit 1df96f6

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

ext.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function php_requirement($php_version = PHP_VERSION_ID)
7171
{
7272
if ($php_version < self::MIN_PHP_ALLOWED)
7373
{
74-
$this->errors[] = ['PHP_VERSION_ERROR', $this->version_parse(self::MIN_PHP_ALLOWED), $this->version_parse($php_version)];
74+
$this->errors[] = ['PHP_VERSION_MIN_ERROR', '7.1.0', PHP_VERSION];
7575
}
7676
}
7777

@@ -108,15 +108,4 @@ protected function enable_failed()
108108

109109
return false;
110110
}
111-
112-
/**
113-
* Convert a version id (70100) to a semantic version (7.1.0)
114-
*
115-
* @param int $version
116-
* @return string
117-
*/
118-
private function version_parse($version)
119-
{
120-
return sprintf('%d.%d.%d', $version / 10000, ($version / 100) % 100, $version % 100);
121-
}
122111
}

language/en/common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@
162162
'SKELETON_INVALID_PHPBB_MIN_VERSION'=> 'The minimum phpBB version requirement is invalid.',
163163
'SKELETON_INVALID_PHPBB_MAX_VERSION'=> 'The maximum phpBB version requirement is invalid.',
164164

165-
'NO_ZIPARCHIVE_ERROR' => 'The ZipArchive class is required, but was not found in your PHP configuration.',
166-
'PHP_VERSION_ERROR' => 'PHP %1$s or newer is required to install this version of the Skeleton Extension. You are using PHP %2$s.',
165+
'NO_ZIPARCHIVE_ERROR' => 'The ZipArchive class is required, but was not found in your PHP configuration.',
166+
'PHP_VERSION_MIN_ERROR' => 'PHP %1$s or newer is required to install this version of the Skeleton Extension. You are using PHP %2$s.',
167167
'PHPBB_VERSION_MIN_ERROR' => 'phpBB %1$s or newer is required to install this version of the Skeleton Extension. You are using phpBB %2$s.',
168168
'PHPBB_VERSION_MAX_ERROR' => 'phpBB %1$s or above is not supported by this version of the Skeleton Extension. You are using phpBB %2$s. Please check for a newer version of this extension.'
169169
]);

tests/ext_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function test_enable_failed_returns_parameterized_error()
103103
->disableOriginalConstructor()
104104
->getMock();
105105

106-
$this->setExtErrors($ext, [['PHP_VERSION_ERROR', '7.1.0', '5.5.0']]);
106+
$this->setExtErrors($ext, [['PHP_VERSION_MIN_ERROR', '7.1.0', '5.5.0']]);
107107

108108
$languageMock = $this->createMock(language::class);
109109
$languageMock->method('add_lang')->willReturn(null);
@@ -119,7 +119,7 @@ public function test_enable_failed_returns_parameterized_error()
119119
$method = (new \ReflectionClass($ext))->getMethod('enable_failed');
120120
$method->setAccessible(true);
121121

122-
$this->assertEquals(['PHP_VERSION_ERROR:7.1.0:5.5.0'], $method->invoke($ext));
122+
$this->assertEquals(['PHP_VERSION_MIN_ERROR:7.1.0:5.5.0'], $method->invoke($ext));
123123
}
124124

125125
public function test_phpbb_requirement_min_error()
@@ -140,7 +140,7 @@ public function test_php_requirement_error()
140140
{
141141
$this->setExtErrors($this->ext, []);
142142
$this->invokeProtectedMethod($this->ext, 'php_requirement', [50500]);
143-
$this->assertContains('PHP_VERSION_ERROR', $this->getExtErrorKeys($this->ext));
143+
$this->assertContains('PHP_VERSION_MIN_ERROR', $this->getExtErrorKeys($this->ext));
144144
}
145145

146146
public function test_ziparchive_exists_error()

0 commit comments

Comments
 (0)