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;
        }
    }
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;
        }
    }
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 ; } }
Internally used to validate each form component.

@param \Amarkal\UI\AbstractComponent[] $components
@throws \Amarkal\Form\DuplicateNameException
Internally used to validate each form component .