original_string: public function get($domain, $key = null)
      {
          $this->validateDomain($domain);
  
          if (null === $key) {
              return new Config($this->profile[$domain]);
          }
  
          if (!isset($this->profile[$domain][$key])) {
              throw new \InvalidArgumentException(sprintf(
                  'Unknown key "%s" for profile domain "%s"',
                  $key, $domain
              ));
          }
  
          return $this->profile[$domain][$key];
      }
code: public function get($domain, $key = null)
      {
          $this->validateDomain($domain);
  
          if (null === $key) {
              return new Config($this->profile[$domain]);
          }
  
          if (!isset($this->profile[$domain][$key])) {
              throw new \InvalidArgumentException(sprintf(
                  'Unknown key "%s" for profile domain "%s"',
                  $key, $domain
              ));
          }
  
          return $this->profile[$domain][$key];
      }
code_tokens: public function get ( $ domain , $ key = null ) { $ this -> validateDomain ( $ domain ) ; if ( null === $ key ) { return new Config ( $ this -> profile [ $ domain ] ) ; } if ( ! isset ( $ this -> profile [ $ domain ] [ $ key ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Unknown key "%s" for profile domain "%s"' , $ key , $ domain ) ) ; } return $ this -> profile [ $ domain ] [ $ key ] ; }
docstring: Get a domain configuration.
  
  @param string $domain
  @param string $key
  
  @throws \InvalidArgumentException
  
  @return array
docstring_tokens: Get a domain configuration .