original_string: protected function setSymlinkBasePath(array $extraConfigs)
      {
          if (isset($extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['symlink-base-path'])) {
              $this->symlinkBasePath = $extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['symlink-base-path'];
  
              if (false !== getenv(static::ENV_PARAMETER_SYMLINK_BASE_PATH)) {
                  $this->symlinkBasePath = getenv(static::ENV_PARAMETER_SYMLINK_BASE_PATH);
              }
  
              // Remove the ending slash if exists
              if ('/' === $this->symlinkBasePath[strlen($this->symlinkBasePath) - 1]) {
                  $this->symlinkBasePath = substr($this->symlinkBasePath, 0, -1);
              }
          } elseif (0 < strpos($extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['vendor-dir'], '/')) {
              $this->symlinkBasePath = $extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['vendor-dir'];
          }
  
          // Up to the project root directory
          if (0 < strpos($this->symlinkBasePath, '/')) {
              $this->symlinkBasePath = '../../' . $this->symlinkBasePath;
          }
      }
code: protected function setSymlinkBasePath(array $extraConfigs)
      {
          if (isset($extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['symlink-base-path'])) {
              $this->symlinkBasePath = $extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['symlink-base-path'];
  
              if (false !== getenv(static::ENV_PARAMETER_SYMLINK_BASE_PATH)) {
                  $this->symlinkBasePath = getenv(static::ENV_PARAMETER_SYMLINK_BASE_PATH);
              }
  
              // Remove the ending slash if exists
              if ('/' === $this->symlinkBasePath[strlen($this->symlinkBasePath) - 1]) {
                  $this->symlinkBasePath = substr($this->symlinkBasePath, 0, -1);
              }
          } elseif (0 < strpos($extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['vendor-dir'], '/')) {
              $this->symlinkBasePath = $extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['vendor-dir'];
          }
  
          // Up to the project root directory
          if (0 < strpos($this->symlinkBasePath, '/')) {
              $this->symlinkBasePath = '../../' . $this->symlinkBasePath;
          }
      }
code_tokens: protected function setSymlinkBasePath ( array $ extraConfigs ) { if ( isset ( $ extraConfigs [ SharedPackageInstaller :: PACKAGE_TYPE ] [ 'symlink-base-path' ] ) ) { $ this -> symlinkBasePath = $ extraConfigs [ SharedPackageInstaller :: PACKAGE_TYPE ] [ 'symlink-base-path' ] ; if ( false !== getenv ( static :: ENV_PARAMETER_SYMLINK_BASE_PATH ) ) { $ this -> symlinkBasePath = getenv ( static :: ENV_PARAMETER_SYMLINK_BASE_PATH ) ; } // Remove the ending slash if exists
   if ( '/' === $ this -> symlinkBasePath [ strlen ( $ this -> symlinkBasePath ) - 1 ] ) { $ this -> symlinkBasePath = substr ( $ this -> symlinkBasePath , 0 , - 1 ) ; } } elseif ( 0 < strpos ( $ extraConfigs [ SharedPackageInstaller :: PACKAGE_TYPE ] [ 'vendor-dir' ] , '/' ) ) { $ this -> symlinkBasePath = $ extraConfigs [ SharedPackageInstaller :: PACKAGE_TYPE ] [ 'vendor-dir' ] ; } // Up to the project root directory
   if ( 0 < strpos ( $ this -> symlinkBasePath , '/' ) ) { $ this -> symlinkBasePath = '../../' . $ this -> symlinkBasePath ; } }
docstring: Allow to override symlinks base path.
  This is useful for a Virtual Machine environment, where directories can be different
  on the host machine and the guest machine.
  
  @param array $extraConfigs
docstring_tokens: Allow to override symlinks base path . This is useful for a Virtual Machine environment where directories can be different on the host machine and the guest machine .