Skip to content

Commit

Permalink
TASK: Remove deprecated Http Component legacy layer
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 7, 2023
1 parent 2386157 commit c0c8342
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
28 changes: 0 additions & 28 deletions Neos.Flow/Classes/Mvc/ActionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,34 +142,6 @@ public function deleteCookie(string $cookieName): void
$this->cookies[$cookie->getName()] = $cookie;
}

/**
* Set a (HTTP) component parameter for use later in the chain.
* This can be used to adjust all aspects of the later processing if needed.
*
* @param string $componentClassName
* @param string $parameterName
* @param mixed $value
* @return void
* @deprecated since Flow 7.0 use setHttpHeader or replaceHttpResponse instead. For now this will still work with $componentClassName of "SetHeaderComponent" or "ReplaceHttpResponseComponent" only.
*/
public function setComponentParameter(string $componentClassName, string $parameterName, $value): void
{
/** @phpstan-ignore-next-line legacy layer */
if ($componentClassName === \Neos\Flow\Http\Component\SetHeaderComponent::class) {
$this->setHttpHeader($parameterName, $value);
return;
}

/** @phpstan-ignore-next-line legacy layer */
if ($componentClassName === \Neos\Flow\Http\Component\ReplaceHttpResponseComponent::class && $parameterName === 'response') {
$this->replaceHttpResponse($value);
return;
}

/** @phpstan-ignore-next-line legacy layer */
throw new \InvalidArgumentException(sprintf('The method %s is deprecated. It will only allow a $componentClassName parameter of "%s" or "%s". If you want to send data to your middleware from the action, use response headers or introduce a global context. Both solutions are to be considered bad practice though.', __METHOD__, \Neos\Flow\Http\Component\SetHeaderComponent::class, \Neos\Flow\Http\Component\ReplaceHttpResponseComponent::class), 1605088079);
}

/**
* Set the specified header in the response, overwriting any previous value set for this header.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ class ClassLoadingForReflectionFailedException extends \Neos\Flow\Reflection\Exc
{
public static function forClassName(string $className, string $reflectedClass): self
{
// @deprecated This check was added with Flow 7.0 to improve the developer experience for upgrading components and can be removed later
/** @phpstan-ignore-next-line legacy layer */
if ($className === \Neos\Flow\Http\Component\ComponentInterface::class) {
$message = sprintf('The class "%s" still implements the ComponentInterface. The component chain was replaced with a middleware chain in Flow 7. Please make sure you have read the upgrade instructions and converted your components to middlewares.', $reflectedClass);
} else {
$message = sprintf('Required class "%s" could not be loaded properly for reflection from "%s".%3$s%3$sPossible reasons are:%3$s%3$s * Requiring non-existent classes%3$s * Using non-supported annotations%3$s * Class-/filename mismatch.%3$s%3$sThe "Neos.Flow.object.includeClasses" setting can be used to include or exclude classes from reflection.', $className, $reflectedClass, chr(10));
}
$message = sprintf('Required class "%s" could not be loaded properly for reflection from "%s".%3$s%3$sPossible reasons are:%3$s%3$s * Requiring non-existent classes%3$s * Using non-supported annotations%3$s * Class-/filename mismatch.%3$s%3$sThe "Neos.Flow.object.includeClasses" setting can be used to include or exclude classes from reflection.', $className, $reflectedClass, chr(10));
return new self($message);
}
}

0 comments on commit c0c8342

Please sign in to comment.