original_string: public static function newResources($credentials)
      {
          if ((!isset($credentials[self::USERNAME])) || (!isset($credentials[self::PASSWORD]))) {
              throw new Exception('Invalid credentials');
          }
          $restClient = new Client($credentials[self::USERNAME], $credentials[self::PASSWORD]);
          return new Resources($restClient);
      }
code: public static function newResources($credentials)
      {
          if ((!isset($credentials[self::USERNAME])) || (!isset($credentials[self::PASSWORD]))) {
              throw new Exception('Invalid credentials');
          }
          $restClient = new Client($credentials[self::USERNAME], $credentials[self::PASSWORD]);
          return new Resources($restClient);
      }
code_tokens: public static function newResources ( $ credentials ) { if ( ( ! isset ( $ credentials [ self :: USERNAME ] ) ) || ( ! isset ( $ credentials [ self :: PASSWORD ] ) ) ) { throw new Exception ( 'Invalid credentials' ) ; } $ restClient = new Client ( $ credentials [ self :: USERNAME ] , $ credentials [ self :: PASSWORD ] ) ; return new Resources ( $ restClient ) ; }
docstring: Creates a new Resources object
  
  Creates a new Rest Client based on the credentials
  and returns a new Resources instance based on that Rest Client instance.
  
  @param array $credentials
  @return IResources
  @throws Exception
docstring_tokens: Creates a new Resources object