mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-09-01 17:12:42 +02:00
Compare commits
24 Commits
2.2.0
...
disable-mb
Author | SHA1 | Date | |
---|---|---|---|
|
ee1e4074a6 | ||
|
b953a85d2c | ||
|
e07a07a076 | ||
|
c4d785d29f | ||
|
5554477962 | ||
|
87c1a47355 | ||
|
6d558974ba | ||
|
5a9b987f9a | ||
|
e3d397fa74 | ||
|
ffc3fa5ff9 | ||
|
c3f25577ed | ||
|
5a4629662c | ||
|
823e50a340 | ||
|
9d77c49fca | ||
|
a074d2a2ac | ||
|
b7cfa84219 | ||
|
e3be6a56ea | ||
|
bdbd4d7541 | ||
|
8419369f3b | ||
|
a3dde38a2f | ||
|
59ce593086 | ||
|
54cf92c89c | ||
|
d320bf8704 | ||
|
2de4c4aee3 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,5 +1,6 @@
|
||||
* text=auto
|
||||
|
||||
.editorconfig export-ignore
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.travis.yml export-ignore
|
||||
|
41
.travis.yml
41
.travis.yml
@@ -1,12 +1,43 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.6
|
||||
- 5.5
|
||||
- 5.4
|
||||
- 5.3
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
# This triggers builds to run on the new TravisCI infrastructure.
|
||||
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
||||
sudo: false
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- php: 5.3
|
||||
env: polyfill='true'
|
||||
- php: 5.3
|
||||
env: polyfill='false'
|
||||
- php: 5.4
|
||||
env: polyfill='true'
|
||||
- php: 5.4
|
||||
env: polyfill='false'
|
||||
- php: 5.5
|
||||
env: polyfill='true'
|
||||
- php: 5.5
|
||||
env: polyfill='false'
|
||||
- php: 5.6
|
||||
env: polyfill='true'
|
||||
- php: 5.6
|
||||
env: polyfill='false'
|
||||
- php: 7.0
|
||||
env: polyfill='true'
|
||||
- php: 7.0
|
||||
env: polyfill='false'
|
||||
|
||||
install: travis_retry composer install --no-interaction --prefer-source
|
||||
|
||||
before_script:
|
||||
- travis_retry composer self-update
|
||||
- travis_retry composer install --no-interaction --prefer-source
|
||||
- if [[ $polyfill = 'true' ]]; then cat ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
|
||||
- if [[ $polyfill = 'false' ]]; then travis_retry composer remove symfony/polyfill-mbstring; fi
|
||||
|
||||
script:
|
||||
- vendor/bin/phpunit
|
||||
|
@@ -1,3 +1,8 @@
|
||||
### 2.3.0 (2016-03-19)
|
||||
|
||||
* Add Persian characters in Stringy::charsArray()
|
||||
* Use symfony/polyfill-mbstring to avoid dependency on ext-mbstring
|
||||
|
||||
### 2.2.0 (2015-12-20)
|
||||
|
||||
* isJSON now returns false for empty strings
|
||||
|
19
README.md
19
README.md
@@ -9,6 +9,8 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy'
|
||||
```
|
||||
|
||||
[](https://travis-ci.org/danielstjules/Stringy)
|
||||
[](https://packagist.org/packages/danielstjules/stringy)
|
||||
[](https://packagist.org/packages/danielstjules/stringy)
|
||||
|
||||
* [Why?](#why)
|
||||
* [Installation](#installation)
|
||||
@@ -129,7 +131,7 @@ in your composer.json file:
|
||||
|
||||
```json
|
||||
"require": {
|
||||
"danielstjules/stringy": "~2.2"
|
||||
"danielstjules/stringy": "~2.3"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -152,11 +154,13 @@ And in either case, I'd suggest using an alias.
|
||||
use Stringy\Stringy as S;
|
||||
```
|
||||
|
||||
Please note that Stringy relies on the `mbstring` PHP module for its underlying
|
||||
multibyte support. This is a non-default, but very common module. For example,
|
||||
with debian and ubuntu, it's included in libapache2-mod-php5, php5-cli, and
|
||||
php5-fpm. For OSX users, it's a default for any version of PHP installed with
|
||||
homebrew. If compiling PHP from scratch, it can be included with the
|
||||
Please note that Stringy relies on the `mbstring` module for its underlying
|
||||
multibyte support. If the module is not found, Stringy will use
|
||||
[symfony/polyfill-mbstring](https://github.com/symfony/polyfill-mbstring).
|
||||
ex-mbstring is a non-default, but very common module. For example, with debian
|
||||
and ubuntu, it's included in libapache2-mod-php5, php5-cli, and php5-fpm. For
|
||||
OSX users, it's a default for any version of PHP installed with homebrew.
|
||||
If compiling PHP from scratch, it can be included with the
|
||||
`--enable-mbstring` flag.
|
||||
|
||||
## OO and Chaining
|
||||
@@ -682,7 +686,8 @@ to a lack of support in the bundled version of Oniguruma in PHP < 5.6,
|
||||
and current versions of HHVM (3.8 and below).
|
||||
|
||||
```php
|
||||
s('fòô ')->regexReplace('f[òô]+\s', 'bàř', 'msr'); // 'bàř'
|
||||
s('fòô ')->regexReplace('f[òô]+\s', 'bàř'); // 'bàř'
|
||||
s('fò')->regexReplace('(ò)', '\\1ô'); // 'fòô'
|
||||
```
|
||||
|
||||
##### removeLeft(string $substring)
|
||||
|
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"ext-mbstring": "*"
|
||||
"symfony/polyfill-mbstring": "~1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit processIsolation="false"
|
||||
<phpunit bootstrap="vendor/autoload.php"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false">
|
||||
<testsuites>
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
namespace Stringy;
|
||||
|
||||
use BadMethodCallException;
|
||||
use ReflectionClass;
|
||||
use ReflectionMethod;
|
||||
|
||||
/**
|
||||
* Class StaticStringy
|
||||
*
|
||||
@@ -107,12 +111,14 @@ class StaticStringy
|
||||
* @param mixed[] $arguments
|
||||
*
|
||||
* @return Stringy
|
||||
*
|
||||
* @throws \BadMethodCallException
|
||||
*/
|
||||
public static function __callStatic($name, $arguments)
|
||||
{
|
||||
if (!static::$methodArgs) {
|
||||
$stringyClass = new \ReflectionClass('Stringy\Stringy');
|
||||
$methods = $stringyClass->getMethods(\ReflectionMethod::IS_PUBLIC);
|
||||
$stringyClass = new ReflectionClass('Stringy\Stringy');
|
||||
$methods = $stringyClass->getMethods(ReflectionMethod::IS_PUBLIC);
|
||||
|
||||
foreach ($methods as $method) {
|
||||
$params = $method->getNumberOfParameters() + 2;
|
||||
@@ -121,7 +127,7 @@ class StaticStringy
|
||||
}
|
||||
|
||||
if (!isset(static::$methodArgs[$name])) {
|
||||
throw new \BadMethodCallException($name . ' is not a valid method');
|
||||
throw new BadMethodCallException($name . ' is not a valid method');
|
||||
}
|
||||
|
||||
$numArgs = count($arguments);
|
||||
|
101
src/Stringy.php
101
src/Stringy.php
@@ -2,7 +2,15 @@
|
||||
|
||||
namespace Stringy;
|
||||
|
||||
class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
use ArrayAccess;
|
||||
use ArrayIterator;
|
||||
use Countable;
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
use IteratorAggregate;
|
||||
use OutOfBoundsException;
|
||||
|
||||
class Stringy implements Countable, IteratorAggregate, ArrayAccess
|
||||
{
|
||||
/**
|
||||
* An instance's string.
|
||||
@@ -34,11 +42,11 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
public function __construct($str = '', $encoding = null)
|
||||
{
|
||||
if (is_array($str)) {
|
||||
throw new \InvalidArgumentException(
|
||||
throw new InvalidArgumentException(
|
||||
'Passed value cannot be an array'
|
||||
);
|
||||
} elseif (is_object($str) && !method_exists($str, '__toString')) {
|
||||
throw new \InvalidArgumentException(
|
||||
throw new InvalidArgumentException(
|
||||
'Passed object must have a __toString method'
|
||||
);
|
||||
}
|
||||
@@ -141,9 +149,9 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
function ($match) use ($encoding) {
|
||||
if (isset($match[1])) {
|
||||
return mb_strtoupper($match[1], $encoding);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
$stringy->str
|
||||
);
|
||||
@@ -201,9 +209,9 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
|
||||
if ($caseSensitive) {
|
||||
return (mb_strpos($this->str, $needle, 0, $encoding) !== false);
|
||||
} else {
|
||||
return (mb_stripos($this->str, $needle, 0, $encoding) !== false);
|
||||
}
|
||||
|
||||
return (mb_stripos($this->str, $needle, 0, $encoding) !== false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,11 +402,10 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
|
||||
if ($n < 0) {
|
||||
$stringy->str = '';
|
||||
} else {
|
||||
return $stringy->substr(0, $n);
|
||||
return $stringy;
|
||||
}
|
||||
|
||||
return $stringy;
|
||||
return $stringy->substr(0, $n);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -421,7 +428,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
*/
|
||||
public function getIterator()
|
||||
{
|
||||
return new \ArrayIterator($this->chars());
|
||||
return new ArrayIterator($this->chars());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -661,11 +668,10 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
|
||||
if ($n <= 0) {
|
||||
$stringy->str = '';
|
||||
} else {
|
||||
return $stringy->substr(-$n);
|
||||
return $stringy;
|
||||
}
|
||||
|
||||
return $stringy;
|
||||
return $stringy->substr(-$n);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -846,7 +852,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
$length = $this->length();
|
||||
|
||||
if (($offset >= 0 && $length <= $offset) || $length < abs($offset)) {
|
||||
throw new \OutOfBoundsException('No character exists at the index');
|
||||
throw new OutOfBoundsException('No character exists at the index');
|
||||
}
|
||||
|
||||
return mb_substr($this->str, $offset, 1, $this->encoding);
|
||||
@@ -863,7 +869,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
// Stringy is immutable, cannot directly set char
|
||||
throw new \Exception('Stringy object is immutable, cannot modify char');
|
||||
throw new Exception('Stringy object is immutable, cannot modify char');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -876,7 +882,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
// Don't allow directly modifying the string
|
||||
throw new \Exception('Stringy object is immutable, cannot unset char');
|
||||
throw new Exception('Stringy object is immutable, cannot unset char');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -896,7 +902,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
public function pad($length, $padStr = ' ', $padType = 'right')
|
||||
{
|
||||
if (!in_array($padType, array('left', 'right', 'both'))) {
|
||||
throw new \InvalidArgumentException('Pad expects $padType ' .
|
||||
throw new InvalidArgumentException('Pad expects $padType ' .
|
||||
"to be one of 'left', 'right' or 'both'");
|
||||
}
|
||||
|
||||
@@ -1279,9 +1285,9 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
function ($match) use ($encoding) {
|
||||
if ($match[0] == mb_strtoupper($match[0], $encoding)) {
|
||||
return mb_strtolower($match[0], $encoding);
|
||||
} else {
|
||||
return mb_strtoupper($match[0], $encoding);
|
||||
}
|
||||
|
||||
return mb_strtoupper($match[0], $encoding);
|
||||
},
|
||||
$stringy->str
|
||||
);
|
||||
@@ -1331,10 +1337,11 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
function ($match) use ($encoding, $ignore) {
|
||||
if ($ignore && in_array($match[0], $ignore)) {
|
||||
return $match[0];
|
||||
} else {
|
||||
$stringy = new Stringy($match[0], $encoding);
|
||||
return (string) $stringy->toLowerCase()->upperCaseFirst();
|
||||
}
|
||||
|
||||
$stringy = new Stringy($match[0], $encoding);
|
||||
|
||||
return (string) $stringy->toLowerCase()->upperCaseFirst();
|
||||
},
|
||||
$stringy->str
|
||||
);
|
||||
@@ -1395,9 +1402,9 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
return $map[$key];
|
||||
} elseif (is_numeric($this->str)) {
|
||||
return (intval($this->str) > 0);
|
||||
} else {
|
||||
return (bool) $this->regexReplace('[[:space:]]', '')->str;
|
||||
}
|
||||
|
||||
return (bool) $this->regexReplace('[[:space:]]', '')->str;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1592,22 +1599,22 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
if (isset($charsArray)) return $charsArray;
|
||||
|
||||
return $charsArray = array(
|
||||
'0' => array('°', '₀'),
|
||||
'1' => array('¹', '₁'),
|
||||
'2' => array('²', '₂'),
|
||||
'3' => array('³', '₃'),
|
||||
'4' => array('⁴', '₄'),
|
||||
'5' => array('⁵', '₅'),
|
||||
'6' => array('⁶', '₆'),
|
||||
'7' => array('⁷', '₇'),
|
||||
'8' => array('⁸', '₈'),
|
||||
'9' => array('⁹', '₉'),
|
||||
'0' => array('°', '₀', '۰'),
|
||||
'1' => array('¹', '₁', '۱'),
|
||||
'2' => array('²', '₂', '۲'),
|
||||
'3' => array('³', '₃', '۳'),
|
||||
'4' => array('⁴', '₄', '۴', '٤'),
|
||||
'5' => array('⁵', '₅', '۵', '٥'),
|
||||
'6' => array('⁶', '₆', '۶', '٦'),
|
||||
'7' => array('⁷', '₇', '۷'),
|
||||
'8' => array('⁸', '₈', '۸'),
|
||||
'9' => array('⁹', '₉', '۹'),
|
||||
'a' => array('à', 'á', 'ả', 'ã', 'ạ', 'ă', 'ắ', 'ằ', 'ẳ', 'ẵ',
|
||||
'ặ', 'â', 'ấ', 'ầ', 'ẩ', 'ẫ', 'ậ', 'ā', 'ą', 'å',
|
||||
'α', 'ά', 'ἀ', 'ἁ', 'ἂ', 'ἃ', 'ἄ', 'ἅ', 'ἆ', 'ἇ',
|
||||
'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ὰ', 'ά',
|
||||
'ᾰ', 'ᾱ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'а', 'أ', 'အ',
|
||||
'ာ', 'ါ', 'ǻ', 'ǎ', 'ª', 'ა', 'अ'),
|
||||
'ာ', 'ါ', 'ǻ', 'ǎ', 'ª', 'ა', 'अ', 'ا'),
|
||||
'b' => array('б', 'β', 'Ъ', 'Ь', 'ب', 'ဗ', 'ბ'),
|
||||
'c' => array('ç', 'ć', 'č', 'ĉ', 'ċ'),
|
||||
'd' => array('ď', 'ð', 'đ', 'ƌ', 'ȡ', 'ɖ', 'ɗ', 'ᵭ', 'ᶁ', 'ᶑ',
|
||||
@@ -1615,17 +1622,17 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
'e' => array('é', 'è', 'ẻ', 'ẽ', 'ẹ', 'ê', 'ế', 'ề', 'ể', 'ễ',
|
||||
'ệ', 'ë', 'ē', 'ę', 'ě', 'ĕ', 'ė', 'ε', 'έ', 'ἐ',
|
||||
'ἑ', 'ἒ', 'ἓ', 'ἔ', 'ἕ', 'ὲ', 'έ', 'е', 'ё', 'э',
|
||||
'є', 'ə', 'ဧ', 'ေ', 'ဲ', 'ე', 'ए'),
|
||||
'є', 'ə', 'ဧ', 'ေ', 'ဲ', 'ე', 'ए', 'إ', 'ئ'),
|
||||
'f' => array('ф', 'φ', 'ف', 'ƒ', 'ფ'),
|
||||
'g' => array('ĝ', 'ğ', 'ġ', 'ģ', 'г', 'ґ', 'γ', 'ج', 'ဂ', 'გ'),
|
||||
'g' => array('ĝ', 'ğ', 'ġ', 'ģ', 'г', 'ґ', 'γ', 'ဂ', 'გ', 'گ'),
|
||||
'h' => array('ĥ', 'ħ', 'η', 'ή', 'ح', 'ه', 'ဟ', 'ှ', 'ჰ'),
|
||||
'i' => array('í', 'ì', 'ỉ', 'ĩ', 'ị', 'î', 'ï', 'ī', 'ĭ', 'į',
|
||||
'ı', 'ι', 'ί', 'ϊ', 'ΐ', 'ἰ', 'ἱ', 'ἲ', 'ἳ', 'ἴ',
|
||||
'ἵ', 'ἶ', 'ἷ', 'ὶ', 'ί', 'ῐ', 'ῑ', 'ῒ', 'ΐ', 'ῖ',
|
||||
'ῗ', 'і', 'ї', 'и', 'ဣ', 'ိ', 'ီ', 'ည်', 'ǐ', 'ი',
|
||||
'इ'),
|
||||
'j' => array('ĵ', 'ј', 'Ј', 'ჯ'),
|
||||
'k' => array('ķ', 'ĸ', 'к', 'κ', 'Ķ', 'ق', 'ك', 'က', 'კ', 'ქ'),
|
||||
'इ', 'ی'),
|
||||
'j' => array('ĵ', 'ј', 'Ј', 'ჯ', 'ج'),
|
||||
'k' => array('ķ', 'ĸ', 'к', 'κ', 'Ķ', 'ق', 'ك', 'က', 'კ', 'ქ', 'ک'),
|
||||
'l' => array('ł', 'ľ', 'ĺ', 'ļ', 'ŀ', 'л', 'λ', 'ل', 'လ', 'ლ'),
|
||||
'm' => array('м', 'μ', 'م', 'မ', 'მ'),
|
||||
'n' => array('ñ', 'ń', 'ň', 'ņ', 'ʼn', 'ŋ', 'ν', 'н', 'ن', 'န',
|
||||
@@ -1634,7 +1641,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
'ộ', 'ơ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ', 'ø', 'ō', 'ő',
|
||||
'ŏ', 'ο', 'ὀ', 'ὁ', 'ὂ', 'ὃ', 'ὄ', 'ὅ', 'ὸ', 'ό',
|
||||
'о', 'و', 'θ', 'ို', 'ǒ', 'ǿ', 'º', 'ო', 'ओ'),
|
||||
'p' => array('п', 'π', 'ပ', 'პ'),
|
||||
'p' => array('п', 'π', 'ပ', 'პ', 'پ'),
|
||||
'q' => array('ყ'),
|
||||
'r' => array('ŕ', 'ř', 'ŗ', 'р', 'ρ', 'ر', 'რ'),
|
||||
's' => array('ś', 'š', 'ş', 'с', 'σ', 'ș', 'ς', 'س', 'ص', 'စ',
|
||||
@@ -1650,11 +1657,11 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
'y' => array('ý', 'ỳ', 'ỷ', 'ỹ', 'ỵ', 'ÿ', 'ŷ', 'й', 'ы', 'υ',
|
||||
'ϋ', 'ύ', 'ΰ', 'ي', 'ယ'),
|
||||
'z' => array('ź', 'ž', 'ż', 'з', 'ζ', 'ز', 'ဇ', 'ზ'),
|
||||
'aa' => array('ع', 'आ'),
|
||||
'aa' => array('ع', 'आ', 'آ'),
|
||||
'ae' => array('ä', 'æ', 'ǽ'),
|
||||
'ai' => array('ऐ'),
|
||||
'at' => array('@'),
|
||||
'ch' => array('ч', 'ჩ', 'ჭ'),
|
||||
'ch' => array('ч', 'ჩ', 'ჭ', 'چ'),
|
||||
'dj' => array('ђ', 'đ'),
|
||||
'dz' => array('џ', 'ძ'),
|
||||
'ei' => array('ऍ'),
|
||||
@@ -1664,11 +1671,11 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
'kh' => array('х', 'خ', 'ხ'),
|
||||
'lj' => array('љ'),
|
||||
'nj' => array('њ'),
|
||||
'oe' => array('ö', 'œ'),
|
||||
'oe' => array('ö', 'œ', 'ؤ'),
|
||||
'oi' => array('ऑ'),
|
||||
'oii' => array('ऒ'),
|
||||
'ps' => array('ψ'),
|
||||
'sh' => array('ш', 'შ'),
|
||||
'sh' => array('ш', 'შ', 'ش'),
|
||||
'shch' => array('щ'),
|
||||
'ss' => array('ß'),
|
||||
'sx' => array('ŝ'),
|
||||
@@ -1678,7 +1685,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
'uu' => array('ऊ'),
|
||||
'ya' => array('я'),
|
||||
'yu' => array('ю'),
|
||||
'zh' => array('ж', 'ჟ'),
|
||||
'zh' => array('ж', 'ჟ', 'ژ'),
|
||||
'(c)' => array('©'),
|
||||
'A' => array('Á', 'À', 'Ả', 'Ã', 'Ạ', 'Ă', 'Ắ', 'Ằ', 'Ẳ', 'Ẵ',
|
||||
'Ặ', 'Â', 'Ấ', 'Ầ', 'Ẩ', 'Ẫ', 'Ậ', 'Å', 'Ā', 'Ą',
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../src/Create.php';
|
||||
|
||||
use function Stringy\create as s;
|
||||
|
||||
class CreateTestCase extends PHPUnit_Framework_TestCase
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../src/StaticStringy.php';
|
||||
|
||||
use Stringy\StaticStringy as S;
|
||||
|
||||
class StaticStringyTestCase extends PHPUnit_Framework_TestCase
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../src/Stringy.php';
|
||||
|
||||
use Stringy\Stringy as S;
|
||||
|
||||
class StringyTestCase extends PHPUnit_Framework_TestCase
|
||||
@@ -2374,6 +2372,7 @@ class StringyTestCase extends PHPUnit_Framework_TestCase
|
||||
array('foo', 'bar', '[[:alpha:]]{3}', 'foo'),
|
||||
array('', '', '', '', 'msr', 'UTF-8'),
|
||||
array('bàř', 'fòô ', 'f[òô]+\s', 'bàř', 'msr', 'UTF-8'),
|
||||
array('fòô', 'fò', '(ò)', '\\1ô', 'msr', 'UTF-8'),
|
||||
array('fòô', 'bàř', '[[:alpha:]]{3}', 'fòô', 'msr', 'UTF-8')
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user