Skip to content

Commit

Permalink
Merge pull request #3351 from mhsdesign/bugfix/adjustToPhp83GetParent…
Browse files Browse the repository at this point in the history
…ClassDeprecation

TASK: Adjust to Php 83 `get_parent_class` deprecation
  • Loading branch information
mhsdesign committed May 14, 2024
2 parents 00fa8ff + ca49686 commit a7a2dab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Neos.Flow/Classes/Aop/Builder/ProxyClassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public function buildProxyClass(string $targetClassName, array $aspectContainers
$proxyClass->addProperty($propertyName, var_export($propertyIntroduction->getInitialValue(), true), $propertyIntroduction->getPropertyVisibility(), $propertyIntroduction->getPropertyDocComment());
}

$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->addPreParentCallCode(" if (method_exists(get_parent_class(), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable([parent::class, 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray'])) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n");
$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->addPreParentCallCode(" if (method_exists(get_parent_class(\$this), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable([parent::class, 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray'])) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n");
$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->addPreParentCallCode($this->buildMethodsAndAdvicesArrayCode($interceptedMethods));
$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->setVisibility(ProxyMethodGenerator::VISIBILITY_PROTECTED);

Expand All @@ -420,7 +420,7 @@ public function buildProxyClass(string $targetClassName, array $aspectContainers

if (!$this->reflectionService->hasMethod($targetClassName, '__wakeup')) {
$proxyClass->getMethod('__wakeup')->addPostParentCallCode(<<<PHP
if (method_exists(get_parent_class(), '__wakeup') && is_callable('parent::__wakeup')) parent::__wakeup();
if (method_exists(get_parent_class(\$this), '__wakeup') && is_callable([parent::class, '__wakeup'])) parent::__wakeup();
PHP);
}
$proxyClass->addTraits(['\\' . AdvicesTrait::class]);
Expand Down Expand Up @@ -495,7 +495,7 @@ protected function addBuildMethodsAndAdvicesCodeToClass(string $className, Class
return $treatedSubClasses;
}

$callBuildMethodsAndAdvicesArrayCode = " if (method_exists(get_parent_class(), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable([parent::class, 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray'])) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n";
$callBuildMethodsAndAdvicesArrayCode = " if (method_exists(get_parent_class(\$this), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable([parent::class, 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray'])) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n";
$proxyClass->getConstructor()->addPreParentCallCode($callBuildMethodsAndAdvicesArrayCode);
$proxyClass->getMethod('__wakeup')->addPreParentCallCode($callBuildMethodsAndAdvicesArrayCode);

Expand Down
6 changes: 3 additions & 3 deletions Neos.Flow/Classes/Mvc/Routing/UriBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,18 @@ public function getSection()
/**
* Specifies the format of the target (e.g. "html" or "xml")
*
* @param string $format (e.g. "html" or "xml"), will be transformed to lowercase!
* @param string|null $format (e.g. "html" or "xml"), will be transformed to lowercase!
* @return UriBuilder the current UriBuilder to allow method chaining
* @api
*/
public function setFormat($format)
{
$this->format = strtolower($format);
$this->format = $format !== null ? strtolower($format) : null;
return $this;
}

/**
* @return string
* @return string|null
* @api
*/
public function getFormat()
Expand Down

0 comments on commit a7a2dab

Please sign in to comment.