Gets the path of a service.

@param string $serviceName

@return string
772871
public function getPath($serviceName)
    {
        if (in_array($serviceName, $this->services)) {
            return str_replace('_', '/', $serviceName);
        } else {
            $services = implode(', ', $this->services);
            throw new \Exception("Service \"{$serviceName}\" is not one of: {$services}");
        }
    }
701829
private function getServiceId($serviceKey) {
        return ((interface_exists($serviceKey) || class_exists($serviceKey)) && defined($serviceKey . '::SERVICE_ID'))
            ? $serviceKey::SERVICE_ID
            : (string)$serviceKey
        ;
    }
973864
public function get($serviceName)
    {
        if ($this->registry->has($serviceName)) {
            $service = $this->registry->getStrict($serviceName);
        }
        elseif ($this->parameterContainer->has($serviceName)) {
            $service = $this->parameterContainer->get($serviceName);
        }
        else {
            $service = $this->resolveService($serviceName);
        }

        return $service;
    }
214484
public function get($serviceName)
    {
        if ($this->registry->has($serviceName)) {
            return $this->registry->get($serviceName);
        }

        $serviceConfig = $this->classes->resolve($serviceName, null);

        if ($serviceConfig == null) {
            throw new \DICIT\UnknownDefinitionException($serviceName);
        }

        try {
            return $this->loadService($serviceName, $serviceConfig->extract());
        }
        catch (\DICIT\UnknownDefinitionException $ex) {
            throw new \RuntimeException(
                sprintf("Dependency '%s' not found while trying to build '%s'.",
                    $ex->getServiceName(), $serviceName));
        }
    }
802024
public function socialLogin($serviceName)
    {
        if (config('services.' . $serviceName)) {
            $this->setDynamicRedirectUrl($serviceName);
            return $this->socialite->driver($serviceName)->redirect();
        }
        return redirect('/');
    }
575259
protected function getRoutePath($name)
    {
        $routeName = str_replace_first('api.', '', $this->getRouteName($name));
        $routeNameExploded = explode('.', $routeName);
        $routePath = str_replace('.', '/', $routeName);
        if ($this->option('parent') && count($routeNameExploded) >= 2) {
            $routePath = str_replace_last('/', '.', $routePath);
        }
        return $routePath;
    }
215653
public function getServiceUrl($version = null)
    {
        if ($version) {
            return $this->getWebserviceUrl() . $this->getServicePath($version);
        } else {
            return $this->getWebserviceUrl() . $this->getServicePath();
        }
    }
1260477
private function findName($service, ServiceConfig $serviceConfig)
    {
        if ($serviceConfig->has(ServiceConfig::NAME)) {
            return $serviceConfig->get(ServiceConfig::NAME);
        } else {
            foreach ((array) $this->possibleNames as $possibleName) {
                if (isset($service[$possibleName])) {
                    return $possibleName;
                }
            }
        }

        return null;
    }
691927
public function getPath($name)
    {
        $segments = explode('\\', $name);

        array_shift($segments);
        if($this->path)
            return $this->path.'/'.ucfirst(array_last($segments)).'Factory.php';
        else
            return database_path('factories/'.ucfirst(array_last($segments))).'Factory.php';

    }
1162699
public function path($context = null, $sizeName = null)
    {
        $path = '/';
        $path .= (null !== $context) ? $context . '/' : null;
        $path .= (null !== $sizeName) ? $sizeName . '/' : null;

        return $path;
    }
641335
public static final function toServiceFile(string $serviceName): string
    {
        $serviceFile = sprintf('%s/app/service/%s/%s.php', APP_DIR, $serviceName, $serviceName);
        if (!file_exists($serviceFile) && (
            $serviceName == (Service::SERVICE_MAIN . Service::SERVICE_NAME_SUFFIX)
                || $serviceName == (Service::SERVICE_FAIL . Service::SERVICE_NAME_SUFFIX))) {
            $serviceFile = sprintf('%s/app/service/_default/%s/%s.php', APP_DIR, $serviceName, $serviceName);
        }

        return $serviceFile;
    }
