Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Adjust to Php 83 get_parent_class deprecation #3351

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading