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 trait redirectControllerTrait
{ {
protected function d3DoPRGRedirect() /**
* @return void
*/
protected function d3DoPRGRedirect(): void
{ {
if ($this->d3ShouldDoPRGredirect()) { if ($this->d3ShouldDoPRGredirect()) {
/** @var Utils_PRGredirect $utils */ /** @var Utils_PRGredirect $utils */
$utils = Registry::getUtils(); $utils = Registry::getUtils();
$this->setFncName(null); $this->setFncName('');
$utils->d3PrgRedirect($this->generatePageNavigationUrl()); $utils->d3PrgRedirect($this->generatePageNavigationUrl());
} }
} }

View File

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

View File

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