Loads string and collection object

@return Matcher
@author Dan Cox
168173
public function load($str, Collection $collection)
	{
		$this->str = $str;
		$this->collection = $collection;

		return $this;
	}
700554
function loadStrings($strings) {
        // Load some commonly used strings
        if (get_string_manager()->string_exists($this->title, 'tool_xmldb')) {
            $this->str['title'] = get_string($this->title, 'tool_xmldb');
        } else {
            $this->str['title'] = $this->title;
        }

        // Now process the $strings array loading it in the $str atribute
        if ($strings) {
            foreach ($strings as $key => $module) {
                $this->str[$key] = get_string($key, $module);
            }
        }
    }
366426
public function load()
    {
        $this->checkSource();

        $this->spammers = $this->cacheSpammers(function () {
            return SpammerCollection::load(
                file($this->source, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
            );
        });

        return $this;
    }
966129
def _load_matcher(self) -> None:
        
        for id_key in self._rule_lst:
            if self._rule_lst[id_key].active:
                pattern_lst = [a_pattern.spacy_token_lst for a_pattern in self._rule_lst[id_key].patterns]

                for spacy_rule_id, spacy_rule in enumerate(itertools.product(*pattern_lst)):
                    self._matcher.add(self._construct_key(id_key, spacy_rule_id), None, list(spacy_rule))
1325920
public function match($regex)
    {
        $match = array();
        if($this->isValidRegex($regex) && preg_match($regex, $this->toString(), $match)===1)
        {
            return new ObjectArray($match);
        }
        return null;
    }
348378
private function _collection($collection) {
    return (!is_array($collection) && !is_object($collection)) ? str_split((string) $collection) : $collection;
  }
591075
private function loadCollections()
    {
        $collections = new ArrayCollection();

        $finder = new Finder();
        $finder->files()->name('*.dat')->in($this->filepath);

        foreach ($finder as $file) {
            $name = $file->getBasename('.dat');
            $collections->set($name, $this->createCollection($name));
        }

        return $collections;
    }
1171947
public function getCollection() {
		$collectionName = $this->collectionName;
		if(empty($collectionName)){
			return NULL;
			}
		$collection = $collectionName::getInstance();
		return $collection;
	}
477991
public function parse()
    {
        $matches = [];
        preg_match_all('@url\((.*)\)->find\(([-\.#\w]+)\)(?:->filter\(([-\.#\w]+)(?:,(.+))?\))?@', $this->get(), $matches);

        $this->url = $this->getOption('urlPrefix');
        if (!empty($matches[1][0])) {
            $this->url .= trim($matches[1][0], ' \'"');
        }
        if (!empty($matches[2][0])) {
            $this->selector = trim($matches[2][0], ' \'"');
        }
        if (!empty($matches[3][0])) {
            $this->filter->selector = trim($matches[3][0], ' \'"');
        }
        if (!empty($matches[4][0])) {
            $this->filter->length = (int) trim($matches[4][0]);
        }

        return $this;
    }
163070
public function load()
	{
		if (file_exists($this->name) && is_readable($this->name))
		{
			return unserialize(file_get_contents($this->name));
		}
		return false;
	}
616992
public function getIterator()
    {
        $array = $this->getArrayCopy();

        // Is the collection nested in the array?
        if (isset($this->collectionProperty)) {

            // Locate the collection in the response.
            $collectionFound = false;
            $property = NULL;
            foreach ((array) $this->collectionProperty as $property) {
                if (isset($array[$property])) {
                    $collectionFound = true;
                    break;
                }
            }

            if (!$collectionFound) {
                throw new \OutOfBoundsException('Collection not found in response');
            }

            $array = $array[$property];
        }

        // Build the collection.
        $collection = array();
        foreach ($array as $item) {
            $element = new $this->elementClass($item);
            $collection[(string) $element] = $element;
        }

        return new \ArrayObject($collection);
    }
1063241
private function parse() {

		$lines = file($this -> viewmodel -> getFile());

		$this -> code = '';

		$classes = [

			'MatchEcho',
			'MatchForeach',
			'MatchEndForeach',
			'MatchFor',
			'MatchEndFor',
			'MatchIf',
			'MatchIsset',
			'MatchNotIsset',
			'MatchEmpty',
			'MatchNotEmpty',
			'MatchElseIf',
			'MatchElse',
			'MatchEndIf',
			'MatchEndIsset',
			'MatchEndNotIsset',
			'MatchEndEmpty',
			'MatchEndNotEmpty',
			'MatchForm',
			'MatchTranslation',
			'MatchEscape',
			'MatchRouter',
			'MatchHelper',
			'MatchPartial',
			'MatchFails',
			'MatchPasses',
			'MatchPHPTags'
		];

		foreach($lines as $linenumber => $line) {
			
			foreach($classes as $class) {
				
				$class = self :: NAMESPACE_MATCH . $class;
				$match = new $class($line);
				$line  = $match -> replace() -> getLine();
			}

			//User defined functions
			foreach(TemplateData :: getTemplateFunctions() as $action => $closure) {

				$class = self :: NAMESPACE_MATCH . 'MatchUserDefined';
				$match = new $class($line, $action);
				$line  = $match -> replace() -> getLine();
			}
			
			$this -> code .= trim($line) . "\n";
		}

		$this -> code = trim($this -> code);

		return $this -> code;
	}
432117
public function getMatcher()
    {
        if (null !== $this->matcher) {
            return $this->matcher;
        }

        $compiled = is_a($this->options['matcher_class'], CompiledUrlMatcher::class, true) && (UrlMatcher::class === $this->options['matcher_base_class'] || RedirectableUrlMatcher::class === $this->options['matcher_base_class']);

        if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) {
            $routes = $this->getRouteCollection();
            if ($compiled) {
                $routes = (new CompiledUrlMatcherDumper($routes))->getCompiledRoutes();
            }
            $this->matcher = new $this->options['matcher_class']($routes, $this->context);
            if (method_exists($this->matcher, 'addExpressionLanguageProvider')) {
                foreach ($this->expressionLanguageProviders as $provider) {
                    $this->matcher->addExpressionLanguageProvider($provider);
                }
            }

            return $this->matcher;
        }

        $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/'.$this->options['matcher_cache_class'].'.php',
            function (ConfigCacheInterface $cache) {
                $dumper = $this->getMatcherDumperInstance();
                if (method_exists($dumper, 'addExpressionLanguageProvider')) {
                    foreach ($this->expressionLanguageProviders as $provider) {
                        $dumper->addExpressionLanguageProvider($provider);
                    }
                }

                $options = [
                    'class' => $this->options['matcher_cache_class'],
                    'base_class' => $this->options['matcher_base_class'],
                ];

                $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources());
            }
        );

        if ($compiled) {
            return $this->matcher = new $this->options['matcher_class'](require $cache->getPath(), $this->context);
        }

        if (!class_exists($this->options['matcher_cache_class'], false)) {
            require_once $cache->getPath();
        }

        return $this->matcher = new $this->options['matcher_cache_class']($this->context);
    }
