/** * Cast associated arrays to objects * * @return mixed */ protected static function objectivy(&$value) { if (Utils::isObject($value)) { $value = (object) $value; } if (is_array($value) || is_object($value)) { foreach ($value as &$item) { static::objectivy($item); } } }
public function testSlicesStrings() { $this->assertEquals('cba', Utils::slice('abc', null, null, -1)); $this->assertEquals('ac', Utils::slice('abc', null, null, 2)); $this->assertEquals('bc', Utils::slice('abc', 1)); }