mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-12 16:24:00 +02:00
Use $this
This commit is contained in:
@@ -1076,12 +1076,10 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function substr($start, $length = null)
|
public function substr($start, $length = null)
|
||||||
{
|
{
|
||||||
$stringy = self::create($this->str, $this->encoding);
|
|
||||||
$length = $length === null ? $this->length() : $length;
|
$length = $length === null ? $this->length() : $length;
|
||||||
|
$str = mb_substr($this->str, $start, $length, $this->encoding);
|
||||||
|
|
||||||
$stringy->str = mb_substr($stringy->str, $start, $length, $stringy->encoding);
|
return self::create($str, $this->encoding);
|
||||||
|
|
||||||
return $stringy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user