Skip to content

Commit 44b4a7b

Browse files
TASK: Revert renaming of API method names
Revert it to not break all uses of the package out there. Updated README.md via ``` ./build/generate-docs ```
1 parent f3841ad commit 44b4a7b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ For a complete documentation of all classes, read the generated [PHPDoc](doc).
4242

4343
Create a new Syllable class, with defaults.
4444

45-
### public static setDirectoryCache(string $dir)
45+
### public static setCacheDir(string $dir)
4646

4747
Set the directory where compiled language files may be stored.
4848
Default to the `cache` subdirectory of the current directory.
@@ -52,7 +52,7 @@ Default to the `cache` subdirectory of the current directory.
5252
Set the character encoding to use.
5353
Specify `null` encoding to not apply any encoding at all.
5454

55-
### public static setDirectoryLanguage(string $dir)
55+
### public static setLanguageDir(string $dir)
5656

5757
Set the directory where language source files can be found.
5858
Default to the `languages` subdirectory of the current directory.

src/Syllable.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class Syllable
6161
* @var string|null
6262
*/
6363
private static $encoding = 'UTF-8';
64-
private static $directoryCache = null;
65-
private static $directoryLanguage = null;
64+
private static $cacheDir = null;
65+
private static $languageDir = null;
6666
private $excludes = [];
6767
private $includes = [];
6868

@@ -79,13 +79,13 @@ class Syllable
7979
*/
8080
public function __construct($language = 'en', $hyphen = null)
8181
{
82-
if (!self::$directoryCache) {
83-
self::$directoryCache = __DIR__.'/../cache';
82+
if (!self::$cacheDir) {
83+
self::$cacheDir = __DIR__.'/../cache';
8484
}
85-
$this->setCache(new Json(self::$directoryCache));
85+
$this->setCache(new Json(self::$cacheDir));
8686

87-
if (!self::$directoryLanguage) {
88-
self::$directoryLanguage = __DIR__.'/../languages';
87+
if (!self::$languageDir) {
88+
self::$languageDir = __DIR__.'/../languages';
8989
}
9090

9191
$this->setLanguage($language);
@@ -99,9 +99,9 @@ public function __construct($language = 'en', $hyphen = null)
9999
*
100100
* @param string $dir
101101
*/
102-
public static function setDirectoryCache($dir)
102+
public static function setCacheDir($dir)
103103
{
104-
self::$directoryCache = $dir;
104+
self::$cacheDir = $dir;
105105
}
106106

107107
/**
@@ -121,9 +121,9 @@ public static function setEncoding($encoding = null)
121121
*
122122
* @param string $dir
123123
*/
124-
public static function setDirectoryLanguage($dir)
124+
public static function setLanguageDir($dir)
125125
{
126-
self::$directoryLanguage = $dir;
126+
self::$languageDir = $dir;
127127
}
128128

129129
/**
@@ -134,7 +134,7 @@ public static function setDirectoryLanguage($dir)
134134
public function setLanguage($language)
135135
{
136136
$this->language = $language;
137-
$this->setSource(new File($language, self::$directoryLanguage));
137+
$this->setSource(new File($language, self::$languageDir));
138138
}
139139

140140
/**

tests/src/SyllableTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ protected function setUpFixture()
2828
{
2929
$this->createTestDirectory();
3030

31-
Syllable::setDirectoryCache($this->getTestDirectory());
32-
Syllable::setDirectoryLanguage(realpath(__DIR__.'/../../languages'));
31+
Syllable::setCacheDir($this->getTestDirectory());
32+
Syllable::setLanguageDir(realpath(__DIR__.'/../../languages'));
3333

3434
$this->object = new Syllable();
3535
}

0 commit comments

Comments
 (0)