<commit_before><?php
/**
 * Created by mcfedr on 08/06/2016 23:37
 */

namespace Mcfedr\SqsQueueDriverBundle\Manager;

use Aws\Sqs\SqsClient;

trait SqsClientTrait
{
    /**
     * @var string
     */
    private $defaultUrl;

    /**
     * @var bool
     */
    private $debug;

    /**
     * @var SqsClient
     */
    private $sqs;

    /**
     * @var string[]
     */
    private $queues;

    private function setOptions(array $options)
    {
        $this->defaultUrl = $options['default_url'];
        $this->debug = $options['debug'];
        $this->queues = $options['queues'];
        if (!$this->debug) {
            $sqsOptions = [
                'region' => $options['region'],
                'version' => '2012-11-05'
            ];
            if (array_key_exists('credentials', $options)) {
                $sqsOptions['credentials'] = $options['credentials'];
            }
            $this->sqs = new SqsClient($sqsOptions);
        }
    }<commit_msg>Make default available as a queue name<commit_after><?php
/**
 * Created by mcfedr on 08/06/2016 23:37
 */

namespace Mcfedr\SqsQueueDriverBundle\Manager;

use Aws\Sqs\SqsClient;

trait SqsClientTrait
{
    /**
     * @var string
     */
    private $defaultUrl;

    /**
     * @var bool
     */
    private $debug;

    /**
     * @var SqsClient
     */
    private $sqs;

    /**
     * @var string[]
     */
    private $queues;

    private function setOptions(array $options)
    {
        $this->defaultUrl = $options['default_url'];
        $this->debug = $options['debug'];
        $this->queues = $options['queues'];
        if (!array_key_exists('default', $this->queues)) {
            $this->queues['default'] = $this->defaultUrl;
        }
        if (!$this->debug) {
            $sqsOptions = [
                'region' => $options['region'],
                'version' => '2012-11-05'
            ];
            if (array_key_exists('credentials', $options)) {
                $sqsOptions['credentials'] = $options['credentials'];
            }
            $this->sqs = new SqsClient($sqsOptions);
        }
    }
{'fraction_non_alphanumeric': 0.1590693257359924, 'fraction_numerical': 0.01899335232668566, 'mean_word_length': 1.831989247311828, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1460170', 'n_tokens_mistral': 698, 'n_tokens_neox': 664, 'n_words': 119}