src/Peekmo/JsonPath/JsonPath.php
private function tempFilters($filter)
    {
        $f = $filter[1];
        $elements = explode('\'', $f);

        // Hack to make "dot" works on filters
        for ($i=0, $m=0; $i<count($elements); $i++) {
            if ($m%2 == 0) {
                if ($i > 0 && substr($elements[$i-1], 0, 1) == '\\') {
                    continue;
                }

                $e = explode('.', $elements[$i]);
                $str = ''; $first = true;
                foreach ($e as $substr) {
                    if ($first) {
                        $str = $substr;
                        $first = false;
                        continue;
                    }

                    $end = null;
                    if (false !== $pos = $this->strpos_array($substr, $this->keywords)) {
                        list($substr, $end) = array(substr($substr, 0, $pos), substr($substr, $pos, strlen($substr)));
                    }

                    $str .= '[' . $substr . ']';
                    if (null !== $end) {
                        $str .= $end;
                    }
                }
                $elements[$i] = $str;
            }

            $m++;
        }

        return "[#" . (array_push($this->result, implode('\'', $elements)) - 1) . "]";
    }
private function tempFilters($filter)
    {
        $f = $filter[1];
        $elements = explode('\'', $f);

        // Hack to make "dot" works on filters
        for ($i=0, $m=0; $i<count($elements); $i++) {
            if ($m%2 == 0) {
                if ($i > 0 && substr($elements[$i-1], 0, 1) == '\\') {
                    continue;
                }

                $e = explode('.', $elements[$i]);
                $str = ''; $first = true;
                foreach ($e as $substr) {
                    if ($first) {
                        $str = $substr;
                        $first = false;
                        continue;
                    }

                    $end = null;
                    if (false !== $pos = $this->strpos_array($substr, $this->keywords)) {
                        list($substr, $end) = array(substr($substr, 0, $pos), substr($substr, $pos, strlen($substr)));
                    }

                    $str .= '[' . $substr . ']';
                    if (null !== $end) {
                        $str .= $end;
                    }
                }
                $elements[$i] = $str;
            }

            $m++;
        }

        return "[#" . (array_push($this->result, implode('\'', $elements)) - 1) . "]";
    }
private function tempFilters ( $ filter ) { $ f = $ filter [ 1 ] ; $ elements = explode ( '\'' , $ f ) ; // Hack to make "dot" works on filters
 for ( $ i = 0 , $ m = 0 ; $ i < count ( $ elements ) ; $ i ++ ) { if ( $ m % 2 == 0 ) { if ( $ i > 0 && substr ( $ elements [ $ i - 1 ] , 0 , 1 ) == '\\' ) { continue ; } $ e = explode ( '.' , $ elements [ $ i ] ) ; $ str = '' ; $ first = true ; foreach ( $ e as $ substr ) { if ( $ first ) { $ str = $ substr ; $ first = false ; continue ; } $ end = null ; if ( false !== $ pos = $ this -> strpos_array ( $ substr , $ this -> keywords ) ) { list ( $ substr , $ end ) = array ( substr ( $ substr , 0 , $ pos ) , substr ( $ substr , $ pos , strlen ( $ substr ) ) ) ; } $ str .= '[' . $ substr . ']' ; if ( null !== $ end ) { $ str .= $ end ; } } $ elements [ $ i ] = $ str ; } $ m ++ ; } return "[#" . ( array_push ( $ this -> result , implode ( '\'' , $ elements ) ) - 1 ) . "]" ; }
Pushs the filter into the list
@param string $filter
@return string
Pushs the filter into the list