PHPStan level 3 #1603
1 changed files with 2 additions and 2 deletions
remove obvious type cast
commit
38a8e9a169
|
@ -368,12 +368,12 @@ class Services_Libravatar
|
|||
// important bit out.
|
||||
if (filter_var($identifier, FILTER_VALIDATE_EMAIL)) {
|
||||
$email = explode('@', $identifier);
|
||||
return (string) $email[1];
|
||||
return $email[1];
|
||||
Art4 marked this conversation as resolved
Outdated
|
||||
}
|
||||
|
||||
//OpenID
|
||||
$url = parse_url($identifier);
|
||||
$domain = (string) $url['host'];
|
||||
$domain = $url['host'];
|
||||
Art4 marked this conversation as resolved
Outdated
MrPetovan
commented
`parse_url()` only returns an integer for the `port` key, this is superfluous.
Art4
commented
Same as above: #1603 (comment) Same as above: https://git.friendi.ca/friendica/friendica-addons/pulls/1603#issuecomment-196305
|
||||
if (isset($url['port']) && $url['scheme'] === 'http'
|
||||
&& $url['port'] != 80
|
||||
|| isset($url['port']) && $url['scheme'] === 'https'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue
I'm surprised by this,
explode()
reportedly only returns strings in the output array. What case is this meant to address?I was surprised too, but thought PHPStan complains because
explode()
could also returnfalse
. But now I removed the type cast and PHPStan don't show an error anymore. 🤷