public function getErrors(string $field) : array
    {
        $compiledErrors = [];

        foreach ($this->errorSlugsAndPlaceholders as $errorData) {
            $compiledErrors[] = $this->errorTemplateCompiler->compile(
                $field,
                $this->errorTemplateRegistry->getErrorTemplate($field, $errorData['slug']),
                $errorData['placeholders']
            );
        }

        return $compiledErrors;
    }
public function getErrors(string $field) : array
    {
        $compiledErrors = [];

        foreach ($this->errorSlugsAndPlaceholders as $errorData) {
            $compiledErrors[] = $this->errorTemplateCompiler->compile(
                $field,
                $this->errorTemplateRegistry->getErrorTemplate($field, $errorData['slug']),
                $errorData['placeholders']
            );
        }

        return $compiledErrors;
    }
public function getErrors ( string $ field ) : array { $ compiledErrors = [ ] ; foreach ( $ this -> errorSlugsAndPlaceholders as $ errorData ) { $ compiledErrors [ ] = $ this -> errorTemplateCompiler -> compile ( $ field , $ this -> errorTemplateRegistry -> getErrorTemplate ( $ field , $ errorData [ 'slug' ] ) , $ errorData [ 'placeholders' ] ) ; } return $ compiledErrors ; }
Gets the error messages

@param string $field The name of the field whose errors we're getting
@return array The list of errors
Gets the error messages