{@inheritdoc}

@uses Titon\Common\Registry
15096
public static function pluralize($string) {
        $g11n = G11n::registry();

        if (!$g11n->isEnabled()) {
            return $string;
        }

        return static::cache([__METHOD__, $string], function() use ($string, $g11n) {
            $string = mb_strtolower($string);
            $result = null;
            $inflections = $g11n->current()->getInflectionRules();

            if (!$inflections) {
                return $string;

            } else if (!empty($inflections['uninflected']) && in_array($string, $inflections['uninflected'])) {
                $result = $string;

            } else if (!empty($inflections['irregular']) && isset($inflections['irregular'][$string])) {
                $result = $inflections['irregular'][$string];

            } else if (!empty($inflections['irregular']) && in_array($string, $inflections['irregular'])) {
                $result = $string;

            } else if (!empty($inflections['plural'])) {
                foreach ($inflections['plural'] as $pattern => $replacement) {
                    if (preg_match($pattern, $string)) {
                        $result = preg_replace($pattern, $replacement, $string);
                        break;
                    }
                }
            }

            if (empty($result)) {
                $result = $string;
            }

            return $result;
        });
    }
752906
function Registry(opt_options) {
  if (!(this instanceof Registry)) {
    return new Registry(opt_options);
  }
  opt_options = opt_options || {};

  this.breakOnError = opt_options.breakOnError || false;
  this.depth = opt_options.depth || 10;

  // regex to match "$schema.*"
  this._match = /"\$id:[a-z0-9_-]*"/ig;
  // regex to escape strings for usage as regex
  this._escape = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;

  this.schemas = {};
}
165966
public function finish(\Caridea\Validate\Registry $registry): \Caridea\Validate\Rule
    {
        if ($this->validator instanceof \Caridea\Validate\Validator) {
            return $this;
        } else {
            $rule = clone $this;
            $builder = $registry->builder();
            switch ($this->operator) {
                case "nested_object":
                case "list_objects":
                    $rule->validator = $builder->build($this->validator);
                    return $rule;
                case "list":
                    $rule->validator = $builder->build((object)['entry' => $this->validator]);
                    return $rule;
                case "list_different_objects":
                case "variable_object":
                    $validators = [];
                    foreach ($this->validator as $value => $ruleset) {
                        $validators[$value] = $builder->build($ruleset);
                    }
                    $rule->validator = new \Caridea\Validate\SwitchValidator($this->field, $validators);
                    return $rule;
            }
        }
    }
416594
private function traverse(array $registry): array
    {
        foreach ($registry as &$value) {
            switch (true) {
                case is_array($value):
                    $value = $this->traverse($value);
                    break;

                case is_string($value):
                    $value = $this->replace($value);
                    break;
            }
        }

        return $registry;
    }
71646
public function set($key, $value)
    {
        $registry = ArrayHelper::set($this->getItems(), $key, $value, $useDotSyntax = true);
        $this->setItems($registry);

        return $this->getItems();
    }
575093
protected function getPreferenceOrFail(string $key)
    {
        if (!$this->registry->has($key)) {
            throw new UnregisteredPreferenceException(
                sprintf(
                    'There\'s no setting registered with key `%s`',
                    $key
                )
            );
        }

        return $this->registry->get($key);
    }
666881
public function get(string $object)
    {
        return ($this->exists($object)) ? $this->registry[$object] : null;
    }
792573
public function detach($id)
    {
        if (empty($this->registries[$id])) {
            throw new RegistryException(
                RegistryException::MODIFICATION_ATTEMPT_FAILED_TEXT,
                RegistryException::MODIFICATION_ATTEMPT_FAILED_CODE
            );
        }

        unset($this->registries[$id]);
    }
698878
public function locateFilterRegistry(ContainerBuilder $container, $registryId)
    {
        if ( ! $container->hasDefinition($registryId)) {
            $definition = new Definition();
            $definition->setClass('Spray\PersistenceBundle\FilterLocator\FilterRegistry');
            $container->setDefinition($registryId, $definition);
        }
        return $container->getDefinition($registryId);
    }
412213
public function register($provider, array $values = [])
    {
        $key = \get_class($provider);
        if (!isset($this->registry[$key])) {
            parent::register($provider, $values);
            $this->registry[$key] = true;
        }
    }
1196749
public function get($key, $default = null)
    {
        $pointer = &$this->registry;
        $segments = explode('.', $key);

        do {
            $segment = array_shift($segments);

            if (isset($pointer[$segment])) {
                $pointer =& $this->move($pointer, $value, $segments, $segment);
            } else {
                $value = $default;
                break;
            }
        } while (false === empty($segments));

        return $value;
    }
462540
public function getData($key, $registry = null)
	{
		if ($registry == null) {
			$registry = $this->default;
		}
		if (is_string($key . $registry) && $this->registryExists($registry)) {
			if (array_key_exists($key, $this->data[self::REGISTRY][$registry])) {
				return $this->data[self::REGISTRY][$registry][$key];
			}
		}
		return null;
	}
486133
private function loadRegistry()
    {
        $this->registryCache->setOrm($this);
        try {
            $this->registryCache->isAppReady();
        } catch (AppRegistryNotReady $e) {
            $this->registryCache->populate();
        }
    }
405590
public function setData($key, $data, $registry = null)
	{
		if ($registry == null) {
			$registry = $this->default;
		}
		if (is_string($key . $registry) && $this->registryExists($registry)) {
			$this->data[self::REGISTRY][$registry][$key] = $data;
			$this->dirty = true;
			return true;
		}
		return false;
	}
830851
public function remove(...$args): RegistryInterface
    {
        if (!count($args)) {
            //there's nothing to remove
            return $this;
        }

        $separator = '--'. md5(uniqid()) . '--';
        return $this->removeDot(implode($separator, $args), $separator);
    }
442894
public function setRegistries(array $registries, $classname)
    {
        $this->classname = $classname;
        $this->registries = $registries;

        return $this;
    }
699615
public function getRegistry($package = null)
    {
        if (isset($package)) {
            if ($this->registered($package)) {
                return $this->registry[ $package ];
            }

            return false;
        }

        return $this->registry;
    }