Пример #1
0
 public function isValid($value)
 {
     $objectTest = new ObjectType();
     return is_array($value) || $objectTest->isValid($value) && $value instanceof \ArrayAccess;
 }
Пример #2
0
 public function isValid($value)
 {
     $objectTest = new ObjectType();
     $stringTest = new StringType();
     return $objectTest->isValid($value) ? method_exists($value, '__toString') : $stringTest->isValid((string) $value);
 }