/** * {@inheritdoc} */ public function parselCreate($data) { $values = ['data' => $data]; $constraint = new Assert\Collection(['data' => new Assert\Required([new Assert\Type(['type' => 'array', 'message' => 'Parsel data should be an {{ type }}'])])]); $this->validator->validateValues($values, $constraint); return $this->mapper->map($this->impl->parselCreate($data), 'Parsel'); }