Skip to content

Commit 311cf7d

Browse files
authored
Merge pull request #133 from vaimo/fix/issue-132-phposinfo-compatibility
Fix/issue 132 phposinfo compatibility
2 parents 9dd06f1 + d1faf5a commit 311cf7d

File tree

5 files changed

+14
-26
lines changed

5 files changed

+14
-26
lines changed

bin/bootstrap-test-env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ if [ ! -L test/modules/${name}/src ] ; then
1414
fi
1515

1616
cp composer.json test/modules/${name} 2>/dev/null
17-
cp compatibility.php test/modules/${name} 2>/dev/null
1817

1918
sed -i.org 's|'${name}'"|'${name}'-local"|g' test/modules/${name}/composer.json
2019
rm test/modules/${name}/composer.json.org 2>/dev/null

compatibility.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@
121121
"autoload": {
122122
"psr-4": {
123123
"Vaimo\\ComposerPatches\\": "src"
124-
},
125-
"files": [
126-
"compatibility.php"
127-
]
124+
}
128125
},
129126
"repositories": [
130127
{

composer.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Config/Context.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
*/
66
namespace Vaimo\ComposerPatches\Config;
77

8+
// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
9+
if (!class_exists('loophp\phposinfo\OsInfo') && class_exists('drupol\phposinfo\OsInfo')) {
10+
class_alias('drupol\phposinfo\OsInfo', 'loophp\phposinfo\OsInfo');
11+
class_alias('drupol\phposinfo\OsInfoInterface', 'loophp\phposinfo\OsInfoInterface');
12+
class_alias('drupol\phposinfo\Enum\Enum', 'loophp\phposinfo\Enum\Enum');
13+
class_alias('drupol\phposinfo\Enum\Family', 'loophp\phposinfo\Enum\Family');
14+
class_alias('drupol\phposinfo\Enum\FamilyName', 'loophp\phposinfo\Enum\FamilyName');
15+
class_alias('drupol\phposinfo\Enum\Os', 'loophp\phposinfo\Enum\Os');
16+
class_alias('drupol\phposinfo\Enum\OsName', 'loophp\phposinfo\Enum\OsName');
17+
}
18+
819
use loophp\phposinfo\OsInfo;
920
use loophp\phposinfo\Enum\OsName;
1021
use loophp\phposinfo\Enum\FamilyName;

0 commit comments

Comments
 (0)