public function buildDefinition($definition)
    {
        if (is_callable($definition)) {
            return $definition;
        }

        if (is_array($definition) && isset($definition['component'])) {
            return new Listener(
                $definition['component'],
                $definition['method'] ?: null,
                $definition['arguments'] ? (array) $definition['arguments'] : []
            );
        }

        throw new AppException('Invalid listener format, must be callable or array with component key');
    }
public function buildDefinition($definition)
    {
        if (is_callable($definition)) {
            return $definition;
        }

        if (is_array($definition) && isset($definition['component'])) {
            return new Listener(
                $definition['component'],
                $definition['method'] ?: null,
                $definition['arguments'] ? (array) $definition['arguments'] : []
            );
        }

        throw new AppException('Invalid listener format, must be callable or array with component key');
    }
public function buildDefinition ( $ definition ) { if ( is_callable ( $ definition ) ) { return $ definition ; } if ( is_array ( $ definition ) && isset ( $ definition [ 'component' ] ) ) { return new Listener ( $ definition [ 'component' ] , $ definition [ 'method' ] ? : null , $ definition [ 'arguments' ] ? ( array ) $ definition [ 'arguments' ] : [ ] ) ; } throw new AppException ( 'Invalid listener format, must be callable or array with component key' ) ; }
Creates listener definition

@param array|callable $definition

@return Listener
@throws AppException
Creates listener definition