original_string: private function validate_components( $components )
      {
          foreach( $components as $component )
          {
              if( ! $component instanceof UI\AbstractComponent )
              {
                  throw new WrongTypeException( \gettype( $component ) );
              }
              
              if( $component instanceof UI\Components\Composite )
              {
                  $this->validate_components( $component->components );
                  continue;
              }
              
              if( $component instanceof UI\ValueComponentInterface && in_array( $component->name, $this->names ) )
              {
                  throw new DuplicateNameException( $component->name );
              }
              
              $this->names[] = $component->name;
          }
      }
code: private function validate_components( $components )
      {
          foreach( $components as $component )
          {
              if( ! $component instanceof UI\AbstractComponent )
              {
                  throw new WrongTypeException( \gettype( $component ) );
              }
              
              if( $component instanceof UI\Components\Composite )
              {
                  $this->validate_components( $component->components );
                  continue;
              }
              
              if( $component instanceof UI\ValueComponentInterface && in_array( $component->name, $this->names ) )
              {
                  throw new DuplicateNameException( $component->name );
              }
              
              $this->names[] = $component->name;
          }
      }
code_tokens: private function validate_components ( $ components ) { foreach ( $ components as $ component ) { if ( ! $ component instanceof UI \ AbstractComponent ) { throw new WrongTypeException ( \ gettype ( $ component ) ) ; } if ( $ component instanceof UI \ Components \ Composite ) { $ this -> validate_components ( $ component -> components ) ; continue ; } if ( $ component instanceof UI \ ValueComponentInterface && in_array ( $ component -> name , $ this -> names ) ) { throw new DuplicateNameException ( $ component -> name ) ; } $ this -> names [ ] = $ component -> name ; } }
docstring: Internally used to validate each form component.
  
  @param \Amarkal\UI\AbstractComponent[] $components
  @throws \Amarkal\Form\DuplicateNameException
docstring_tokens: Internally used to validate each form component .