Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
Inheritance: extends RuntimeExceptio\RuntimeException
 /**
  * {@inheritdoc}
  */
 public function unbind($query, $typeName = null, array $parameterValues = null, $language = null)
 {
     if (null !== $language && 'glob' !== $language) {
         throw UnsupportedLanguageException::forLanguage($language);
     }
     if (null !== $typeName) {
         $this->removeBindingsByQueryAndType($query, $typeName, $parameterValues);
         return;
     }
     $this->removeBindingsByQuery($query, $parameterValues);
 }
 /**
  * Validate a language is usable to search in repositories.
  *
  * @param string $language
  */
 protected function failUnlessGlob($language)
 {
     if ('glob' !== $language) {
         throw UnsupportedLanguageException::forLanguage($language);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function contains($query, $language = 'glob')
 {
     if ('glob' !== $language) {
         throw UnsupportedLanguageException::forLanguage($language);
     }
     Assert::stringNotEmpty($query, 'The glob must be a non-empty string. Got: %s');
     Assert::startsWith($query, '/', 'The glob %s is not absolute.');
     $query = Path::canonicalize($query);
     if (false !== strpos($query, '*')) {
         $iterator = $this->getGlobIterator($query);
         $iterator->rewind();
         return $iterator->valid();
     }
     return isset($this->resources[$query]);
 }
 private function getGlobIterator($query, $language)
 {
     if ('glob' !== $language) {
         throw UnsupportedLanguageException::forLanguage($language);
     }
     Assert::stringNotEmpty($query, 'The glob must be a non-empty string. Got: %s');
     Assert::startsWith($query, '/', 'The glob %s is not absolute.');
     $query = Path::canonicalize($query);
     return new GlobIterator($this->baseDir . $query);
 }