Skip to content

Commit

Permalink
Remove strtolower transform from RedirectRoute::setTarget (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-rath authored Sep 8, 2022
1 parent bbd4d90 commit 964aae9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Entity/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getTarget()
*/
public function setTarget($target)
{
$this->target = mb_strtolower($target);
$this->target = $target;

return $this;
}
Expand Down
4 changes: 1 addition & 3 deletions Import/Writer/DuplicatedSourceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public function __construct(RedirectRouteInterface $entity)
$this->entity = $entity;
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
Expand Down
4 changes: 1 addition & 3 deletions Import/Writer/TargetIsEmptyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public function __construct(RedirectRouteInterface $entity)
$this->entity = $entity;
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Routing/RedirectRouteProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testRoute(
string $requestUrl,
string $source,
int $statusCode,
?string $target = null,
string $target = '',
?string $sourceHost = null
) {
// setup models
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Entity/RedirectRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ public function testTarget()
$this->assertSame('target-url', $route->getTarget());

$this->assertSame($route, $route->setTarget('UPPERCASE-TARGET'));
$this->assertSame('uppercase-target', $route->getTarget());
$this->assertSame('UPPERCASE-TARGET', $route->getTarget());
}
}
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,6 @@ parameters:
count: 1
path: Tests/Functional/Routing/RedirectRouteProviderTest.php

-
message: "#^Parameter \\#1 \\$target of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Entity\\\\RedirectRoute\\:\\:setTarget\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: Tests/Functional/Routing/RedirectRouteProviderTest.php

-
message: "#^Call to an undefined method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\:\\:reveal\\(\\)\\.$#"
count: 4
Expand Down

0 comments on commit 964aae9

Please sign in to comment.