1097003
public function content()
    {
        if (is_null($this->session->get($this->instance))) {
            return new Collection([]);
        }

        return $this->session->get($this->instance);
    }
1005799
public function getCollection()
    {
        if (! isset($this->collection)) {
            return str_replace(
                '\\', '', Str::snake(Str::plural(class_basename($this)))
            );
        }

        return $this->collection;
    }
154901
protected function parseTitle()
    {
        if (($registeredName = array_search($this->className, $this->defaultContextSettings)) !== false) {
            return $registeredName;
        } elseif (preg_match('/\\\\([^\\\\]*)Helper$/', $this->className, $matches)) {
            return $matches[1];
        }

        return $this->className;
    }
464087
private function load()
    {
        $reflectionClass = new \ReflectionClass($this->name);
        $this->collectionInfo = new CollectionInfo();

        foreach ($this->reader->getClassAnnotations($reflectionClass) as $annotation) {
            $this->processClassAnnotation($annotation);
        }

        $properties = $reflectionClass->getProperties();

        foreach ($properties as $property) {
            foreach ($this->reader->getPropertyAnnotations($property) as $annotation) {
                if (!isset($this->propertiesInfos[$property->getName()])) {
                    $this->propertiesInfos[$property->getName()] = new PropertyInfo();
                }
                $this->processPropertiesAnnotation($property->getName(), $annotation);
            }
        }

        $this->eventManager = new EventManager();
        if ($this->hasEvent) {
            $methods = $reflectionClass->getMethods();
            foreach ($methods as $method) {
                $annotations = $this->reader->getMethodAnnotations($method);
                if (!empty($annotations)) {
                    foreach ($annotations as $annotation) {
                        if (in_array('JPC\MongoDB\ODM\Annotations\Event\Event', class_implements($annotation))) {
                            $this->eventManager->add($annotation, $method->getName());
                        }
                    }
                }
            }
        }

        $this->loaded = true;
    }