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

        if (array_key_exists('class', $definition)) {
            return new Component(
                $definition['class'],
                $definition['arguments'] ?: [],
                $definition['calls'] ?: []
            );
        }

        throw new AppException(sprintf('Invalid component format, must be callable or array with class key, got "%s"', $this->getType($definition)));
    }
public function buildDefinition($definition)
    {
        if (is_callable($definition)) {
            return $definition;
        }

        if (array_key_exists('class', $definition)) {
            return new Component(
                $definition['class'],
                $definition['arguments'] ?: [],
                $definition['calls'] ?: []
            );
        }

        throw new AppException(sprintf('Invalid component format, must be callable or array with class key, got "%s"', $this->getType($definition)));
    }
public function buildDefinition ( $ definition ) { if ( is_callable ( $ definition ) ) { return $ definition ; } if ( array_key_exists ( 'class' , $ definition ) ) { return new Component ( $ definition [ 'class' ] , $ definition [ 'arguments' ] ? : [ ] , $ definition [ 'calls' ] ? : [ ] ) ; } throw new AppException ( sprintf ( 'Invalid component format, must be callable or array with class key, got "%s"' , $ this -> getType ( $ definition ) ) ) ; }
Creates component definition

@param array|callable $definition

@return Component
@throws AppException
Creates component definition