src/SourceAdapters/SourceAdapterFactory.php
private function adaptString($source)
    {
        foreach ($this->pattern_adapters as $pattern => $adapter) {
            $pattern = '/'.str_replace('/', '\\/', $pattern).'/i';
            if (preg_match($pattern, $source)) {
                return $adapter;
            }
        }
    }
private function adaptString($source)
    {
        foreach ($this->pattern_adapters as $pattern => $adapter) {
            $pattern = '/'.str_replace('/', '\\/', $pattern).'/i';
            if (preg_match($pattern, $source)) {
                return $adapter;
            }
        }
    }
private function adaptString ( $ source ) { foreach ( $ this -> pattern_adapters as $ pattern => $ adapter ) { $ pattern = '/' . str_replace ( '/' , '\\/' , $ pattern ) . '/i' ; if ( preg_match ( $ pattern , $ source ) ) { return $ adapter ; } } }
Choose an adapter class for the provided string.
@param  string $source
@return string|null
Choose an adapter class for the provided string .