You are here

public static function Inflector::reset in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php \Doctrine\Common\Inflector\Inflector::reset()

Clears Inflectors inflected value caches, and resets the inflection rules to the initial values.

Return value

void

5 calls to Inflector::reset()
InflectorTest::dataSampleWords in vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
Singular & Plural test data. Returns an array of sample words.
InflectorTest::testCustomPluralRule in vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
testCustomPluralRule method
InflectorTest::testCustomRuleWithReset in vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
Test resetting inflection rules.
InflectorTest::testCustomSingularRule in vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
testCustomSingularRule method
InflectorTest::testRulesClearsCaches in vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
test that setting new rules clears the inflector caches.

File

vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php, line 245

Class

Inflector
Doctrine inflector has static methods for inflecting text.

Namespace

Doctrine\Common\Inflector

Code

public static function reset() {
  if (empty(self::$initialState)) {
    self::$initialState = get_class_vars('Inflector');
    return;
  }
  foreach (self::$initialState as $key => $val) {
    if ($key != 'initialState') {
      self::${$key} = $val;
    }
  }
}