Skip to content

Commit 7c5b68e

Browse files
sreichelfballiano
authored andcommitted
Change OpenMage version compare (#2839)
1 parent 14b760e commit 7c5b68e

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

app/Mage.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,13 @@ public static function getOpenMageVersion()
202202
*/
203203
public static function getOpenMageVersionInfo()
204204
{
205-
$majorVersion = 20;
206-
207205
/**
208206
* This code construct is to make merging for forward porting of changes easier.
209207
* By having the version numbers of different branches in own lines, they do not provoke a merge conflict
210208
* also as releases are usually done together, this could in theory be done at once.
211209
* The major Version then needs to be only changed once per branch.
212210
*/
213-
if ($majorVersion === 20) { // @phpstan-ignore-line
211+
if (self::getOpenMageMajorVersion() === 20) {
214212
return [
215213
'major' => '20',
216214
'minor' => '1',
@@ -229,6 +227,14 @@ public static function getOpenMageVersionInfo()
229227
];
230228
}
231229

230+
/**
231+
* @return int<19,20>
232+
*/
233+
public static function getOpenMageMajorVersion(): int
234+
{
235+
return 19;
236+
}
237+
232238
/**
233239
* Get current Magento edition
234240
*
@@ -958,7 +964,6 @@ public static function getIsDeveloperMode()
958964
public static function printException(Throwable $e, $extra = '')
959965
{
960966
if (self::$_isDeveloperMode) {
961-
@http_response_code(500);
962967
print '<pre>';
963968

964969
if (!empty($extra)) {
@@ -1044,4 +1049,13 @@ public static function getScriptSystemUrl($folder, $exitIfNot = false)
10441049

10451050
return $baseUrl;
10461051
}
1052+
1053+
/**
1054+
* Set is downloader flag
1055+
*
1056+
* @deprecated
1057+
*/
1058+
public static function setIsDownloader()
1059+
{
1060+
}
10471061
}

phpstan.dist.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ parameters:
7070

7171
# Instantiated class not found
7272
- lib/Varien/Image/Adapter.php
73-
ignoreErrors:
74-
# OpenMage version comparison
75-
-
76-
message: "#^Strict comparison using \\=\\=\\= between 19 and 20 will always evaluate to false\\.$#"
77-
path: app/Mage.php
7873
level: 4
7974
checkFunctionNameCase: true
8075
checkInternalClassCaseSensitivity: true

0 commit comments

Comments
 (0)