2023-09-07 05:43:48 +00:00
|
|
|
/**
|
|
|
|
* Registers the service provider with a DI container.
|
|
|
|
*
|
|
|
|
* @param Container $container The DI container.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @since 2.0.1
|
|
|
|
*/
|
|
|
|
public function register(Container $container)
|
|
|
|
{
|
|
|
|
$container->alias(Translations::class, 'GetBible.Api.Translations')
|
|
|
|
->share('GetBible.Api.Translations', [$this, 'getTranslations'], true);
|
|
|
|
|
|
|
|
$container->alias(Books::class, 'GetBible.Api.Books')
|
|
|
|
->share('GetBible.Api.Books', [$this, 'getBooks'], true);
|
|
|
|
|
|
|
|
$container->alias(Chapters::class, 'GetBible.Api.Chapters')
|
|
|
|
->share('GetBible.Api.Chapters', [$this, 'getChapters'], true);
|
|
|
|
|
|
|
|
$container->alias(Verses::class, 'GetBible.Api.Verses')
|
|
|
|
->share('GetBible.Api.Verses', [$this, 'getVerses'], true);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Translations class
|
|
|
|
*
|
|
|
|
* @param Container $container The DI container.
|
|
|
|
*
|
|
|
|
* @return Translations
|
|
|
|
* @since 3.2.0
|
|
|
|
*/
|
|
|
|
public function getTranslations(Container $container): Translations
|
|
|
|
{
|
|
|
|
return new Translations(
|
|
|
|
$container->get('GetBible.Utilities.Http'),
|
|
|
|
$container->get('GetBible.Utilities.Uri'),
|
|
|
|
$container->get('GetBible.Utilities.Response')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Books class
|
|
|
|
*
|
|
|
|
* @param Container $container The DI container.
|
|
|
|
*
|
|
|
|
* @return Books
|
|
|
|
* @since 3.2.0
|
|
|
|
*/
|
|
|
|
public function getBooks(Container $container): Books
|
|
|
|
{
|
|
|
|
return new Books(
|
|
|
|
$container->get('GetBible.Utilities.Http'),
|
|
|
|
$container->get('GetBible.Utilities.Uri'),
|
|
|
|
$container->get('GetBible.Utilities.Response')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Chapters class
|
|
|
|
*
|
|
|
|
* @param Container $container The DI container.
|
|
|
|
*
|
|
|
|
* @return Chapters
|
|
|
|
* @since 3.2.0
|
|
|
|
*/
|
|
|
|
public function getChapters(Container $container): Chapters
|
|
|
|
{
|
|
|
|
return new Chapters(
|
|
|
|
$container->get('GetBible.Utilities.Http'),
|
|
|
|
$container->get('GetBible.Utilities.Uri'),
|
|
|
|
$container->get('GetBible.Utilities.Response')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Verses class
|
|
|
|
*
|
|
|
|
* @param Container $container The DI container.
|
|
|
|
*
|
|
|
|
* @return Verses
|
|
|
|
* @since 3.2.0
|
|
|
|
*/
|
|
|
|
public function getVerses(Container $container): Verses
|
|
|
|
{
|
|
|
|
return new Verses(
|
|
|
|
$container->get('GetBible.Utilities.Http'),
|
|
|
|
$container->get('GetBible.Utilities.Uri'),
|
|
|
|
$container->get('GetBible.Utilities.Response')
|
|
|
|
);
|
|
|
|
}
|