src/TagPlanet/UniversalAnalytics/UniversalAnalytics.php
public function get($name)
    {
        if($name == '')
        {
            // If no name was passed, we'll assume they wanted the first (and usually only)
            if(count($this->instances) == 1)
            {
                // Grab the instance without knowing tracker name
                $instances = array_values($this->instances);
                return array_shift($instances);
            }
            
            // More or less than one instances
            throw new InvalidArgumentException('Unspecified Universal Analytics tracker name');
        }
        
        // Positive look up on the tracker name?
        if(isset($this->instances[$name]))
            return $this->instances[$name];
            
        // No UA instance with that tracker name! Are you sure?
        throw new Exception('Universal Analytics instance for "' . $name . '" doesn\'t exist');
    }
public function get($name)
    {
        if($name == '')
        {
            // If no name was passed, we'll assume they wanted the first (and usually only)
            if(count($this->instances) == 1)
            {
                // Grab the instance without knowing tracker name
                $instances = array_values($this->instances);
                return array_shift($instances);
            }
            
            // More or less than one instances
            throw new InvalidArgumentException('Unspecified Universal Analytics tracker name');
        }
        
        // Positive look up on the tracker name?
        if(isset($this->instances[$name]))
            return $this->instances[$name];
            
        // No UA instance with that tracker name! Are you sure?
        throw new Exception('Universal Analytics instance for "' . $name . '" doesn\'t exist');
    }
public function get ( $ name ) { if ( $ name == '' ) { // If no name was passed, we'll assume they wanted the first (and usually only) if ( count ( $ this -> instances ) == 1 ) { // Grab the instance without knowing tracker name $ instances = array_values ( $ this -> instances ) ; return array_shift ( $ instances ) ; } // More or less than one instances throw new InvalidArgumentException ( 'Unspecified Universal Analytics tracker name' ) ; } // Positive look up on the tracker name? if ( isset ( $ this -> instances [ $ name ] ) ) return $ this -> instances [ $ name ] ; // No UA instance with that tracker name! Are you sure? throw new Exception ( 'Universal Analytics instance for "' . $ name . '" doesn\'t exist' ) ; }
Find a single tracker instance

@return TagPlanet\UniversalAnalytics\UniversalAnalyticsInstance
Find a single tracker instance