src/Valkyrja/Container/NativeContainer.php
protected function getServiceFromContext(
        ServiceContext $serviceContext,
        string $context = null,
        string $member = null
    ): Service {
        $service   = new Service();
        $serviceId = $this->contextServiceId(
            $serviceContext->getId(),
            $context,
            $member
        );

        $service
            ->setId($serviceId)
            ->setSingleton($serviceContext->isSingleton())
            ->setDefaults($serviceContext->getDefaults())
            ->setName($serviceContext->getName())
            ->setClass($serviceContext->getContextClass())
            ->setProperty($serviceContext->getContextProperty())
            ->setMethod($serviceContext->getContextMethod())
            ->setFunction($serviceContext->getContextFunction())
            ->setClosure($serviceContext->getContextClosure())
            ->setArguments($serviceContext->getArguments())
            ->setDependencies($serviceContext->getDependencies())
            ->setStatic($serviceContext->isStatic());

        return $service;
    }
protected function getServiceFromContext(
        ServiceContext $serviceContext,
        string $context = null,
        string $member = null
    ): Service {
        $service   = new Service();
        $serviceId = $this->contextServiceId(
            $serviceContext->getId(),
            $context,
            $member
        );

        $service
            ->setId($serviceId)
            ->setSingleton($serviceContext->isSingleton())
            ->setDefaults($serviceContext->getDefaults())
            ->setName($serviceContext->getName())
            ->setClass($serviceContext->getContextClass())
            ->setProperty($serviceContext->getContextProperty())
            ->setMethod($serviceContext->getContextMethod())
            ->setFunction($serviceContext->getContextFunction())
            ->setClosure($serviceContext->getContextClosure())
            ->setArguments($serviceContext->getArguments())
            ->setDependencies($serviceContext->getDependencies())
            ->setStatic($serviceContext->isStatic());

        return $service;
    }
Get a service model from a context model.

@param ServiceContext $serviceContext The service context
@param string         $context        [optional] The context
class or function
@param string         $member         [optional] The member

@return Service