/** * @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()); }
/** * @param Error $error * @return array */ public static function formatError(Error $error) { return $error->toSerializableArray(); }