/** * Populates the parser object with the properties parser and the class object. * * @param string $className * @param RequestParser $parserObject * @param RequestBuilder $requestBuilder * * @return RequestParser */ public function populateRequestParser($className, RequestParser $parserObject, RequestBuilder $requestBuilder) { $parserObject->setRequestObject(new $className()); foreach ($this->reflectionService->getClassProperties($className) as $property) { $parserObject->addPropertyParser($this->getPropertyParserBuilder($property)->build($requestBuilder)); } return $parserObject; }
/** * @param array $request * @param RequestParser $parserObject */ private function parseArray(array $request, RequestParser $parserObject) { $return = []; foreach ($request as $requestItem) { $return[] = $parserObject->parse($requestItem); } return $return; }