improve code

This commit is contained in:
Daniel Seifert 2022-07-26 21:49:58 +02:00
parent 37c28d5b59
commit 17be971465
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
3 changed files with 14 additions and 7 deletions

View File

@ -20,13 +20,16 @@ use OxidEsales\Eshop\Core\Registry;
trait redirectControllerTrait
{
protected function d3DoPRGRedirect()
/**
* @return void
*/
protected function d3DoPRGRedirect(): void
{
if ($this->d3ShouldDoPRGredirect()) {
/** @var Utils_PRGredirect $utils */
$utils = Registry::getUtils();
$this->setFncName(null);
$this->setFncName('');
$utils->d3PrgRedirect($this->generatePageNavigationUrl());
}
}

View File

@ -15,12 +15,16 @@ declare(strict_types=1);
namespace D3\PRGredirects\Modules\Core;
use Exception;
use OxidEsales\Eshop\Core\Exception\StandardException;
use OxidEsales\Eshop\Core\Registry;
class Utils_PRGredirect extends Utils_PRGredirect_parent
{
public function d3PrgRedirect($url)
/**
* @param string $url
* @return void
*/
public function d3PrgRedirect(string $url): void
{
$url = str_ireplace("&", "&", $url);
$headerCode = "HTTP/1.1 303 See Other";
@ -29,7 +33,7 @@ class Utils_PRGredirect extends Utils_PRGredirect_parent
$this->_simpleRedirect($url, $headerCode);
Registry::getSession()->freeze();
} catch (Exception $e) {
} catch (StandardException $e) {
$e->debugOut();
}

View File

@ -4,5 +4,5 @@ parameters:
paths:
- Application
- Modules
level: 0
phpVersion: 80000
level: 9
phpVersion: 70100