protected function addKeyStorageNode()
    {
        $builder = new TreeBuilder();
        $node    = $builder->root('key_storage', 'scalar');

        $node
            ->info('Class that is used to store your keys')
            ->defaultValue('Bitpay\Storage\EncryptedFilesystemStorage')
            ->validate()
                ->always()
                ->then(function ($value) {
                    if (!class_exists($value)) {
                        throw new \Exception(
                            sprintf(
                                'Could not find class "%s".',
                                $value
                            )
                        );
                    }

                    // requires PHP >= 5.3.7
                    if (!is_subclass_of($value, 'Bitpay\Storage\StorageInterface')) {
                        throw new \Exception(
                            sprintf(
                                '"%s" does not implement "Bitpay\Storage\StorageInterface"',
                                $value
                            )
                        );
                    }

                    return $value;
                })
            ->end();

        return $node;
    }
protected function addKeyStorageNode()
    {
        $builder = new TreeBuilder();
        $node    = $builder->root('key_storage', 'scalar');

        $node
            ->info('Class that is used to store your keys')
            ->defaultValue('Bitpay\Storage\EncryptedFilesystemStorage')
            ->validate()
                ->always()
                ->then(function ($value) {
                    if (!class_exists($value)) {
                        throw new \Exception(
                            sprintf(
                                'Could not find class "%s".',
                                $value
                            )
                        );
                    }

                    // requires PHP >= 5.3.7
                    if (!is_subclass_of($value, 'Bitpay\Storage\StorageInterface')) {
                        throw new \Exception(
                            sprintf(
                                '"%s" does not implement "Bitpay\Storage\StorageInterface"',
                                $value
                            )
                        );
                    }

                    return $value;
                })
            ->end();

        return $node;
    }
protected function addKeyStorageNode ( ) { $ builder = new TreeBuilder ( ) ; $ node = $ builder -> root ( 'key_storage' , 'scalar' ) ; $ node -> info ( 'Class that is used to store your keys' ) -> defaultValue ( 'Bitpay\Storage\EncryptedFilesystemStorage' ) -> validate ( ) -> always ( ) -> then ( function ( $ value ) { if ( ! class_exists ( $ value ) ) { throw new \ Exception ( sprintf ( 'Could not find class "%s".' , $ value ) ) ; } // requires PHP >= 5.3.7 if ( ! is_subclass_of ( $ value , 'Bitpay\Storage\StorageInterface' ) ) { throw new \ Exception ( sprintf ( '"%s" does not implement "Bitpay\Storage\StorageInterface"' , $ value ) ) ; } return $ value ; } ) -> end ( ) ; return $ node ; }
Adds the key_storage node with validation rules

key_storage MUST:
* implement Bitpay\Storage\StorageInterface
* be a class that can be loaded
Adds the key_storage node with validation rules