Return ServiceProvider according to Laravel version

@return \Intervention\Image\Provider\ProviderInterface
550139
private function getProvider()
    {
        if ($this->app instanceof \Laravel\Lumen\Application) {
            $provider = '\Intervention\Image\ImageServiceProviderLumen';
        } elseif (version_compare(\Illuminate\Foundation\Application::VERSION, '5.0', '<')) {
            $provider = '\Intervention\Image\ImageServiceProviderLaravel4';
        } else {
            $provider = '\Intervention\Image\ImageServiceProviderLaravel5';
        }

        return new $provider($this->app);
    }
739507
protected function getService()
    {
        if (!isset($this->service)) {
            $this->service = $this->getServiceLocator()
                    ->get($this->getModuleNamespace() . '\Service\\' . $this->getEntityName());
        }

        return $this->service;
    }
175495
private function loadServiceProvider()
    {
        \Tiga\Framework\Facade\Facade::setFacadeContainer($this);

        // Available Provider
        $providers = $this['config']->get('provider');

        $providers = array_unique($providers);

        foreach ($providers as $provider) {
            $instance = new $provider($this);
            $instance->register();
        }

        // Aliases
        $aliases = $this['config']->get('alias');

        $aliases = array_unique($aliases);

        $aliasMapper = \Tonjoo\Almari\AliasMapper::getInstance();

        $aliasMapper->classAlias($aliases);
    }
121153
public function getClient() {
		if (!$this->client) {
			// Create custom handler stack with middlewares
			$stack = HandlerStack::create();

			$context = $this;
			$stack->push(Middleware::mapResponse(function (ResponseInterface $response) use ($context) {
   				// If a new version of this accessor is available, store its COID
				if ($response->hasHeader('C-Accessor-Latest-Version'))
      				$context->setLatestAccessorVersionCOID(
						new IRI($response->getHeaderLine('C-Accessor-Latest-Version')));
    			return $response;
			}));

			// Prepare client options
			$options = [
				'base_uri' => str_replace('{aauid}', AAUIDParser::getAAUID($this->getAAUID()), $this->agwBaseUrl),
				'headers' => [
					'Authorization' => 'Bearer '.$this->getAccessToken()
				],
				'handler' => $stack
			];
			if (isset($this->request) && $this->request->hasHeader('X-Forwarded-For')) {
				$options['headers']['X-Forwarded-For'] = $this->request->getHeaderLine('X-Forwarded-For');				
			}

			// Create client
			$this->client = new Client($options);
		}
		return $this->client;
	}
61166
private function getLoginProvider()
    {
        if (!$this->loginProviderClassName) {
            return Container::instance(LoginProvider::class);
        }

        $provider = $this->loginProviderClassName;
        return new $provider();
    }
996370
private function getProvider($providerServiceKey)
    {
        try {
            $provider = $this->getContainer()->get($providerServiceKey);
        } catch (ServiceNotFoundException $e) {
            throw new \InvalidArgumentException(sprintf('Provider "%s" should be defined as a service.', $providerServiceKey), $e->getCode(), $e);
        }
        if (!$provider instanceof ProviderInterface) {
            throw new \InvalidArgumentException(sprintf('Provider "%s" should implement Mailjet\MailjetBundle\Provider\ProviderInterface.', $providerServiceKey));
        }
        return $provider;
    }
350264
final public function getServices()
    {
        if (is_null($this->serviceProviders)) {
            $this->serviceProviders = $this->getServiceProviders();
        }

        return $this->serviceProviders;
    }
364623
public static function getProvider($classname) {
		if (array_key_exists($classname, self::$providers)) {
			return self::$providers[$classname];
		}
		
		$provider = new $classname;
		
		if (!($provider instanceof ServiceProviderInterface)) {
			throw new \InvalidArgumentException("$classname is not a valid ServiceProviderInterface instance");
		}

		self::$providers[$classname] = $provider;
		return self::$providers[$classname];
	}
1038690
public function getProvider()
    {
        if (null === $this->provider) {
            if (0 === count($this->providers)) {
                throw new \RuntimeException('No provider registered.');
            } else {
                $this->provider = $this->providers[key($this->providers)];
            }
        }

        return $this->provider;
    }
1347630
protected function getRenderer()
    {
        if ($this->renderer === null) {
            $this->renderer = $this->serviceLocator->get('ViewRenderer');
        }

        return $this->renderer;
    }
958812
public function getCacheManager()
    {
        if (!$this->cacheManager) {
            $this->cacheManager = $this->getServiceLocator()->get('HtProfileImage\Service\CacheManager');
        }

        return $this->cacheManager;
    }
1317025
public function getServiceManager()
    {
        $serviceManager = $this->getServiceLocator();
        if ($serviceManager instanceof ServiceManager) {
            return $serviceManager;
        }
        $msg = is_null($serviceManager)
            ? 'ServiceLocator not initialized for '.get_class($this)
            : 'Alternate service locator not compatible with getServiceManager() in ' . __CLASS__;
        throw new InvalidServiceManagerException($msg);
    }
409238
protected function getZendServiceManager()
    {
        if (is_null($this->services)) {
            $options = $this->getOptions();
            $options['services']['search.options']['model'] = $this->model;
            $config         = new Config($options);
            $this->services =  new ServiceManager($config);
        }
        return $this->services;
    }
385806
public function getProvider($provider)
    {
        // Check if an instance has already been initiated. If not
        // build it and then add to the providers array.
        if (!isset($this->providers[$provider])) {
            $this->addProvider($provider);
        }

        return $this->providers[$provider];
    }
165242
public function getProviders()
    {
        $result = $this->getDrivers();

        foreach ($this->customCreators ?? [] as $key => $val) {
            $result[ $key ] = $val;
        }

        return $result;
    }
206222
private function createServiceProvider()
    {
        $serviceProviderClass = $this->moduleName . "ServiceProvider";
        $serviceProviderFileName = $serviceProviderClass . '.php';
        $serviceProviderPath = $this->moduleDirectory . DIRECTORY_SEPARATOR . $serviceProviderFileName;

        if (file_exists($serviceProviderPath) && $this->isForce == false) {
            $this->info($serviceProviderFileName . ' file exists. Skip.');
            return $serviceProviderPath;
        }

        $serviceProviderContent = $this->generateServiceProviderContent();
        file_put_contents($serviceProviderPath, $serviceProviderContent);
        $this->info('ServiceProvider file is set: ' . $serviceProviderFileName);
        $this->line($serviceProviderPath);

        return $serviceProviderPath;
    }
1103790
protected function getClassService()
    {
        if (is_null($this->service)) {
            $this->service = DeliveryTemplateService::singleton();
        }
        return $this->service;
    }