/home/techb158/ileadtechnology.com/vendor/vimeo/laravel/src
Edit: /home/techb158/ileadtechnology.com/vendor/vimeo/laravel/src/VimeoServiceProvider.php (3587B)
*/
class VimeoServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/
public function boot()
{
$this->setupConfig();
}
/**
* Setup the config.
*
* @return void
*/
protected function setupConfig()
{
$source = realpath(__DIR__.'/../config/vimeo.php');
if (!$source) {
throw new \UnexpectedValueException('Could not locate config');
}
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
$this->publishes([$source => config_path('vimeo.php')]);
} elseif ($this->app instanceof LumenApplication) {
$this->app->configure('vimeo');
}
$this->mergeConfigFrom($source, 'vimeo');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->registerFactory();
$this->registerManager();
$this->registerBindings();
}
/**
* Register the factory class.
*
* @return void
*/
protected function registerFactory()
{
$this->app->singleton('vimeo.factory', function () : VimeoFactory {
return new VimeoFactory();
});
$this->app->alias('vimeo.factory', VimeoFactory::class);
}
/**
* Register the manager class.
*
* @return void
*/
protected function registerManager()
{
$this->app->singleton('vimeo', function (Container $app) : VimeoManager {
/** @var \Illuminate\Contracts\Config\Repository */
$config = $app['config'];
/** @var \Vimeo\Laravel\VimeoFactory */
$factory = $app['vimeo.factory'];
return new VimeoManager($config, $factory);
});
$this->app->alias('vimeo', VimeoManager::class);
}
/**
* Register the bindings.
*
* @return void
*/
protected function registerBindings()
{
$this->app->bind('vimeo.connection', function (Container $app) : Vimeo {
/** @var VimeoManager */
$manager = $app['vimeo'];
/** @var Vimeo */
return $manager->connection();
});
$this->app->alias('vimeo.connection', Vimeo::class);
}
/**
* Get the services provided by the provider.
*
* @return string[]
*/
public function provides(): array
{
return [
'vimeo',
'vimeo.factory',
'vimeo.connection',
];
}
}