1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-09-08 20:20:47 +02:00

Made str and encoding protected, added getEncoding

Neither should be private, so as to allow users to easily extend the
class
This commit is contained in:
Daniel St. Jules
2014-02-16 21:22:32 -05:00
parent e5f66c6eca
commit 1965da2e39
3 changed files with 25 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ Compatible with PHP 5.3+. Inspired by underscore.string.js.
* [ensureLeft](#ensureleft)
* [ensureRight](#ensureright)
* [first](#first)
* [getEncoding](#getencoding)
* [humanize](#humanize)
* [insert](#insert)
* [isAlpha](#isalpha)
@@ -340,6 +341,16 @@ S::create('fòô bàř', 'UTF-8')->first(3);
S::first('fòô bàř', 3, 'UTF-8'); // 'fòô'
```
#### getEncoding
$stringy->getEncoding()
Returns the encoding used by the Stringy object.
```php
S::create('fòô bàř', 'UTF-8')->getEncoding(); // 'UTF-8'
```
#### humanize
$stringy->humanize()