mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-13 08:44:01 +02:00
Go psr-2
This commit is contained in:
@@ -105,7 +105,8 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
* @param mixed $offset The index to check
|
||||
* @return boolean Whether or not the index exists
|
||||
*/
|
||||
public function offsetExists($offset) {
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
$length = $this->length();
|
||||
$offset = (int) $offset;
|
||||
|
||||
@@ -127,7 +128,8 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
* @throws \OutOfBoundsException If the positive or negative offset does
|
||||
* not exist
|
||||
*/
|
||||
public function offsetGet($offset) {
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
$offset = (int) $offset;
|
||||
$length = $this->length();
|
||||
|
||||
@@ -146,7 +148,8 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
* @param mixed $value Value to set
|
||||
* @throws \Exception When called
|
||||
*/
|
||||
public function offsetSet($offset, $value) {
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
// Stringy is immutable, cannot directly set char
|
||||
throw new \Exception('Stringy object is immutable, cannot modify char');
|
||||
}
|
||||
@@ -158,7 +161,8 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
* @param mixed $offset The index of the character
|
||||
* @throws \Exception When called
|
||||
*/
|
||||
public function offsetUnset($offset) {
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
// Don't allow directly modifying the string
|
||||
throw new \Exception('Stringy object is immutable, cannot unset char');
|
||||
}
|
||||
|
Reference in New Issue
Block a user