private function parseUntilFound(string $procedure) 
    {
        /* First check if parsed content has the desired procedure */
        foreach($this->parsed as $path => $json) {
            if($this->hasProcedure($json, $procedure)) return $json; 
        }

        /* Next, check if the most likely file has the procedure */
        $json = $this->findMostLikelyFile($procedure);
        if(! is_null($json)) return $json;
        

        /* Lastly, check rest of the files one by one */
        foreach($this->unparsedPaths() as $path) {
            $json = $this->parsePath($path);
            if($this->hasProcedure($json, $procedure)) return $json; 
        }

        return null;
    }
private function parseUntilFound(string $procedure) 
    {
        /* First check if parsed content has the desired procedure */
        foreach($this->parsed as $path => $json) {
            if($this->hasProcedure($json, $procedure)) return $json; 
        }

        /* Next, check if the most likely file has the procedure */
        $json = $this->findMostLikelyFile($procedure);
        if(! is_null($json)) return $json;
        

        /* Lastly, check rest of the files one by one */
        foreach($this->unparsedPaths() as $path) {
            $json = $this->parsePath($path);
            if($this->hasProcedure($json, $procedure)) return $json; 
        }

        return null;
    }
private function parseUntilFound ( string $ procedure ) { /* First check if parsed content has the desired procedure */ foreach ( $ this -> parsed as $ path => $ json ) { if ( $ this -> hasProcedure ( $ json , $ procedure ) ) return $ json ; } /* Next, check if the most likely file has the procedure */ $ json = $ this -> findMostLikelyFile ( $ procedure ) ; if ( ! is_null ( $ json ) ) return $ json ; /* Lastly, check rest of the files one by one */ foreach ( $ this -> unparsedPaths ( ) as $ path ) { $ json = $ this -> parsePath ( $ path ) ; if ( $ this -> hasProcedure ( $ json , $ procedure ) ) return $ json ; } return null ; }
Parse paths until file containing the given procedure if found
or there is nothing left to parse.
Parse paths until file containing the given procedure if found or there is nothing left to parse .