public function registerProvider(ColorProviderInterface $colorProvider) {

        $key = ColorHelper::getIdentifier($colorProvider);
        if (true === array_key_exists($key, $this->index)) {
            throw new AlreadyRegisteredProviderException($colorProvider);
        }

        $this->index[$key] = $this->size();

        return $this->addProvider($colorProvider);
    }
public function registerProvider(ColorProviderInterface $colorProvider) {

        $key = ColorHelper::getIdentifier($colorProvider);
        if (true === array_key_exists($key, $this->index)) {
            throw new AlreadyRegisteredProviderException($colorProvider);
        }

        $this->index[$key] = $this->size();

        return $this->addProvider($colorProvider);
    }
public function registerProvider ( ColorProviderInterface $ colorProvider ) { $ key = ColorHelper :: getIdentifier ( $ colorProvider ) ; if ( true === array_key_exists ( $ key , $ this -> index ) ) { throw new AlreadyRegisteredProviderException ( $ colorProvider ) ; } $ this -> index [ $ key ] = $ this -> size ( ) ; return $ this -> addProvider ( $ colorProvider ) ; }
Register a color provider.

@param ColorProviderInterface $colorProvider The color provider.
@return ManagerInterface Returns this manager.
@throws AlreadyRegisteredProviderException Throws an already registered provider exception.
@throws ReflectionException Throws a reflection exception if an error occurs.
Register a color provider .