385830
private function getServiceFromPath($path)
    {
        /* Ensure the path is in a standard form, removing empty elements. */
        $path = implode('/', array_filter(array_map('trim', explode('/', $path)), 'strlen'));

        /* If using the basePath option, strip the basePath. Otherwise, the path becomes the basename of the URI. */
        if (isset($this->options[self::KEY_BASE_PATH])) {
            $basePathPosition = strpos($path, $this->options[self::KEY_BASE_PATH]);
            if (false !== $basePathPosition) {
                $path = substr($path, $basePathPosition + strlen($this->options[self::KEY_BASE_PATH]));
            }

            return trim(dirname($path), "/") . '/' .  basename($path, '.php'); /* For example, x/y/z/FooService */
        } else {
            return basename($path, '.php'); /* For example: FooService, from /x/y/z/FooService.php */
        }
    }
896224
public static final function toServiceName(string $serviceName): string
    {
        // foo-bar => FooBar
        $serviceName = ucfirst($serviceName);
        if (strpos($serviceName, '-')) {
            $serviceName = preg_replace_callback('~-([a-z])~i', function($match) {
                return ucfirst($match[1]);
            }, $serviceName);
        }

        // foo-bar => FooBarService
        if ($serviceName == Service::SERVICE_NAME_SUFFIX || substr($serviceName, -7) != Service::SERVICE_NAME_SUFFIX) {
            $serviceName .= Service::SERVICE_NAME_SUFFIX;
        }

        return $serviceName;
    }
1311010
public function get($serviceName)
    {
        if (! $this->has($serviceName)) {
            throw new NotFoundException('Error: Could not find service');
        }

        $serviceProvider = $this->serviceProviders[$serviceName];

        if (! is_string($serviceProvider)) {
            throw new ContainerException(
                'Error: Expected class name of service provider as string but got "'.gettype($serviceProvider).'"'
            );
        }

        try {
            // The name of the service provider class is stored, try to create an object from it
            /** @var AbstractServiceProvider $serviceProvider */
            $serviceProvider = new $serviceProvider($serviceName, $this);
        } catch (\Exception $exception) {
            throw new ContainerException('Error: Could not create service provider via reflection');
        }

        if (! is_a($serviceProvider, AbstractServiceProvider::class)) {
            throw new ContainerException(
                'Error: Service provider object does not inherit from AbstractServiceProvider'
            );
        }

        try {
            // Try to make the provider provide the service. Might throw an exception.
            $object = $serviceProvider->provide();
        } catch (\Exception $exception) {
            if (is_a($exception, ContainerException::class)) {
                /** @var ContainerException $exception */
                throw $exception;
            } else {
                throw new ContainerException(
                    'Error: Service provider could not create service. Reason: '.$exception->getMessage()
                );
            }
        }

        if (! is_object($object)) {
            throw new ContainerException('Error: Service provider did not provide a valid service object');
        }

        return $object;
    }
259957
protected function getWsdl($serviceName)
	{
		if($this->cacheStatus)
		{
			if(null === $this->cacheInstance)
			{
				$this->createCacheInstance();
			}
			$_this = $this;
			return $this->cacheInstance->get($cacheName,function()use($serviceName,$_this){
				return $_this->getWsdlNoCache($serviceName);
			},array('raw'=>true));
		}
		else
		{
			return $this->getWsdlNoCache($serviceName);
		}
	}
1199644
protected function getPath($name)
    {
        $name = Str::replaceFirst($this->rootNamespace(), '', $name);

        return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
    }
123605
public function getPath($name)
    {
        if ($this->callerNotSelfOrPathsProxy()) {
            Deprecated::method(3.3, 'Use Bolt\Filesystem (recommended) or PathResolver::resolve instead.');
        }

        return $this->getPathObject($name)->string();
    }