mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 10:18:56 +02:00
Improved code style of tests
This commit is contained in:
parent
5629215ce4
commit
684334ba22
73 changed files with 196 additions and 38 deletions
|
@ -30,6 +30,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
|
|||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* @see \App\Tests\Controller\RedirectControllerTest
|
||||
*/
|
||||
class RedirectController extends AbstractController
|
||||
{
|
||||
public function __construct(protected string $default_locale, protected TranslatorInterface $translator, protected bool $enforce_index_php)
|
||||
|
@ -55,7 +58,7 @@ class RedirectController extends AbstractController
|
|||
|
||||
//If either mod_rewrite is not enabled or the index.php version is enforced, add index.php to the string
|
||||
if (($this->enforce_index_php || !$this->checkIfModRewriteAvailable())
|
||||
&& !str_contains($new_url, 'index.php')) {
|
||||
&& !str_contains((string) $new_url, 'index.php')) {
|
||||
//Like Request::getUriForPath only with index.php
|
||||
$new_url = $request->getSchemeAndHttpHost().$request->getBaseUrl().'/index.php/'.$locale.$request->getPathInfo();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue