DependencyInjection/CompilerPass/RepositoryCompilerPass.php
private function injectRepositoryCredentials(
        Definition $definition,
        string $appName,
        array $repositoryConfiguration,
        string $indexName
    ) {
        if ($repositoryConfiguration['app_id']) {
            $repositoryReferenceName = rtrim("apisearch.repository_reference.$appName.$indexName", '.');
            $tokenUUIDName = rtrim("apisearch.token_uuid.$appName");
            $repositoryReferenceReference = new Reference($repositoryReferenceName);

            $repositoryConfiguration['token']
                ? $definition->addMethodCall('setCredentials', [
                    $repositoryReferenceReference,
                    new Reference($tokenUUIDName),
                ])
                : $definition->addMethodCall('setRepositoryReference', [
                    $repositoryReferenceReference,
                ]);
        }
    }
private function injectRepositoryCredentials(
        Definition $definition,
        string $appName,
        array $repositoryConfiguration,
        string $indexName
    ) {
        if ($repositoryConfiguration['app_id']) {
            $repositoryReferenceName = rtrim("apisearch.repository_reference.$appName.$indexName", '.');
            $tokenUUIDName = rtrim("apisearch.token_uuid.$appName");
            $repositoryReferenceReference = new Reference($repositoryReferenceName);

            $repositoryConfiguration['token']
                ? $definition->addMethodCall('setCredentials', [
                    $repositoryReferenceReference,
                    new Reference($tokenUUIDName),
                ])
                : $definition->addMethodCall('setRepositoryReference', [
                    $repositoryReferenceReference,
                ]);
        }
    }
private function injectRepositoryCredentials ( Definition $ definition , string $ appName , array $ repositoryConfiguration , string $ indexName ) { if ( $ repositoryConfiguration [ 'app_id' ] ) { $ repositoryReferenceName = rtrim ( "apisearch.repository_reference.$appName.$indexName" , '.' ) ; $ tokenUUIDName = rtrim ( "apisearch.token_uuid.$appName" ) ; $ repositoryReferenceReference = new Reference ( $ repositoryReferenceName ) ; $ repositoryConfiguration [ 'token' ] ? $ definition -> addMethodCall ( 'setCredentials' , [ $ repositoryReferenceReference , new Reference ( $ tokenUUIDName ) , ] ) : $ definition -> addMethodCall ( 'setRepositoryReference' , [ $ repositoryReferenceReference , ] ) ; } }
Inject credentials in repository.

@param Definition $definition
@param string     $appName
@param array      $repositoryConfiguration
@param string     $indexName
Inject credentials in repository .