Skip to content

Commit cefea5f

Browse files
committed
bug #36162 [Profiler] Fix profiler nullable string type (mRoca)
This PR was merged into the 5.0 branch. Discussion ---------- [Profiler] Fix profiler nullable string type | Q | A | ------------- | --- | Branch? | 5.0 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | - This PR fixes nullable string types in setter for the Profile class. The detected issue comes from [the Profiler class](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Profiler/Profiler.php#L149) : ```php $profile->setIp($request->getClientIp()); // string or null ``` The corresponding return types for the Profile getters are allready good: ```php /** * Returns the IP. * * @return string|null The IP */ public function getIp() { return $this->ip; } ``` Commits ------- b5d406117d Fix profiler nullable string type
2 parents 51c3cf6 + 4620b91 commit cefea5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Profiler/Profile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function getIp()
101101
return $this->ip;
102102
}
103103

104-
public function setIp(string $ip)
104+
public function setIp(?string $ip)
105105
{
106106
$this->ip = $ip;
107107
}
@@ -131,7 +131,7 @@ public function getUrl()
131131
return $this->url;
132132
}
133133

134-
public function setUrl(string $url)
134+
public function setUrl(?string $url)
135135
{
136136
$this->url = $url;
137137
}

0 commit comments

Comments
 (0)