protected function validate($config): void
    {
        // Check that $config is an array
        if (! Validator::arrayType()->validate($config)) {
            throw new InvalidConfigException('The config must be an array.');
        }

        // Check boolean parameters
        if (! Validator::key('interface', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"interface" parameter must be set as a boolean.');
        }
        if (! Validator::key('private', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"private" parameter must be set as a boolean.');
        }
        if (! Validator::key('auto', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"auto" parameter must be set as a boolean.');
        }

        $this->validatePhpdoc($config);
    }
protected function validate($config): void
    {
        // Check that $config is an array
        if (! Validator::arrayType()->validate($config)) {
            throw new InvalidConfigException('The config must be an array.');
        }

        // Check boolean parameters
        if (! Validator::key('interface', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"interface" parameter must be set as a boolean.');
        }
        if (! Validator::key('private', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"private" parameter must be set as a boolean.');
        }
        if (! Validator::key('auto', Validator::boolType())->validate($config)) {
            throw new InvalidConfigException('"auto" parameter must be set as a boolean.');
        }

        $this->validatePhpdoc($config);
    }
protected function validate ( $ config ) : void { // Check that $config is an array if ( ! Validator :: arrayType ( ) -> validate ( $ config ) ) { throw new InvalidConfigException ( 'The config must be an array.' ) ; } // Check boolean parameters if ( ! Validator :: key ( 'interface' , Validator :: boolType ( ) ) -> validate ( $ config ) ) { throw new InvalidConfigException ( '"interface" parameter must be set as a boolean.' ) ; } if ( ! Validator :: key ( 'private' , Validator :: boolType ( ) ) -> validate ( $ config ) ) { throw new InvalidConfigException ( '"private" parameter must be set as a boolean.' ) ; } if ( ! Validator :: key ( 'auto' , Validator :: boolType ( ) ) -> validate ( $ config ) ) { throw new InvalidConfigException ( '"auto" parameter must be set as a boolean.' ) ; } $ this -> validatePhpdoc ( $ config ) ; }
Validate a configuration to know if it can be used to construct an instance.

@param mixed $config The configuration to validate.

@throws InvalidConfigException If the $config is invalid.
Validate a configuration to know if it can be used to construct an instance .