-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
108 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
diff --git a/vendor/magento/framework/Code/Generator/EntityAbstract.php b/vendor/magento/framework/Code/Generator/EntityAbstract.php | ||
index 35a0bff..10fd3f7 100644 | ||
--- a/vendor/magento/framework/Code/Generator/EntityAbstract.php | ||
+++ b/vendor/magento/framework/Code/Generator/EntityAbstract.php | ||
@@ -10,6 +10,8 @@ use Magento\Framework\GetParameterClassTrait; | ||
|
||
/** | ||
* Abstract entity | ||
+ * | ||
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) | ||
*/ | ||
abstract class EntityAbstract | ||
{ | ||
@@ -18,7 +20,7 @@ abstract class EntityAbstract | ||
/** | ||
* Entity type abstract | ||
*/ | ||
- const ENTITY_TYPE = 'abstract'; | ||
+ public const ENTITY_TYPE = 'abstract'; | ||
|
||
/** | ||
* @var string[] | ||
@@ -332,14 +334,22 @@ abstract class EntityAbstract | ||
/** @var string|null $typeName */ | ||
$typeName = null; | ||
$parameterType = $parameter->getType(); | ||
- if ($parameterType->getName() === 'array') { | ||
+ | ||
+ if ($parameterType instanceof \ReflectionUnionType) { | ||
+ $parameterType = $parameterType->getTypes(); | ||
+ $parameterType = implode('|', $parameterType); | ||
+ } else { | ||
+ $parameterType = $parameterType->getName(); | ||
+ } | ||
+ | ||
+ if ($parameterType === 'array') { | ||
$typeName = 'array'; | ||
} elseif ($parameterClass = $this->getParameterClass($parameter)) { | ||
$typeName = $this->_getFullyQualifiedClassName($parameterClass->getName()); | ||
- } elseif ($parameterType->getName() === 'callable') { | ||
+ } elseif ($parameterType === 'callable') { | ||
$typeName = 'callable'; | ||
} else { | ||
- $typeName = $parameterType->getName(); | ||
+ $typeName = $parameterType; | ||
} | ||
|
||
if ($parameter->allowsNull()) { | ||
diff --git a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php | ||
index 43e9d97..c363f80 100644 | ||
--- a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php | ||
+++ b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php | ||
@@ -72,7 +72,7 @@ class Interceptor extends EntityAbstract | ||
$reflectionClass = new \ReflectionClass($this->getSourceClassName()); | ||
$publicMethods = $reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC); | ||
foreach ($publicMethods as $method) { | ||
- if ($this->isInterceptedMethod($method)) { | ||
+ if (!$method->isInternal() && $this->isInterceptedMethod($method)) { | ||
$methods[] = $this->_getMethodInfo($method); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
$version = getenv('MAGENTO_VERSION'); | ||
$is244 = substr($version, 0, 5) == '2.4.4'; | ||
$patchLevel = (int)substr($version, 7); | ||
|
||
if (!$is244 || $patchLevel > 100) { | ||
echo 'AC2855 Breaking bug does not exist in this version' . PHP_EOL; | ||
exit(0); | ||
} | ||
|
||
$output = null; | ||
$code = null; | ||
exec('cd /data && patch -p1 < patches/AC2855.patch', $output, $code); | ||
|
||
if ($code !== 0) { | ||
echo 'Error applying patch for AC2855' . PHP_EOL; | ||
echo implode(PHP_EOL, $output); | ||
exit($code); | ||
} |