original_string: public function register($class)
      {
          if ($this->initialized) {
              throw new RuntimeException(
                  'The components have already been initialized.'
              );
          }
          if (! class_exists($class)) {
              throw new RuntimeException(sprintf(
                  'The component "%s" not exists.',
                  $class
              ));
          }
          $component = new $class();
          if (! $component instanceof ComponentInterface) {
              throw new InvalidArgumentException(sprintf(
                  'The component "%s" must implement "%s".',
                  $class,
                  ComponentInterface::CLASS
              ));
          }
  
          $this->container[$class] = $component;
  
          return md5($class . $component->getVersion());
      }
code: public function register($class)
      {
          if ($this->initialized) {
              throw new RuntimeException(
                  'The components have already been initialized.'
              );
          }
          if (! class_exists($class)) {
              throw new RuntimeException(sprintf(
                  'The component "%s" not exists.',
                  $class
              ));
          }
          $component = new $class();
          if (! $component instanceof ComponentInterface) {
              throw new InvalidArgumentException(sprintf(
                  'The component "%s" must implement "%s".',
                  $class,
                  ComponentInterface::CLASS
              ));
          }
  
          $this->container[$class] = $component;
  
          return md5($class . $component->getVersion());
      }
code_tokens: public function register ( $ class ) { if ( $ this -> initialized ) { throw new RuntimeException ( 'The components have already been initialized.' ) ; } if ( ! class_exists ( $ class ) ) { throw new RuntimeException ( sprintf ( 'The component "%s" not exists.' , $ class ) ) ; } $ component = new $ class ( ) ; if ( ! $ component instanceof ComponentInterface ) { throw new InvalidArgumentException ( sprintf ( 'The component "%s" must implement "%s".' , $ class , ComponentInterface :: CLASS ) ) ; } $ this -> container [ $ class ] = $ component ; return md5 ( $ class . $ component -> getVersion ( ) ) ; }
docstring: Register the component.
  
  @param string $class The class of component
  
  @throws \InvalidArgumentException If the specified class not implements
  the Es\Component\ComponentInterface
  @throws \RuntimeException
  
  - If If the components have already been initialized
  - If the specified class of component does not exists
  
  @return string The hash of component state
docstring_tokens: Register the component .