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

Bring back StaticStringy as a __callStatic wrapper

This commit is contained in:
Daniel St. Jules
2015-09-02 00:12:25 -07:00
parent ad6d32080f
commit e237f30d94
4 changed files with 198 additions and 1 deletions

View File

@@ -94,6 +94,7 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy'
* [underscored](#underscored)
* [upperCamelize](#uppercamelize)
* [upperCaseFirst](#uppercasefirst)
* [StaticStringy](#staticstringy)
* [Extensions](#extensions)
* [Tests](#tests)
* [License](#license)
@@ -947,6 +948,19 @@ Converts the first character of the supplied string to upper case.
s('σ foo')->upperCaseFirst(); // 'Σ foo'
```
## StaticStringy
A static wrapper exists for Stringy methods. All the methods list under
"Instance methods" are available. For StaticStringy method, the optional
encoding is expected to be the last argument. The result is not cast, so
the return value may be of type Stringy, integer, boolean, etc.
```php
// Translates to Stringy::create('fòôbàř', 'UTF-8')->slice(0, 3);
StaticStringy::slice('fòôbàř', 0, 3, 'UTF-8');
```
## Extensions
The following is a list of libraries that extend Stringy: