inspirum/balikobot-symfony

Symfony bundle for inspirum/balikobot library

v1.3.0 2024-04-21 11:18 UTC

This package is auto-updated.

Last update: 2024-11-17 13:32:36 UTC


README

Latest Stable Version Build Status PHPStan Total Downloads Software License

Symfony integration for inspirum/balikobot.

Installation

Run composer require command:

composer require inspirum/balikobot-symfony

Enable bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

<?php

return [
    // ...
    Inspirum\Balikobot\Integration\Symfony\BalikobotBundle::class => ['all' => true],
];

Configure client credentials by adding config/packages/balikobot.yaml and setting the env variables:

balikobot:
    connections:
        default:
            api_user: '%env(resolve:BALIKOBOT_API_USER)%'
            api_key: '%env(resolve:BALIKOBOT_API_KEY)%'

You can use multiple client credentials

balikobot:
    default_connection: 'client2'
    connections:
        client1:
            api_user: '%env(resolve:BALIKOBOT_API_USER_1)%'
            api_key: '%env(resolve:BALIKOBOT_API_KEY_1)%'
        client2:
            api_user: '%env(resolve:BALIKOBOT_API_USER_2)%'
            api_key: '%env(resolve:BALIKOBOT_API_KEY_2)%'
        client3:
            api_user: '%env(resolve:BALIKOBOT_API_USER_3)%'
            api_key: '%env(resolve:BALIKOBOT_API_KEY_3)%'

Usage

Use ServiceContainerRegistry to get ServiceContainer for given connection.

/** @var Inspirum\Balikobot\Service\Registry\ServiceContainerRegistry $registry */

// get package service for default (or first) connection
$packageService = $registry->get()->getPackageService();

// get branch service for "client3" connection
$packageService = $registry->get('client3')->getBranchService();

or use services directly for default connection

/** @var Inspirum\Balikobot\Service\PackageService $packageService */
$packageService->addPackages(...)

/** @var Inspirum\Balikobot\Service\BranchService $branchService */
$branchService->getBranches(...)

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email tomas.novotny@inspirum.cz instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.