toSerializableArray() public method

Returns array representation of error suitable for serialization
public toSerializableArray ( ) : array
return array
Beispiel #1
0
 /**
  * @it serializes to include path
  */
 public function testSerializesToIncludePath()
 {
     $e = new Error('msg', null, null, null, ['path', 3, 'to', 'field']);
     $this->assertEquals(['path', 3, 'to', 'field'], $e->path);
     $this->assertEquals(['message' => 'msg', 'path' => ['path', 3, 'to', 'field']], $e->toSerializableArray());
 }
Beispiel #2
0
 /**
  * @param Error $error
  * @return array
  */
 public static function formatError(Error $error)
 {
     return $error->toSerializableArray();
 }