<commit_before><?php
namespace Azera\Component\Queryable;

trait QuickAccessTrait {
    
    function get( $route , $default = false ) {
        
        $route = explode('.', $route);
        
        $value = $this->repository;
        
        foreach ( $route as $part )
            if ( is_object( $value ) )
                if ( property_exists( $value , $part ) )
                    $value = $value->{$part};
                else
                    return $default;
            elseif ( is_array( $value ) )
                if ( isset( $value[ $part ] ) )
                    $value = $value[ $part ];
                else
                    return $default;
            else
                return $default;
        
        return $value;
        
    }
    
    function getWithException( $route ) {
        
        $route = explode('.', $route);
        <commit_msg>add getAsQueryable()<commit_after><?php
namespace Azera\Component\Queryable;

trait QuickAccessTrait {
    
    function get( $route , $default = false ) {
        
        $route = explode('.', $route);
        
        $value = $this->repository;
        
        foreach ( $route as $part )
            if ( is_object( $value ) )
                if ( property_exists( $value , $part ) )
                    $value = $value->{$part};
                else
                    return $default;
            elseif ( is_array( $value ) )
                if ( isset( $value[ $part ] ) )
                    $value = $value[ $part ];
                else
                    return $default;
            else
                return $default;
        
        return $value;
        
    }
    
    function getAsQueryable( $route , $default = false ) {
        
        $route = explode('.', $route);
        
        $value = $this->repository;
        
        foreach ( $route as $part )
            if ( is_object( $value ) )
                if ( property_exists( $value , $part ) )
                    $value = $value->{$part};
                else
                    return $default;
            elseif ( is_array( $value ) )
                if ( isset( $value[ $part ] ) )
                    $value = $value[ $part ];
                else
                    return $default;
            else
                return $default;
        
        return new Queryable( (array)$value );
        
    }
    
    function getWithException( $route ) {
        
        $route = explode('.', $route);
        
{'fraction_non_alphanumeric': 0.11383748994368463, 'fraction_numerical': 0.0, 'mean_word_length': 1.0934343434343434, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6845731', 'n_tokens_mistral': 656, 'n_tokens_neox': 638, 'n_words': 157}