library/Services/ServiceFactory.php
public function createService($serviceClass)
    {
        $className = $serviceClass;
        if (!$this->isNamespacedClass($serviceClass)) {
            // Used for backwards compatibility.
            $className = $this->formClassName($serviceClass);
        }
        if (!class_exists($className)) {
            throw new Exception("Service '$serviceClass' was not found!");
        }
        $service = new $className($this->getServiceConfig());

        if (!($service instanceof ShopServiceInterface)) {
            throw new Exception("Service '$className' does not implement ShopServiceInterface interface!");
        }

        return $service;
    }
public function createService($serviceClass)
    {
        $className = $serviceClass;
        if (!$this->isNamespacedClass($serviceClass)) {
            // Used for backwards compatibility.
            $className = $this->formClassName($serviceClass);
        }
        if (!class_exists($className)) {
            throw new Exception("Service '$serviceClass' was not found!");
        }
        $service = new $className($this->getServiceConfig());

        if (!($service instanceof ShopServiceInterface)) {
            throw new Exception("Service '$className' does not implement ShopServiceInterface interface!");
        }

        return $service;
    }
public function createService ( $ serviceClass ) { $ className = $ serviceClass ; if ( ! $ this -> isNamespacedClass ( $ serviceClass ) ) { // Used for backwards compatibility. $ className = $ this -> formClassName ( $ serviceClass ) ; } if ( ! class_exists ( $ className ) ) { throw new Exception ( "Service '$serviceClass' was not found!" ) ; } $ service = new $ className ( $ this -> getServiceConfig ( ) ) ; if ( ! ( $ service instanceof ShopServiceInterface ) ) { throw new Exception ( "Service '$className' does not implement ShopServiceInterface interface!" ) ; } return $ service ; }
Creates Service object. All services must implement ShopService interface

@param string $serviceClass

@throws Exception

@return ShopServiceInterface
Creates Service object . All services must implement ShopService interface