private function realParseErrors(FormInterface $form, array &$results)
	{
		$errors = $form->getErrors();

		if (count($errors) > 0)
		{
			$config      = $form->getConfig();
			$name        = $form->getName();
			$label       = $config->getOption('label');
			$translation = $this->getTranslationDomain($form);
			if (empty($label))
			{
				$label = ucfirst(trim(strtolower(preg_replace(array('/([A-Z])/', '/[_\s]+/'), array('_$1', ' '), $name))));
			}

			$results[] = array(
				'name'        => $name,
				'label'       => $label,
				'errors'      => $errors,
				'translation' => $translation,
			);
		}

		$children = $form->all();
		if (count($children) > 0)
		{
			foreach ($children as $child)
			{
				if ($child instanceof FormInterface)
				{
					$this->realParseErrors($child, $results);
				}
			}
		}

		return $results;
	}
private function realParseErrors(FormInterface $form, array &$results)
	{
		$errors = $form->getErrors();

		if (count($errors) > 0)
		{
			$config      = $form->getConfig();
			$name        = $form->getName();
			$label       = $config->getOption('label');
			$translation = $this->getTranslationDomain($form);
			if (empty($label))
			{
				$label = ucfirst(trim(strtolower(preg_replace(array('/([A-Z])/', '/[_\s]+/'), array('_$1', ' '), $name))));
			}

			$results[] = array(
				'name'        => $name,
				'label'       => $label,
				'errors'      => $errors,
				'translation' => $translation,
			);
		}

		$children = $form->all();
		if (count($children) > 0)
		{
			foreach ($children as $child)
			{
				if ($child instanceof FormInterface)
				{
					$this->realParseErrors($child, $results);
				}
			}
		}

		return $results;
	}
private function realParseErrors ( FormInterface $ form , array & $ results ) { $ errors = $ form -> getErrors ( ) ; if ( count ( $ errors ) > 0 ) { $ config = $ form -> getConfig ( ) ; $ name = $ form -> getName ( ) ; $ label = $ config -> getOption ( 'label' ) ; $ translation = $ this -> getTranslationDomain ( $ form ) ; if ( empty ( $ label ) ) { $ label = ucfirst ( trim ( strtolower ( preg_replace ( array ( '/([A-Z])/' , '/[_\s]+/' ) , array ( '_$1' , ' ' ) , $ name ) ) ) ) ; } $ results [ ] = array ( 'name' => $ name , 'label' => $ label , 'errors' => $ errors , 'translation' => $ translation , ) ; } $ children = $ form -> all ( ) ; if ( count ( $ children ) > 0 ) { foreach ( $ children as $ child ) { if ( $ child instanceof FormInterface ) { $ this -> realParseErrors ( $ child , $ results ) ; } } } return $ results ; }
This does the actual job. Method travels through all levels of form recursively and gathers errors.

@param   FormInterface $form
@param   array         &$results

@return  array
This does the actual job . Method travels through all levels of form recursively and gathers errors .