original_string: public static function setApiVersion($version)
      {
          if (! in_array($version, [1,2])) {
              throw new \Exception(sprintf("The %d version is not supported", $version));
          }
          self::$apiVersion = $version;
          
          // Refresh services if version is changed and base url is defined
          if (self::$url) {
              self::initServices();
          }
      }
code: public static function setApiVersion($version)
      {
          if (! in_array($version, [1,2])) {
              throw new \Exception(sprintf("The %d version is not supported", $version));
          }
          self::$apiVersion = $version;
          
          // Refresh services if version is changed and base url is defined
          if (self::$url) {
              self::initServices();
          }
      }
code_tokens: public static function setApiVersion ( $ version ) { if ( ! in_array ( $ version , [ 1 , 2 ] ) ) { throw new \ Exception ( sprintf ( "The %d version is not supported" , $ version ) ) ; } self :: $ apiVersion = $ version ; // Refresh services if version is changed and base url is defined if ( self :: $ url ) { self :: initServices ( ) ; } }
docstring: Define which API version to use
  @param integer $version
docstring_tokens: Define which API version to use