diff --git a/README.md b/README.md index 0e00574..cf2bef5 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ For a complete documentation of all classes, read the generated [PHPDoc](doc). Create a new Syllable class, with defaults. -### public static setDirectoryCache(string $dir) +### public static setCacheDir(string $dir) Set the directory where compiled language files may be stored. Default to the `cache` subdirectory of the current directory. @@ -52,7 +52,7 @@ Default to the `cache` subdirectory of the current directory. Set the character encoding to use. Specify `null` encoding to not apply any encoding at all. -### public static setDirectoryLanguage(string $dir) +### public static setLanguageDir(string $dir) Set the directory where language source files can be found. Default to the `languages` subdirectory of the current directory. diff --git a/src/Syllable.php b/src/Syllable.php index ae9b5f9..95cb445 100644 --- a/src/Syllable.php +++ b/src/Syllable.php @@ -61,8 +61,8 @@ class Syllable * @var string|null */ private static $encoding = 'UTF-8'; - private static $directoryCache = null; - private static $directoryLanguage = null; + private static $cacheDir = null; + private static $languageDir = null; private $excludes = []; private $includes = []; @@ -79,13 +79,13 @@ class Syllable */ public function __construct($language = 'en', $hyphen = null) { - if (!self::$directoryCache) { - self::$directoryCache = __DIR__.'/../cache'; + if (!self::$cacheDir) { + self::$cacheDir = __DIR__.'/../cache'; } - $this->setCache(new Json(self::$directoryCache)); + $this->setCache(new Json(self::$cacheDir)); - if (!self::$directoryLanguage) { - self::$directoryLanguage = __DIR__.'/../languages'; + if (!self::$languageDir) { + self::$languageDir = __DIR__.'/../languages'; } $this->setLanguage($language); @@ -99,9 +99,9 @@ public function __construct($language = 'en', $hyphen = null) * * @param string $dir */ - public static function setDirectoryCache($dir) + public static function setCacheDir($dir) { - self::$directoryCache = $dir; + self::$cacheDir = $dir; } /** @@ -121,9 +121,9 @@ public static function setEncoding($encoding = null) * * @param string $dir */ - public static function setDirectoryLanguage($dir) + public static function setLanguageDir($dir) { - self::$directoryLanguage = $dir; + self::$languageDir = $dir; } /** @@ -134,7 +134,7 @@ public static function setDirectoryLanguage($dir) public function setLanguage($language) { $this->language = $language; - $this->setSource(new File($language, self::$directoryLanguage)); + $this->setSource(new File($language, self::$languageDir)); } /** diff --git a/tests/src/SyllableTest.php b/tests/src/SyllableTest.php index d0044dc..1f94f40 100644 --- a/tests/src/SyllableTest.php +++ b/tests/src/SyllableTest.php @@ -28,8 +28,8 @@ protected function setUpFixture() { $this->createTestDirectory(); - Syllable::setDirectoryCache($this->getTestDirectory()); - Syllable::setDirectoryLanguage(realpath(__DIR__.'/../../languages')); + Syllable::setCacheDir($this->getTestDirectory()); + Syllable::setLanguageDir(realpath(__DIR__.'/../../languages')); $this->object = new Syllable(); }