Booleans and null should be compared strictly

  • Minor
  • Bugrisk

More information: https://insight.symfony.com/what-we-analyse/php.strict_boolean_comparison_should_be_used

  1. preg_match_all('/{(.*?)}/', $route, $matches);
  2. $route = str_replace($matches[0], '{'.$value['as_id'].'}', $route);
  3. }
  4. $port = parse_url($router->current(), PHP_URL_PORT);
  5. $port = (null == $port) ? '' : ':'.$port;

    With booleans and null, only strict comparison (with === operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Nil Portugues Caldero
  6. $scheme = parse_url($router->current(), PHP_URL_SCHEME);
  7. $host = parse_url($router->current(), PHP_URL_HOST).$port;
  8. return sprintf('%s://%s/%s', $scheme, $host, $route);