public function find(bool $validate = true)
    {
        $cache = $finder = $exception = $cacheKey = $result = null;
        try {
            // Cached response
            $cache = new Cache(__FUNCTION__, $this->options);
            $cacheKey = $cache->getKey([$this->module, $this->configType, $this->configFile, $validate]);
            $result = $cache->readFrom($cacheKey);
            if ($result !== false) {
                return $result;
            }
            // Real response
            $finder = $this->getFinder();
            $result = $finder->find($this->module, $this->configFile, $validate);
        } catch (InvalidArgumentException $exception) {
            $this->mergeMessages($exception, __FUNCTION__);
        }

        // Get finder errors and warnings, if any
        $this->mergeMessages($finder, __FUNCTION__);
        $this->mergeMessages($cache, __FUNCTION__);

        // Re-throw finder exception
        if ($exception) {
            throw $exception;
        }

        if ($cache && $cacheKey) {
            $cache->writeTo($cacheKey, $result);
        }

        return $result;
    }
public function find(bool $validate = true)
    {
        $cache = $finder = $exception = $cacheKey = $result = null;
        try {
            // Cached response
            $cache = new Cache(__FUNCTION__, $this->options);
            $cacheKey = $cache->getKey([$this->module, $this->configType, $this->configFile, $validate]);
            $result = $cache->readFrom($cacheKey);
            if ($result !== false) {
                return $result;
            }
            // Real response
            $finder = $this->getFinder();
            $result = $finder->find($this->module, $this->configFile, $validate);
        } catch (InvalidArgumentException $exception) {
            $this->mergeMessages($exception, __FUNCTION__);
        }

        // Get finder errors and warnings, if any
        $this->mergeMessages($finder, __FUNCTION__);
        $this->mergeMessages($cache, __FUNCTION__);

        // Re-throw finder exception
        if ($exception) {
            throw $exception;
        }

        if ($cache && $cacheKey) {
            $cache->writeTo($cacheKey, $result);
        }

        return $result;
    }
public function find ( bool $ validate = true ) { $ cache = $ finder = $ exception = $ cacheKey = $ result = null ; try { // Cached response $ cache = new Cache ( __FUNCTION__ , $ this -> options ) ; $ cacheKey = $ cache -> getKey ( [ $ this -> module , $ this -> configType , $ this -> configFile , $ validate ] ) ; $ result = $ cache -> readFrom ( $ cacheKey ) ; if ( $ result !== false ) { return $ result ; } // Real response $ finder = $ this -> getFinder ( ) ; $ result = $ finder -> find ( $ this -> module , $ this -> configFile , $ validate ) ; } catch ( InvalidArgumentException $ exception ) { $ this -> mergeMessages ( $ exception , __FUNCTION__ ) ; } // Get finder errors and warnings, if any $ this -> mergeMessages ( $ finder , __FUNCTION__ ) ; $ this -> mergeMessages ( $ cache , __FUNCTION__ ) ; // Re-throw finder exception if ( $ exception ) { throw $ exception ; } if ( $ cache && $ cacheKey ) { $ cache -> writeTo ( $ cacheKey , $ result ) ; } return $ result ; }
Find module configuration file

@param bool $validate Whether or not validate result
@return mixed Whatever the PathFinder returned
Find module configuration file