Booleans and null should be compared strictly 3

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

  1. protected function resolve(array $params)
  2. {
  3. $params = parent::resolve($params);
  4. if (isset($params['host']) && $params['host'] != null) {

    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 Charles Sanquer
  5. $dbname = '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' .
  6. '(HOST=' . $params['host'] . ')';
  7. if (isset($params['port'])) {
  8. $dbname .= '(PORT=' . $params['port'] . ')';
  1. $dbname .= '(PORT=' . $params['port'] . ')';
  2. } else {
  3. $dbname .= '(PORT=1521)';
  4. }
  5. if (isset($params['service']) && $params['service'] == true) {

    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 Charles Sanquer
  6. $dbname .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))';
  7. } else {
  8. $dbname .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))';
  9. }
  1. $driver = $params['driver'];
  2. unset($params['driver']);
  3. $dsnParams = array();
  4. foreach ($params as $key => $value) {
  5. if ($value != null && $value != '') {

    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 Charles Sanquer
  6. $dsnParams[] = $key.'='.$value;
  7. }
  8. }
  9. return $driver.':'.implode(';', $dsnParams);

Text files should end with a valid new line character.

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

in .travis.yml, line 25
  1. - mkdir -p build/logs
  2. - php vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
  3. after_script:
  4. - wget https://scrutinizer-ci.com/ocular.phar
  5. - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml

    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Charles Sanquer