Skip to content

Commit

Permalink
Change OpenMage version compare (#2839)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored Dec 23, 2022
1 parent 0afac86 commit 50418cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 9 additions & 3 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,13 @@ public static function getOpenMageVersion()
*/
public static function getOpenMageVersionInfo()
{
$majorVersion = 19;

/**
* This code construct is to make merging for forward porting of changes easier.
* By having the version numbers of different branches in own lines, they do not provoke a merge conflict
* also as releases are usually done together, this could in theory be done at once.
* The major Version then needs to be only changed once per branch.
*/
if ($majorVersion === 20) {
if (self::getOpenMageMajorVersion() === 20) {
return [
'major' => '20',
'minor' => '1',
Expand All @@ -229,6 +227,14 @@ public static function getOpenMageVersionInfo()
];
}

/**
* @return int<19,20>
*/
public static function getOpenMageMajorVersion(): int
{
return 19;
}

/**
* Get current Magento edition
*
Expand Down
5 changes: 0 additions & 5 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ parameters:

# Instantiated class not found
- lib/Varien/Image/Adapter.php
ignoreErrors:
# OpenMage version comparison
-
message: "#^Strict comparison using \\=\\=\\= between 19 and 20 will always evaluate to false\\.$#"
path: app/Mage.php
level: 4
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
Expand Down

0 comments on commit 50418cd

Please sign in to comment.