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
This commit is contained in:
Fabien Potencier 2020-04-21 23:40:38 +02:00
commit 22f1076375

View File

@ -101,7 +101,7 @@ class Profile
return $this->ip;
}
public function setIp(string $ip)
public function setIp(?string $ip)
{
$this->ip = $ip;
}
@ -131,7 +131,7 @@ class Profile
return $this->url;
}
public function setUrl(string $url)
public function setUrl(?string $url)
{
$this->url = $url;
}