protected function pregRegistry(int $id, array $types)
    {
        $registry_types = Utils\Utils::arrayWhitelist(
            self::$cache[$this->config]['registries'],
            $types
        );

        $result = null;
        foreach ($registry_types as $type => $matcher) {
            if (preg_match(
                $matcher['pattern'],
                $this->registries[$id] ?? '',
                $matches
            )) {
                $match = array_combine(
                    $matcher['map'],
                    array_map('trim', array_slice($matches, 1))
                );
                $result = new Registry($this->config, $type, $match);
                break;
            }
        }
        return $result;
    }
protected function pregRegistry(int $id, array $types)
    {
        $registry_types = Utils\Utils::arrayWhitelist(
            self::$cache[$this->config]['registries'],
            $types
        );

        $result = null;
        foreach ($registry_types as $type => $matcher) {
            if (preg_match(
                $matcher['pattern'],
                $this->registries[$id] ?? '',
                $matches
            )) {
                $match = array_combine(
                    $matcher['map'],
                    array_map('trim', array_slice($matches, 1))
                );
                $result = new Registry($this->config, $type, $match);
                break;
            }
        }
        return $result;
    }
protected function pregRegistry ( int $ id , array $ types ) { $ registry_types = Utils \ Utils :: arrayWhitelist ( self :: $ cache [ $ this -> config ] [ 'registries' ] , $ types ) ; $ result = null ; foreach ( $ registry_types as $ type => $ matcher ) { if ( preg_match ( $ matcher [ 'pattern' ] , $ this -> registries [ $ id ] ?? '' , $ matches ) ) { $ match = array_combine ( $ matcher [ 'map' ] , array_map ( 'trim' , array_slice ( $ matches , 1 ) ) ) ; $ result = new Registry ( $ this -> config , $ type , $ match ) ; break ; } } return $ result ; }
Preg-match fields from a Return File registry to fill a Registry instance

@param int      $id    $registries id to be parsed
@param string[] $types Registry types to test

@return Registry On success
@return null     On failure
Preg - match fields from a Return File registry to fill a Registry instance