Browse Source

Explicitly cast possible-null to string

Jordi Boggiano 8 years ago
parent
commit
1464146629
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/Composer/Config.php

+ 4 - 4
src/Composer/Config.php

@@ -217,7 +217,7 @@ class Config
                 $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));
 
                 $val = $this->getComposerEnv($env);
-                $val = rtrim($this->process(false !== $val ? $val : $this->config[$key], $flags), '/\\');
+                $val = rtrim((string) $this->process(false !== $val ? $val : $this->config[$key], $flags), '/\\');
                 $val = Platform::expandPath($val);
 
                 if (substr($key, -4) !== '-dir') {
@@ -358,9 +358,9 @@ class Config
     /**
      * Replaces {$refs} inside a config string
      *
-     * @param  string $value a config string that can contain {$refs-to-other-config}
-     * @param  int    $flags Options (see class constants)
-     * @return string
+     * @param  string|int|null $value a config string that can contain {$refs-to-other-config}
+     * @param  int             $flags Options (see class constants)
+     * @return string|int|null
      */
     private function process($value, $flags)
     {