<commit_before><?php

namespace Sokil\Mongo;

class ClientPool
{
    private $_pool = array();
    
    private $_configuration;
    
    public function __construct(array $configuration)
    {
        $this->_configuration = $configuration;
    }
    
    public function addConnection($name, $dsn, $mapping = null, $defaultDatabase = null)
    {
        $this->_configuration[$name] = array(
            'dsn'               => $dsn,
            'defaultDatabase'   => $defaultDatabase,
            'mappign'           => $mapping,
        );
        
        return $this;
    }
    
    /**
     * Get instance of connection
     * 
     * @param string $name
     * @return \Sokil\Mongo\ClientPool
     * @throws \Exception
     */
    public function get($name)
    {
        // get from cache
        if(isset($this->_pool[$name])) {
            return $this->_pool[$name];
        }<commit_msg>magic method<commit_after><?php

namespace Sokil\Mongo;

class ClientPool
{
    private $_pool = array();
    
    private $_configuration;
    
    public function __construct(array $configuration)
    {
        $this->_configuration = $configuration;
    }
    
    public function addConnection($name, $dsn, $mapping = null, $defaultDatabase = null)
    {
        $this->_configuration[$name] = array(
            'dsn'               => $dsn,
            'defaultDatabase'   => $defaultDatabase,
            'mappign'           => $mapping,
        );
        
        return $this;
    }
    
    public function __get($name)
    {
        return $this->get($name);
    }
    
    /**
     * Get instance of connection
     * 
     * @param string $name
     * @return \Sokil\Mongo\ClientPool
     * @throws \Exception
     */
    public function get($name)
    {
        // get from cache
        if(isset($this->_pool[$name])) {
            return $this->_pool[$name];
        }
{'fraction_non_alphanumeric': 0.12519893899204243, 'fraction_numerical': 0.0, 'mean_word_length': 1.737300435413643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '3372928', 'n_tokens_mistral': 538, 'n_tokens_neox': 533, 'n_words': 114}