public function isValid($value) { $objectTest = new ObjectType(); return is_array($value) || $objectTest->isValid($value) && $value instanceof \ArrayAccess; }
public function isValid($value) { $objectTest = new ObjectType(); $stringTest = new StringType(); return $objectTest->isValid($value) ? method_exists($value, '__toString') : $stringTest->isValid((string) $value); }