src/lib/Herrera/Wise/Wise.php
private function process(array $data, $resource, $type, $require)
    {
        if ($this->processor) {
            if ($this->processor instanceof ProcessorInterface) {
                if ($this->processor->supports($resource, $type)) {
                    $data = $this->processor->process($data);
                } elseif ($require) {
                    throw ProcessorException::format(
                        'The resource "%s"%s is not supported by the processor.',
                        is_string($resource) ? $resource : gettype($resource),
                        $type ? " ($type)" : ''
                    );
                }
            } else {
                $processor = new Processor();
                $data = $processor->processConfiguration(
                    $this->processor,
                    $data
                );
            }
        } elseif ($require) {
            throw ProcessorException::format(
                'No processor registered to handle any resource.'
            );
        }

        return $data;
    }
private function process(array $data, $resource, $type, $require)
    {
        if ($this->processor) {
            if ($this->processor instanceof ProcessorInterface) {
                if ($this->processor->supports($resource, $type)) {
                    $data = $this->processor->process($data);
                } elseif ($require) {
                    throw ProcessorException::format(
                        'The resource "%s"%s is not supported by the processor.',
                        is_string($resource) ? $resource : gettype($resource),
                        $type ? " ($type)" : ''
                    );
                }
            } else {
                $processor = new Processor();
                $data = $processor->processConfiguration(
                    $this->processor,
                    $data
                );
            }
        } elseif ($require) {
            throw ProcessorException::format(
                'No processor registered to handle any resource.'
            );
        }

        return $data;
    }
private function process ( array $ data , $ resource , $ type , $ require ) { if ( $ this -> processor ) { if ( $ this -> processor instanceof ProcessorInterface ) { if ( $ this -> processor -> supports ( $ resource , $ type ) ) { $ data = $ this -> processor -> process ( $ data ) ; } elseif ( $ require ) { throw ProcessorException :: format ( 'The resource "%s"%s is not supported by the processor.' , is_string ( $ resource ) ? $ resource : gettype ( $ resource ) , $ type ? " ($type)" : '' ) ; } } else { $ processor = new Processor ( ) ; $ data = $ processor -> processConfiguration ( $ this -> processor , $ data ) ; } } elseif ( $ require ) { throw ProcessorException :: format ( 'No processor registered to handle any resource.' ) ; } return $ data ; }
Processes the configuration definition.

@param array   $data     The configuration data.
@param mixed   $resource A resource.
@param string  $type     The resource type.
@param boolean $require  Require processing?

@return array The processed configuration data.

@throws ProcessorException If the processor could not be used and it is
require that one be used.
Processes the configuration definition .