src/ContainerBuilder.php
public function add(string $serviceName, string $serviceClass, array $serviceArguments = [], bool $isShared = true) : ServiceDefinition
    {
        $service = new ServiceDefinition($serviceClass, $serviceArguments);
        $this->addService($serviceName, $service, $isShared);

        return $service;
    }
public function add(string $serviceName, string $serviceClass, array $serviceArguments = [], bool $isShared = true) : ServiceDefinition
    {
        $service = new ServiceDefinition($serviceClass, $serviceArguments);
        $this->addService($serviceName, $service, $isShared);

        return $service;
    }
Add a service by string and arguments array.

@param string            $serviceName
@param string            $serviceClass
@param array             $serviceArguments
@param bool              $shared
@return ServiceDefinition